Skip to content

Commit

Permalink
[WR116] Add AccountV2 Client to Config
Browse files Browse the repository at this point in the history
  • Loading branch information
rosasck committed Aug 17, 2021
1 parent bece743 commit 7514d64
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
23 changes: 13 additions & 10 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ type ToznySDKV3 struct {
*identityClient.E3dbIdentityClient
*storageClient.StorageClient
*pdsClient.E3dbPDSClient
*accountClient.E3dbAccountClientV2
// Account public authentication material for creating and deriving account credentials
AccountUsername string
// Account private authentication material for creating and deriving account credentials
Expand Down Expand Up @@ -713,22 +714,24 @@ type ToznySDKConfig struct {
// NewToznySDK returns a new instance of the ToznySDK initialized with the provided
// config or error (if any).
func NewToznySDKV3(config ToznySDKConfig) (*ToznySDKV3, error) {
accountServiceV2Client := accountClient.NewV2(config.ClientConfig)
accountServiceClient := accountClient.New(config.ClientConfig)
identityClient := identityClient.New(config.ClientConfig)
storageClient := storageClient.New(config.ClientConfig)
pdsClient := pdsClient.New(config.ClientConfig)

return &ToznySDKV3{
E3dbAccountClient: &accountServiceClient,
E3dbIdentityClient: &identityClient,
StorageClient: &storageClient,
E3dbPDSClient: &pdsClient,
AccountUsername: config.AccountUsername,
AccountPassword: config.AccountPassword,
APIEndpoint: config.APIEndpoint,
ClientID: config.ClientID,
CurrentIdentity: config.TozIDSessionIdentityData,
config: config.ClientConfig,
E3dbAccountClient: &accountServiceClient,
E3dbAccountClientV2: &accountServiceV2Client,
E3dbIdentityClient: &identityClient,
StorageClient: &storageClient,
E3dbPDSClient: &pdsClient,
AccountUsername: config.AccountUsername,
AccountPassword: config.AccountPassword,
APIEndpoint: config.APIEndpoint,
ClientID: config.ClientID,
CurrentIdentity: config.TozIDSessionIdentityData,
config: config.ClientConfig,
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/jawher/mow.cli v1.2.0
github.com/mitchellh/go-homedir v1.1.0
github.com/stretchr/testify v1.7.0 // indirect
github.com/tozny/e3db-clients-go v0.0.146
github.com/tozny/e3db-clients-go v0.0.149
golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf
golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tozny/e3db-clients-go v0.0.146 h1:pSJKF5W9d/RSVj4QgQylBQIZUT3AWoflQ1t4AMg70Ko=
github.com/tozny/e3db-clients-go v0.0.146/go.mod h1:xqnK5S5r0qLrKCUms5Mi/3oij2ppNg2lk/8iggyn7IQ=
github.com/tozny/e3db-clients-go v0.0.149 h1:BBx0V9H52yfS/9oEk5Q15CDjUb6T6upgkYgbzZbtHDg=
github.com/tozny/e3db-clients-go v0.0.149/go.mod h1:xqnK5S5r0qLrKCUms5Mi/3oij2ppNg2lk/8iggyn7IQ=
github.com/tozny/utils-go v0.0.35 h1:gPvhlQ8QCoLBUjIx1COfYy6o4dfSM8Lrh+2FV9Ask+g=
github.com/tozny/utils-go v0.0.35/go.mod h1:SHi9wnpPEEzAxbwcBhRd+jW32r+gY6S+AcWweuGytRw=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down

0 comments on commit 7514d64

Please sign in to comment.