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/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]: 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