awslabs / tough

Rust libraries and tools for using and generating TUF repositories
191 stars 45 forks source link

print detailed SDK errors for KMS and SSM #667

Closed bcressey closed 11 months ago

bcressey commented 11 months ago

Issue #, if available: Fixes #661

Description of changes: Call Error::source on SDK errors to print more details about the underlying cause.

Testing: Before:

$ tuftool root add-key 99.root.json -k aws-kms://my-key-account/alias/foo -r root
Unable to parse keypair: Failed to get public key for aws-kms://my-key-account/alias/foo : failed to construct request

After:

$ tuftool root add-key 99.root.json -k aws-kms://my-key-account/alias/foo -r root
Unable to parse keypair: Failed to get public key for aws-kms://my-key-account/alias/foo : failed to load credentials from the credentials cache

Terms of contribution: By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.