-
Notifications
You must be signed in to change notification settings - Fork 119
RoleSessionName Exceeds Maximum Length Constraint #243
Copy link
Copy link
Open
Description
The roleSessionName function generates a name that may exceed the 64-character constraint, causing a ValidationError. This issue arises when the hostname used for the suffix is too long.
ValidationError: 1 validation error detected: Value 'aws-sigv4-proxy-our-very-long-host-name-that-is-far-more-than-60-characters-long...' at 'roleSessionName' failed to satisfy constraint: Member must have length less than or equal to 64
How to reproduce
- Use a hostname longer than 60 characters.
- Execute the code from the aws-sigv4-proxy repository.
- Observe the ValidationError related to the roleSessionName.
Suggested Solutions
- Automatically truncate the session name to fit within 64 characters.
- Allow setting AWS_ROLE_SESSION_NAME via environment variable or CLI flag for customization.
- If more reproduction steps or environment details are available, please provide them.
see also:
func roleSessionName() string {
suffix, err := os.Hostname()
if err != nil {
now := time.Now().Unix()
suffix = strconv.FormatInt(now, 10)
}
return "aws-sigv4-proxy-" + suffix
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels