@@ -32,7 +32,7 @@ func (c *Ocfclient) Initialize(accessToken, cloudConfiguration string) error {
3232 return err
3333 }
3434 appCallback , err := app .NewApp (& app.AppConfig {
35- RootCA : lets + "\n " + c .cloudConfiguration .CloudCertificateAuthorities ,
35+ RootCA : lets + "\n " + c .cloudConfiguration .GetCloudCertificateAuthorities () ,
3636 })
3737 localClient , err := local .NewClientFromConfig (& local.Config {
3838 DisablePeerTCPSignalMessageCSMs : true ,
@@ -41,9 +41,10 @@ func (c *Ocfclient) Initialize(accessToken, cloudConfiguration string) error {
4141 DeviceCacheExpirationSeconds : 3600 ,
4242 MaxMessageSize : 512 * 1024 ,
4343 DeviceOwnershipBackend : & local.DeviceOwnershipBackendConfig {
44- AccessTokenURL : c .cloudConfiguration .AccessTokenUrl ,
45- AuthCodeURL : c .cloudConfiguration .AuthCodeUrl ,
46- SigningServerAddress : c .cloudConfiguration .SigningServerAddress ,
44+ AccessTokenURL : c .cloudConfiguration .GetAccessTokenUrl (),
45+ AuthCodeURL : c .cloudConfiguration .GetAuthCodeUrl (),
46+ SigningServerAddress : c .cloudConfiguration .GetSigningServerAddress (),
47+ JWTClaimOwnerID : c .cloudConfiguration .GetJwtClaimOwnerId (),
4748 },
4849 }, appCallback , func (err error ) {})
4950 if err != nil {
@@ -137,7 +138,7 @@ func (c *Ocfclient) SetAccessForCloud(deviceID string) error {
137138 Permission : acl .AllPermissions ,
138139 Subject : acl.Subject {
139140 Subject_Device : & acl.Subject_Device {
140- DeviceID : c .cloudConfiguration .CloudId ,
141+ DeviceID : c .cloudConfiguration .GetCloudId () ,
141142 },
142143 },
143144 Resources : acl .AllResources ,
@@ -149,21 +150,21 @@ func (c *Ocfclient) SetAccessForCloud(deviceID string) error {
149150 if err != nil {
150151 return err
151152 }
152- caCert := []byte (c .cloudConfiguration .CloudCertificateAuthorities )
153+ caCert := []byte (c .cloudConfiguration .GetCloudCertificateAuthorities () )
153154 certs , err := security .ParseX509FromPEM (caCert )
154155 if err != nil {
155156 return err
156157 }
157- return p .AddCertificateAuthority (ctx , c .cloudConfiguration .CloudId , certs [0 ])
158+ return p .AddCertificateAuthority (ctx , c .cloudConfiguration .GetCloudId () , certs [0 ])
158159}
159160
160161// OnboardDevice registers the device to the plgd cloud
161162func (c * Ocfclient ) OnboardDevice (deviceID , authCode string ) error {
162163 ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
163164 defer cancel ()
164- authorizationProvider := c .cloudConfiguration .CloudAuthorizationProvider
165- cloudURL := c .cloudConfiguration .CloudUrl
166- cloudID := c .cloudConfiguration .CloudId
165+ authorizationProvider := c .cloudConfiguration .GetCloudAuthorizationProvider ()
166+ cloudURL := c .cloudConfiguration .GetCloudUrl ()
167+ cloudID := c .cloudConfiguration .GetCloudId ()
167168 return c .localClient .OnboardDevice (ctx , deviceID , authorizationProvider , cloudURL , authCode , cloudID )
168169}
169170
0 commit comments