Skip to content
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
11 changes: 9 additions & 2 deletions .github/super-linter.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@ VALIDATE_MARKDOWN=false
VALIDATE_HTML_PRETTIER=false
VALIDATE_PYTHON_PYLINT=false
VALIDATE_PYTHON_RUFF=false
VALIDATE_PYTHON_PYINK=false
VALIDATE_PYTHON_ISORT=false
VALIDATE_PYTHON_ISORT=false
VALIDATE_PYTHON_RUFF_FORMAT=false
VALIDATE_GIT_COMMITLINT=false
VALIDATE_BIOME_FORMAT=false
VALIDATE_BIOME_LINT=false
VALIDATE_GITHUB_ACTIONS_ZIZMOR=false

# Tool-specific configuration
TRIVY_IGNOREFILE=.trivyignore.yaml
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
statuses: write
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
# Ref: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable
run: grep -v '^#' .github/super-linter.env >> "$GITHUB_ENV"
- name: super-linter
uses: super-linter/super-linter/slim@v7.1.0
uses: super-linter/super-linter/slim@v8.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dist]
pip install --group dist
- name: Build
run: |
python -m build
Expand Down
7 changes: 7 additions & 0 deletions .trivyignore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
misconfigurations:
- id: AVD-DS-0002
paths:
- "Dockerfile"
- id: AVD-DS-0026
paths:
- "Dockerfile"
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## [1.1.1](https://github.com/cshamrick/stsauth/compare/v1.1.0...v1.1.1) (2024-09-20)

### Bug Fixes
### Bugfixes

* handle connection errors more gracefully ([0497547](https://github.com/cshamrick/stsauth/commit/049754726aeeccba43c5a0343c4a25a87758c587))
- handle connection errors more gracefully ([0497547](https://github.com/cshamrick/stsauth/commit/049754726aeeccba43c5a0343c4a25a87758c587))

## [1.1.0](https://github.com/cshamrick/stsauth/compare/v1.0.3...v1.1.0) (2023-10-03)

Expand All @@ -20,7 +20,7 @@

### Bugfixes

- **Dockerfile:** fix docker build ([d492181](https://github.com/cshamrick/stsauth/commit/d492181cf0e15cd50c303faf13d216322de2f4c4))
- **Dockerfile:** fix Docker build ([d492181](https://github.com/cshamrick/stsauth/commit/d492181cf0e15cd50c303faf13d216322de2f4c4))

### [1.0.1](https://github.com/cshamrick/stsauth/compare/v1.0.0...v1.0.1) (2021-07-29)

Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim as build
FROM python:3.9-slim AS build
# checkov:skip=CKV_DOCKER_3
# checkov:skip=CKV_DOCKER_2
WORKDIR /usr/src/stsauth
Expand All @@ -8,10 +8,11 @@ RUN apt-get update -y \
&& apt-get install --no-install-recommends -y git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir .[dist] \
&& pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir --group dist \
&& python -m build

FROM python:3.8-slim as runtime
FROM python:3.9-slim AS runtime
COPY --from=build /usr/src/stsauth/dist/*.whl /dist/
RUN pip install --no-cache-dir dist/stsauth*.whl

Expand Down
85 changes: 72 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,85 @@
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
build-backend = "setuptools.build_meta"

[project]
name = "stsauth"
dynamic = ["version"]
authors = [{ name = "Scott Hamrick", email = "scott@scotthamrick.com" }]
description = "CLI tool for fetching AWS tokens."
readme = { file = "README.md", content-type = "text/markdown" }
license = { file = "LICENSE" }
# # This below format is for py3.9 and above
# license = "MIT"
# license-files = ["LICENSE"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Operating System :: OS Independent",
"Topic :: Utilities",
]
requires-python = ">=3.8"
dependencies = [
"boto3 <2",
"beautifulsoup4 <5",
"Click >=8,<9",
"click-log <0.4",
"requests <3",
"requests_ntlm <2",
"lxml <5",
"pyotp <3",
"urllib3<1.30",
"importlib_metadata;python_version<'3.8'",
"backoff<2.3",
]

[dependency-groups]
dist = ["build", "twine"]
dev = ["ipython", "ipdb", "pylint"]
tests = ["tox", "mock", "nose", "flake8", "pytest", "coverage", "pytest-cov"]

[project.scripts]
stsauth = "sts_auth.cli:cli"

[project.urls]
Homepage = "https://github.com/cshamrick/stsauth"
Repository = "https://github.com/cshamrick/stsauth"
Issues = "https://github.com/cshamrick/stsauth/issues"
Changelog = "https://github.com/cshamrick/stsauth/blob/main/CHANGELOG.md"

[tool.black]
line-length = 120

[tool.mypy]
show_error_codes = true

[tool.setuptools.packages]
find = {}

[tool.setuptools_scm]
write_to = "sts_auth/_version.py"

[tool.tox]
legacy_tox_ini = """
[tox]
skipsdist=True
minversion=2.3.1
envlist = py37,py38,py39

[testenv]
deps =
.[tests]
commands =
coverage run -m pytest {posargs}
coverage xml
"""
requires = ["tox>=4"]
env_list = ["py38", "py39"]
skipsdist = true

[tool.tox.env_run_base]
description = "Run test under {base_python}"
deps = ["."]
dependency_groups = ["tests"]
commands = [
[
"coverage",
"run",
"-m",
"pytest",
"{posargs}",
],
[
"coverage",
"xml",
],
]
54 changes: 0 additions & 54 deletions setup.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion sts_auth/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def prompt_for_role(account_map: Mapping[str, str], account_roles: collections.O
if not role_selection_is_valid(selected_role_index, flat_roles):
return prompt_for_role(account_map, account_roles)

role = next((v for v in flat_roles if int(v["num"]) == selected_role_index), None)
role = next((v for v in flat_roles if int(v["num"]) == selected_role_index), {})
utils.logger.debug("Selected Role: ")
utils.logger.debug(role)

Expand Down
11 changes: 9 additions & 2 deletions super-linter.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ VALIDATE_MARKDOWN=false
VALIDATE_HTML_PRETTIER=false
VALIDATE_PYTHON_PYLINT=false
VALIDATE_PYTHON_RUFF=false
VALIDATE_PYTHON_PYINK=false
VALIDATE_PYTHON_ISORT=false
VALIDATE_PYTHON_RUFF_FORMAT=false
VALIDATE_GIT_COMMITLINT=false
VALIDATE_BIOME_FORMAT=false
VALIDATE_BIOME_LINT=false
VALIDATE_GITHUB_ACTIONS_ZIZMOR=false

FIX_YAML_PRETTIER=true
FIX_MARKDOWN_PRETTIER=true
FIX_PYTHON_BLACK=true
FIX_PYTHON_BLACK=true

# Tool-specific configuration
TRIVY_IGNOREFILE=.trivyignore.yaml