11package localstack
22
33import (
4- "context"
5-
64 "github.com/1Password/shell-plugins/sdk"
75 "github.com/1Password/shell-plugins/sdk/importer"
86 "github.com/1Password/shell-plugins/sdk/provision"
@@ -14,8 +12,8 @@ import (
1412func APIKey () schema.CredentialType {
1513 return schema.CredentialType {
1614 Name : credname .APIKey ,
17- DocsURL : sdk .URL ("https://localstack.com/docs/api_key " ), // TODO: Replace with actual URL
18- ManagementURL : sdk .URL ("https://console .localstack.com/user/security/tokens " ), // TODO: Replace with actual URL
15+ DocsURL : sdk .URL ("https://docs. localstack.cloud/getting-started/api-key/ " ),
16+ ManagementURL : sdk .URL ("https://app .localstack.cloud/account/apikeys " ),
1917 Fields : []schema.CredentialField {
2018 {
2119 Name : fieldname .APIKey ,
@@ -34,37 +32,9 @@ func APIKey() schema.CredentialType {
3432 DefaultProvisioner : provision .EnvVars (defaultEnvVarMapping ),
3533 Importer : importer .TryAll (
3634 importer .TryEnvVarPair (defaultEnvVarMapping ),
37- TryLocalStackConfigFile (),
3835 )}
3936}
4037
4138var defaultEnvVarMapping = map [string ]sdk.FieldName {
42- "LOCALSTACK_API_KEY" : fieldname .APIKey , // TODO: Check if this is correct
43- }
44-
45- // TODO: Check if the platform stores the API Key in a local config file, and if so,
46- // implement the function below to add support for importing it.
47- func TryLocalStackConfigFile () sdk.Importer {
48- return importer .TryFile ("~/path/to/config/file.yml" , func (ctx context.Context , contents importer.FileContents , in sdk.ImportInput , out * sdk.ImportAttempt ) {
49- // var config Config
50- // if err := contents.ToYAML(&config); err != nil {
51- // out.AddError(err)
52- // return
53- // }
54-
55- // if config.APIKey == "" {
56- // return
57- // }
58-
59- // out.AddCandidate(sdk.ImportCandidate{
60- // Fields: map[sdk.FieldName]string{
61- // fieldname.APIKey: config.APIKey,
62- // },
63- // })
64- })
39+ "LOCALSTACK_API_KEY" : fieldname .APIKey ,
6540}
66-
67- // TODO: Implement the config file schema
68- // type Config struct {
69- // APIKey string
70- // }
0 commit comments