From 593156339512d63495ade844a807b3f822330ca1 Mon Sep 17 00:00:00 2001 From: nicknickkk <183576428+nicknickkk@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:23:40 +0800 Subject: [PATCH] Delete plugins/aws/access_key.go --- plugins/aws/access_key.go | 86 --------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 plugins/aws/access_key.go diff --git a/plugins/aws/access_key.go b/plugins/aws/access_key.go deleted file mode 100644 index 5d7e2cc07..000000000 --- a/plugins/aws/access_key.go +++ /dev/null @@ -1,86 +0,0 @@ -package aws - -import ( - "github.com/1Password/shell-plugins/sdk" - "github.com/1Password/shell-plugins/sdk/importer" - "github.com/1Password/shell-plugins/sdk/schema" - "github.com/1Password/shell-plugins/sdk/schema/credname" - "github.com/1Password/shell-plugins/sdk/schema/fieldname" -) - -func AccessKey() schema.CredentialType { - return schema.CredentialType{ - Name: credname.AccessKey, - DocsURL: sdk.URL("https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html"), - ManagementURL: sdk.URL("https://console.aws.amazon.com/iam"), - Fields: []schema.CredentialField{ - { - Name: fieldname.AccessKeyID, - MarkdownDescription: "The ID of the access key used to authenticate to AWS.", - Composition: &schema.ValueComposition{ - Length: 20, - Prefix: "AKIA", - Charset: schema.Charset{ - Uppercase: true, - Digits: true, - }, - }, - }, - { - Name: fieldname.SecretAccessKey, - MarkdownDescription: "The secret access key used to authenticate to AWS.", - Secret: true, - Composition: &schema.ValueComposition{ - Length: 40, - Charset: schema.Charset{ - Uppercase: true, - Lowercase: true, - Digits: true, - }, - }, - }, - { - Name: fieldname.DefaultRegion, - MarkdownDescription: "The default region to use for this access key.", - Optional: true, - }, - { - Name: fieldname.OneTimePassword, - MarkdownDescription: "The one-time code value for MFA authentication.", - Optional: true, - }, - { - Name: fieldname.MFASerial, - MarkdownDescription: "ARN of the MFA serial number to use to generate temporary STS credentials if the item contains a TOTP setup.", - Optional: true, - }, - }, - DefaultProvisioner: NewSTSProvisioner(""), - Importer: importer.TryAll( - importer.TryEnvVarPair(defaultEnvVarMapping), - importer.TryEnvVarPair(map[string]sdk.FieldName{ - "AMAZON_ACCESS_KEY_ID": fieldname.AccessKeyID, - "AMAZON_SECRET_ACCESS_KEY": fieldname.SecretAccessKey, - "AWS_DEFAULT_REGION": fieldname.DefaultRegion, - }), - importer.TryEnvVarPair(map[string]sdk.FieldName{ - "AWS_ACCESS_KEY": fieldname.AccessKeyID, - "AWS_SECRET_KEY": fieldname.SecretAccessKey, - "AWS_DEFAULT_REGION": fieldname.DefaultRegion, - }), - importer.TryEnvVarPair(map[string]sdk.FieldName{ - "AWS_ACCESS_KEY": fieldname.AccessKeyID, - "AWS_ACCESS_SECRET": fieldname.SecretAccessKey, - "AWS_DEFAULT_REGION": fieldname.DefaultRegion, - }), - TryAWSVaultBackends(), - TryCredentialsFile(), - ), - } -} - -var defaultEnvVarMapping = map[string]sdk.FieldName{ - "AWS_ACCESS_KEY_ID": fieldname.AccessKeyID, - "AWS_SECRET_ACCESS_KEY": fieldname.SecretAccessKey, - "AWS_DEFAULT_REGION": fieldname.DefaultRegion, -}