File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,7 @@ The official documentation is available at https://developers.google.com/tink.
11112 . Check the [ example] ( ./integration/scwkms/scw_kms_client_test.go ) to use the
1212 extension. Make sure to replace the client fields with your own
1313 configuration.
14+ 3 . Rather than configuring the provider in-app, you can also use Scaleway's
15+ configuration file and environment variables. Check [ Scaleway's configuration
16+ documentation] ( https://github.com/scaleway/scaleway-cli/blob/master/docs/commands/config.md )
17+ for more details.
Original file line number Diff line number Diff line change @@ -27,7 +27,21 @@ type scwClient struct {
2727var _ registry.KMSClient = (* scwClient )(nil )
2828
2929func NewClient (uriPrefix string ) (registry.KMSClient , error ) {
30- return NewClientWithOptions (uriPrefix , scw .WithEnv ())
30+ config , err := scw .LoadConfig ()
31+ if err != nil {
32+ return nil , err
33+ }
34+
35+ activeProfile , err := config .GetActiveProfile ()
36+ if err != nil {
37+ return nil , err
38+ }
39+
40+ return NewClientWithOptions (
41+ uriPrefix ,
42+ scw .WithProfile (activeProfile ),
43+ scw .WithEnv (),
44+ )
3145}
3246
3347func NewClientWithOptions (uriPrefix string , opts ... scw.ClientOption ) (registry.KMSClient , error ) {
You can’t perform that action at this time.
0 commit comments