hashicorp / go-secure-stdlib

Mozilla Public License 2.0
64 stars 24 forks source link

awsutil: add ability to mock IAM and STS APIs #12

Closed vancluever closed 3 years ago

vancluever commented 3 years ago

This adds the ability to supply mock IAM and STS interfaces to use with the RotateKeys, CreateAccessKey, DeleteAccessKey, and GetCallerIdentity methods.

Additionally, work has been done to incorporate the existing IAM mock object into the package, in addition to adding a similar STS mock that allows for the mocking of the GetCallerIdentity method.

Factory functions are also included to allow these to be incorporated seamlessly into the call path, in addition to allowing for introspection into any session data being received by the constructor functions.

jefferai commented 3 years ago

@calvn Do you want you or someone else to do an additional review?

vancluever commented 3 years ago

@calvn @jefferai just added one more update to this (ability to make a mock option that errors out). Can you give it one more quick check before merging? Ty!

jefferai commented 3 years ago

@vancluever Talked to @calvn and he's fine with merging this as-is, so merging!