secrets
secrets copied to clipboard
Ds 5114 update the aws secrets provider to aws sdk v2
What this PR does / why we need it: In this PR we have updated the packages used from aws sdk version 1 to aws sdk version 2. This has been made to maintain consistency in using the same aws sdk version across libopenstorage/secrets and portworx/pds-api repositories.
Which issue(s) this PR fixes (optional) Closes #DS-5114
Special notes for your reviewer:
- The "github.com/aws/aws-sdk-go/aws/awserr" has been replaced with "github.com/aws/smithy-go" for handling the aws errors. As per this documentation
- The error check has been replaced by static texts (https://github.com/arivankar-px/secrets/pull/1/files#diff-d7c16eb48b74572b31bc640e5c3d1ba6c49f8147421ef0c36a4b4ff8e106d528R197) (Line 197), as the new aws sdk secretmanager plugin doesn't have direct text checks.
- Removed the session variable from the struct object (https://github.com/arivankar-px/secrets/pull/1/files#diff-2fbba6c2a61cbd878c0a269d4d534d6015f818d9257e3d9cd90dc676714afb9b) (Line 99), as aws sdk version 2 didn't support sessions.
- Removed the HasExpired() function (https://github.com/libopenstorage/secrets/pull/76/files#diff-f217bfe5d6f82a5018fb3089fb99aa1f6b9dece7b794f14dcfb7412e786e7848) (Line 53), as the new NewStaticCredentialsProvider in aws sdk version 2, has the ability to never expire the credentials.
- The integration test is failing for deleteSecret as the AWS secret deletion process is not immediate and requires some time, hence added the some sleep in the test cases. But the time is variable, hence it has failed.