You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified all of my SDK modules are up-to-date (you can perform a bulk update with 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
Select this option if this issue appears to be a regression.
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:
type AwsCredentials struct {
Credentials aws.Credentials
}
Have the above type and then the following code (omitting if err != nil { statements for readability) :
req, err := http.NewRequest("GET", "https://"+our creds endpoint+"/role-aliases/"+role name here+"/credentials", nil) // make req
req.Header.Add("x-amzn-iot-thingname", deviceName) //add header
res, err := httpClient.Do(req) //do request
defer res.Body.Close()
awsCreds := &types.AwsCredentials{} // using Credentials Type here to init
json.NewDecoder(res.Body).Decode(awsCreds) // decoding with that type
Now if you print out awsCreds, it returns 0001-01-01T00:00:00Z for Expires - 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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: