From 1ff8723a7287b3afa3bd54c407377beba61139e0 Mon Sep 17 00:00:00 2001 From: AbineshECAD Date: Thu, 21 Jul 2022 21:08:54 +0530 Subject: [PATCH 1/2] Import not supported error + documentation --- docs/aws_kms.md | 4 +++- pkg/vault/aws/awskms.go | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/aws_kms.md b/docs/aws_kms.md index fc607f0b..48870bf7 100644 --- a/docs/aws_kms.md +++ b/docs/aws_kms.md @@ -33,4 +33,6 @@ access_key_id | string | OPTIONAL | IAM user detail secret_access_key | string | OPTIONAL | IAM user detail region | string | ✅ | Region where key is created -The fields `access_key_id` & `secret_access_key` can be set in the environment variables `AWS_ACCESS_KEY_ID` & `AWS_SECRET_ACCESS_KEY` respectively. \ No newline at end of file +The fields `access_key_id` & `secret_access_key` can be set in the environment variables `AWS_ACCESS_KEY_ID` & `AWS_SECRET_ACCESS_KEY` respectively. + +Import command is not available for aws as there is no support for asymmetric keys in AWS KMS. (Ref: ) diff --git a/pkg/vault/aws/awskms.go b/pkg/vault/aws/awskms.go index 1e636b54..bd7b206d 100644 --- a/pkg/vault/aws/awskms.go +++ b/pkg/vault/aws/awskms.go @@ -16,6 +16,7 @@ import ( "github.com/aws/aws-sdk-go/service/kms" "github.com/ecadlabs/signatory/pkg/config" "github.com/ecadlabs/signatory/pkg/cryptoutils" + "github.com/ecadlabs/signatory/pkg/utils" "github.com/ecadlabs/signatory/pkg/vault" "gopkg.in/yaml.v3" @@ -127,6 +128,10 @@ func (v *Vault) ListPublicKeys(ctx context.Context) vault.StoredKeysIterator { } } +func (v *Vault) Import(ctx context.Context, pk cryptoutils.PrivateKey, opt utils.Options) (vault.StoredKey, error) { + return nil, fmt.Errorf("import not supported, please refer -> https://github.com/ecadlabs/signatory/blob/main/docs/aws_kms.md") +} + // Name returns backend name func (v *Vault) Name() string { return "AWSKMS" From 7f12b5719535aa6b96531d35564c9d4e1f46c469 Mon Sep 17 00:00:00 2001 From: AbineshECAD Date: Thu, 21 Jul 2022 21:12:54 +0530 Subject: [PATCH 2/2] Import help corrected to from --- cmd/commands/import.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/commands/import.go b/cmd/commands/import.go index 863000ce..686edfe8 100644 --- a/cmd/commands/import.go +++ b/cmd/commands/import.go @@ -17,7 +17,7 @@ func NewImportCommand(c *Context) *cobra.Command { ) importCmd := &cobra.Command{ - Use: "import ", + Use: "import ", Short: "Import Tezos private keys (edsk..., spsk..., p2sk...)", Args: cobra.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error {