From 610abfae69471cb16208a2f2538023090d1f1b8c Mon Sep 17 00:00:00 2001 From: Phillip Ferentinos Date: Tue, 14 Oct 2025 09:47:12 -0500 Subject: [PATCH 1/2] fix(stsauth): Only parse input fields for the loginForm form to submit the mfa login page included two username fields (username and UserName) in two different forms. the UserName field was resulting in a 500 error from the upstream server. this change only submits input fields from the loginForm form in the UI. this change also adds error handling for when the login response is >=400 and removes an unused dependency on the datetime module --- sts_auth/stsauth.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sts_auth/stsauth.py b/sts_auth/stsauth.py index 9357210..fe6f53b 100755 --- a/sts_auth/stsauth.py +++ b/sts_auth/stsauth.py @@ -1,7 +1,6 @@ import os import re import sys -from datetime import datetime from typing import Optional, Mapping from urllib.parse import urlparse, urlunparse @@ -128,7 +127,7 @@ def generate_payload_from_login_page(self, response: requests.Response) -> Mappi login_page = BeautifulSoup(response.text, "html.parser") payload = {} - for input_tag in login_page.find_all(re.compile("(INPUT|input)")): + for input_tag in login_page.find(id="loginForm").find_all(re.compile("(INPUT|input)")): name = input_tag.get("name", "") value = input_tag.get("value", "") logger.debug("Adding value for {!r} to Login Form payload.".format(name)) @@ -192,6 +191,10 @@ def authenticate_to_adfs_portal(self, response: requests.Response) -> requests.R error_msg = login_error_message if login_error_message else vip_login_error_message click.secho(error_msg.string, fg="red") # type: ignore[union-attr] sys.exit(1) + if not login_response.ok: + click.secho("Login page failed", fg="red") + logger.debug("Login Response: {}".format(login_response.text)) + sys.exit(1) return login_response def fetch_aws_account_names(self, response: requests.Response) -> Optional[requests.Response]: From 7cf386370271b3263da11ce1e44f686164cd14c3 Mon Sep 17 00:00:00 2001 From: Phillip Ferentinos Date: Wed, 15 Oct 2025 10:50:21 -0500 Subject: [PATCH 2/2] style(super-linter): add configuration to ignore natural language in changelog.md --- .textlintignore | 1 + CHANGELOG.md | 4 ++-- super-linter.env | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .textlintignore diff --git a/.textlintignore b/.textlintignore new file mode 100644 index 0000000..83b6947 --- /dev/null +++ b/.textlintignore @@ -0,0 +1 @@ +CHANGELOG.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 93126fc..3cb2537 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,11 @@ ### ⚠ BREAKING CHANGES -* **py37:** +- **py37:** ### Build System -* **py37:** remove support for python3.7 ([a1a0a9e](https://github.com/cshamrick/stsauth/commit/a1a0a9ec0c86be7ceae49f11983c3b0646793451)) +- **py37:** remove support for python3.7 ([a1a0a9e](https://github.com/cshamrick/stsauth/commit/a1a0a9ec0c86be7ceae49f11983c3b0646793451)) ## [1.1.1](https://github.com/cshamrick/stsauth/compare/v1.1.0...v1.1.1) (2024-09-20) diff --git a/super-linter.env b/super-linter.env index d696c54..c104892 100644 --- a/super-linter.env +++ b/super-linter.env @@ -21,6 +21,7 @@ VALIDATE_GITHUB_ACTIONS_ZIZMOR=false FIX_YAML_PRETTIER=true FIX_MARKDOWN_PRETTIER=true FIX_PYTHON_BLACK=true +FIX_NATURAL_LANGUAGE=true # Tool-specific configuration TRIVY_IGNOREFILE=.trivyignore.yaml \ No newline at end of file