Nike-Inc / gimme-aws-creds

A CLI that utilizes Okta IdP via SAML to acquire temporary AWS credentials
Apache License 2.0
930 stars 262 forks source link

Feature: Provide the option to 'select all' in profile selection screen #472

Open its-mirus-lu opened 3 months ago

its-mirus-lu commented 3 months ago

Update: PR available in #473

I currently work in an organization where I have over 30 roles. When I use gimme-aws-creds, I want to activate all of them without having to type out "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30". I propose allowing users to type "a" or "all" to activate all roles.

Expected Behavior

I work in an organization where I have over 30+ roles; I'd like to have a way to select all profiles without having to type out 1-to-30 in a comma separated string.

Current Behavior

Current behavior: If a user has 30 roles to activate, they would have to type out 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 in the role selection screen.

Proposed behavior: I propose to allow users to type "A" or "All" to select all roles.

Possible Solution

Method _get_user_int_selections_many in main.py tests for non-integer values provided by the user L424-435

I propose modifying the logic in this method to: a) Modify the "Selections (comma separated)" message to also indicate that users can specify "A" to select all b) Modify the logic to detect when "a" or "all" is provided and populate the selections set with all the values in min_int and max_int range

Context

I work in an organization where I have over 30 roles to work with; I need to activate any number of profiles when I start my day and I prefer to activate all the profiles and just export AWS_PROFILE=<whatever profile I'm working with>; rather than typing out "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30" I want to just type "a" or "all"; this would save a lot of typing.

Your Environment