Skip to content

Commit 6823b5e

Browse files
authored
Pomcho555 add browser autofill (#136)
* Add -browser-autofill option * Increment minor version and add CHANGELOG.md
1 parent fc3164c commit 6823b5e

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
1.1.0 - 2024-12-21
5+
==================
6+
- Supported new option `--browser-autofill|-b` to enable browser-autofill in saml2aws
7+
48
1.0.1 - 2024-05-21
59
==================
610
- Test with Python 3.12.
711
- No longer test with Python 3.8 and Python 3.9.
812

9-
1013
1.0.0 - 2023-02-15
1114
==================
1215
- Replaced `PyInquirer` with [InquirerPy](https://github.com/kazhala/InquirerPy) - https://github.com/kyhau/saml2aws-multi/issues/20
@@ -34,4 +37,4 @@ All notable changes to this project will be documented in this file.
3437

3538
0.1.0 - 2019-09-30
3639
==================
37-
- Initial version of saml2awsmulti.
40+
- Initial version of saml2awsmulti.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Options:
4646
multi/aws_login_roles.csv. [default: False]
4747
4848
-t, --session-duration TEXT Set the session duration in seconds,
49+
-b, --browser-autofill Enable browser-autofill.
4950
-d, --debug Enable debug mode. [default: False]
5051
--help Show this message and exit.
5152

saml2awsmulti/aws_login.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,16 @@ def pre_select_options(profile_rolearn_dict, keywords):
8181
@click.option("--refresh-cached-roles", "-r", is_flag=True, show_default=True,
8282
help=f"Re-retrieve the roles associated to the username and password you provided and save the roles into {ALL_ROLES_FILE}.")
8383
@click.option("--session-duration", "-t", help="Set the session duration in seconds.")
84+
@click.option("--browser-autofill", "-b", is_flag=True, show_default=True, help="Enable browser-autofill.")
8485
@click.option("--debug", "-d", is_flag=True, show_default=True, help="Enable debug mode.")
8586
@click.pass_context
86-
def main_cli(ctx, shortlisted, pre_select, profile_name_format, refresh_cached_roles, session_duration, debug):
87+
def main_cli(ctx, shortlisted, pre_select, profile_name_format, refresh_cached_roles, session_duration, browser_autofill, debug):
8788
if debug:
8889
logging.getLogger().setLevel(logging.DEBUG)
8990

9091
if ctx.invoked_subcommand is None:
9192
try:
92-
saml2aws_helper = Saml2AwsHelper(SAML2AWS_CONFIG_FILE, session_duration)
93+
saml2aws_helper = Saml2AwsHelper(SAML2AWS_CONFIG_FILE, session_duration, browser_autofill)
9394

9495
profile_rolearn_dict = create_profile_rolearn_dict(
9596
saml2aws_helper,

saml2awsmulti/saml2aws_helper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77

88
class Saml2AwsHelper:
9-
def __init__(self, configfile, session_duration):
9+
def __init__(self, configfile, session_duration, browser_autofill):
1010
self._configfile = configfile
1111
self._session_duration = session_duration
12+
self._browser_autofill = browser_autofill
1213
self._uname = None
1314
self._upass = None
1415

@@ -70,6 +71,9 @@ def run_saml2aws_login(self, role_arn, profile_name):
7071
if self._session_duration:
7172
cmd = f"{cmd} --session-duration={self._session_duration}"
7273

74+
if self._browser_autofill:
75+
cmd = f"{cmd} --browser-autofill"
76+
7377
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
7478
for line in p.stdout.readlines():
7579
logging.debug(line.decode("utf-8").rstrip("\r|\n"))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import find_packages, setup
22

33
__title__ = "saml2awsmulti"
4-
__version__ = "1.0.1"
4+
__version__ = "1.1.0"
55
__author__ = "kyhau"
66
__email__ = "[email protected]"
77
__uri__ = "https://github.com/kyhau/saml2aws-multi"

0 commit comments

Comments
 (0)