Skip to content

Commit

Permalink
fix: kms no key (#1815)
Browse files Browse the repository at this point in the history
* fix: secret status code

* fix: cast
  • Loading branch information
skynet2 authored Dec 4, 2024
1 parent 620e4db commit 56e765d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/storage/awsecret/arieskmsstore/aries_kms_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ package arieskmsstore
import (
"context"
"encoding/json"
"errors"
"path"

"github.com/aws/aws-sdk-go-v2/service/secretsmanager"
"github.com/aws/aws-sdk-go-v2/service/secretsmanager/types"
"github.com/samber/lo"
"github.com/trustbloc/kms-go/kms"
"github.com/trustbloc/logutil-go/pkg/log"

"github.com/trustbloc/vcs/internal/logfields"
Expand Down Expand Up @@ -70,6 +73,12 @@ func (s *Store) Get(keysetID string) ([]byte, error) {
out, err := s.client.GetSecretValue(context.Background(), &secretsmanager.GetSecretValueInput{
SecretId: lo.ToPtr(s.GetPath(keysetID)),
})

var smErr *types.ResourceNotFoundException
if errors.As(err, &smErr) {
return nil, kms.ErrKeyNotFound
}

if err != nil {
return nil, err
}
Expand Down

0 comments on commit 56e765d

Please sign in to comment.