Closed mehiatt closed 2 months ago
We can't change the name of a field in a public API just for the sake of having these field names match up like this. The nomenclature here across AWS is generally inconsistent, some APIs use Expires, others use Expiration. If you want to deserialize some credentials value, you'll need to write logic to handle the mapping.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
If you try to use
aws.Credentials
type with an incoming assume role request, it doesn't map the values correctly because it uses "Expires" vs "Expiration"Regression Issue
Expected Behavior
If the other match, it seems like the expiration date field should also. While this may not be the standard use case, I see a few points with the AWS GoV2 that could benefit from this as well. Maintaining names would also help people when they go though AWS docs and code examples.
Current Behavior
Tldr: It seems like is Expiration either omitted or misspelled in Credentials type.
Reproduction Steps
To reproduce:
Have the above type and then the following code (omitting
if err != nil {
statements for readability) :Now if you print out awsCreds, it returns
0001-01-01T00:00:00Z
forExpires
- I am assuming the default go time object. All the other fields in Credentials match the response names ->AccessKeyID = AccessKeyId (case is technically slightly off here, but the values still map correctly) SessionToken = SessionToken SecretAccessKey = SecretAccessKey
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
latest
Compiler and Version used
1.19
Operating System and version
ubuntu 22.04