Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2][sso][feedback-wanted] Configure SSO session support #7364

Merged
merged 4 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/next-release/enhancement-ssologin-96466.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "enhancement",
"category": "``sso login``",
"description": "Add ``--sso-session`` argument to enable direct SSO login with a ``sso-session``"
}
5 changes: 5 additions & 0 deletions .changes/next-release/feature-configuresso-52515.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "``configure sso``",
"description": "Add support for configuring ``sso-session`` as part of configuring SSO-enabled profile"
}
5 changes: 5 additions & 0 deletions .changes/next-release/feature-configuressosession-45599.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "``configure sso-session``",
"description": "Add new ``configure sso-session`` command for creating and updating ``sso-session`` configurations"
}
10 changes: 7 additions & 3 deletions awscli/customizations/configure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def profile_to_section(profile_name):
"""Converts a profile name to a section header to be used in the config."""
if profile_name == 'default':
return profile_name
if any(c in _WHITESPACE for c in profile_name):
profile_name = shlex_quote(profile_name)
return 'profile %s' % profile_name
return get_section_header('profile', profile_name)


def get_section_header(section_type, section_name):
if any(c in _WHITESPACE for c in section_name):
section_name = shlex_quote(section_name)
return f'{section_type} {section_name}'
2 changes: 2 additions & 0 deletions awscli/customizations/configure/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from awscli.customizations.configure.importer import ConfigureImportCommand
from awscli.customizations.configure.listprofiles import ListProfilesCommand
from awscli.customizations.configure.sso import ConfigureSSOCommand
from awscli.customizations.configure.sso import ConfigureSSOSessionCommand
from awscli.customizations.configure.exportcreds import \
ConfigureExportCredentialsCommand

Expand Down Expand Up @@ -82,6 +83,7 @@ class ConfigureCommand(BasicCommand):
{'name': 'import', 'command_class': ConfigureImportCommand},
{'name': 'list-profiles', 'command_class': ListProfilesCommand},
{'name': 'sso', 'command_class': ConfigureSSOCommand},
{'name': 'sso-session', 'command_class': ConfigureSSOSessionCommand},
{'name': 'export-credentials',
'command_class': ConfigureExportCredentialsCommand},
]
Expand Down
Loading