tilfinltd / aws-extend-switch-roles

Extend your AWS IAM switching roles by Chrome extension, Firefox add-on, or Edge add-on
https://goo.gl/0QFjow
MIT License
1.31k stars 140 forks source link

limit displayname to 64 characters (#244) #253

Closed samhpickering closed 1 year ago

samhpickering commented 2 years ago

This is a potential fix for #244 - display names over 64 characters cause a 400 response when attempting to switch roles. The change truncates the role name when the total display name length would exceed the limit while leaving the account ID whole (if enabled).

tilfin commented 2 years ago

Thanks, but I'm thinking it would be better to invalidate profile names that exceed 64 chars in the configuration editor. Once long profile names are allowed, they must be shortened later.

samhpickering commented 1 year ago

There are a couple of benefits I saw to this approach:

  1. Full profile names are visible in the popup interface - useful when you have many roles/environments
  2. When enabling/disabling account ID display, profile name length can adjust dynamically

Validation in tandem with automatic shortening might also work well - if the profile names are too long, then warn the user that their profile names will be shortened for display. This would give them the option to shorten them manually if they preferred.