From 1af1ee09ab0bf2a4b9503688b807222f9f44e207 Mon Sep 17 00:00:00 2001 From: Dustin Rodrigues Date: Wed, 30 Mar 2022 10:35:31 -0400 Subject: [PATCH 1/2] use poetry_core to build (#57) --- cli/pyproject.toml | 4 ++-- lib/pyproject.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/pyproject.toml b/cli/pyproject.toml index 28caf90..2e5cd65 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -36,5 +36,5 @@ requests = "^2.26.0" pylint = "^2.5.2" [build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" +requires = ["poetry_core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/lib/pyproject.toml b/lib/pyproject.toml index c85be5e..7036f33 100644 --- a/lib/pyproject.toml +++ b/lib/pyproject.toml @@ -29,5 +29,5 @@ mypy = "^0.931" types-python-dateutil = "^2.8.7" [build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" +requires = ["poetry_core>=1.0.0"] +build-backend = "poetry.core.masonry.api" From d9c0642cc9a595d9e61a3ca1763db33e6a96e4bd Mon Sep 17 00:00:00 2001 From: Krzysztof Nazarewski <3494992+nazarewk@users.noreply.github.com> Date: Thu, 21 Apr 2022 11:11:48 +0200 Subject: [PATCH 2/2] Configurable SSO directories Allows configuring SSO directories explicitly in addition to more sane defaults (discovering them from AWS SDK credentials/config file locations) --- lib/aws_sso_lib/sso.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/aws_sso_lib/sso.py b/lib/aws_sso_lib/sso.py index 74de1c2..f0e48ca 100644 --- a/lib/aws_sso_lib/sso.py +++ b/lib/aws_sso_lib/sso.py @@ -37,12 +37,20 @@ from .exceptions import InvalidSSOConfigError, AuthDispatchError, AuthenticationNeededError from .browser import OpenBrowserHandler, non_interactive_auth_raiser -SSO_TOKEN_DIR = os.path.expanduser( - os.path.join("~", ".aws", "sso", "cache") +AWS_CREDENTIALS_DIR = ( + os.path.dirname(os.environ.get("AWS_SHARED_CREDENTIALS_FILE", "")) or + os.path.dirname(os.environ.get("AWS_CONFIG_FILE", "")) or + os.path.expanduser(os.path.join("~", ".aws")) ) -CREDENTIALS_CACHE_DIR = os.path.expanduser( - os.path.join("~", ".aws", "cli", "cache") +SSO_TOKEN_DIR = ( + os.environ.get("AWS_SSO_UTIL_SSO_TOKEN_DIR") or + os.path.join(AWS_CREDENTIALS_DIR, "sso", "cache") +) + +CREDENTIALS_CACHE_DIR = ( + os.environ.get("AWS_SSO_UTIL_CREDENTIALS_CACHE_DIR") or + os.path.join(AWS_CREDENTIALS_DIR, "cli", "cache") ) LOGGER = logging.getLogger(__name__)