Skip to content

Commit 4f47670

Browse files
authored
V0.9.0 (#122)
- Fixes #64: Duo Web Failing - Fixes #121: Use a consistent user agent - Moves to using Black for formatting - Adds pre-commit hooks - Adds isort hook - Adds testing for Python 3.10 - Corrects the supported versions list in setup.py - Removes remaining Python. 2.x cruft - Move to f-strings everywhere - Start preparing for typing - Improve/update CI
1 parent 3aea660 commit 4f47670

29 files changed

+3418
-2658
lines changed

.circleci/config.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,26 @@ dependencies: &dependencies
88
pip install -r test_requirements.txt
99
1010
tests: &tests
11-
name: run tests
11+
name: Unit tests
1212
command: |
1313
. venv/bin/activate
1414
pytest --cov=aws_okta_keyman -v
1515
codecov
1616
17-
pycodestyle: &pycodestyle
18-
name: pycodestyle
17+
pycodestyle: &codechecks
18+
name: Style and formatting checks
1919
command: |
2020
. venv/bin/activate
21-
python setup.py pycodestyle
22-
23-
pyflakes: &pyflakes
24-
name: pyflakes
25-
command: |
26-
. venv/bin/activate
27-
python setup.py pyflakes
21+
pyflakes aws_okta_keyman
22+
black --check ./
23+
isort --check-only ./
2824
2925
version: 2
3026
workflows:
3127
version: 2
3228
test:
3329
jobs:
30+
- test-3.10
3431
- test-3.9
3532
- test-3.8
3633
- test-3.7
@@ -42,8 +39,7 @@ jobs:
4239
- checkout
4340
- run: *dependencies
4441
- run: *tests
45-
- run: *pycodestyle
46-
- run: *pyflakes
42+
- run: *codechecks
4743
docker:
4844
- image: cimg/python:3.6
4945

@@ -61,3 +57,8 @@ jobs:
6157
<<: *3x-template
6258
docker:
6359
- image: cimg/python:3.9
60+
61+
test-3.10:
62+
<<: *3x-template
63+
docker:
64+
- image: cimg/python:3.10

.pre-commit-config.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
default_language_version:
2+
python: python3.8
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.0.1
6+
hooks:
7+
- id: check-docstring-first
8+
- id: check-executables-have-shebangs
9+
- id: check-json
10+
- id: check-merge-conflict
11+
- id: check-yaml
12+
- id: debug-statements
13+
- id: end-of-file-fixer
14+
- id: trailing-whitespace
15+
- repo: https://gitlab.com/pycqa/flake8
16+
rev: 3.9.2
17+
hooks:
18+
- id: flake8
19+
additional_dependencies:
20+
- flake8-bugbear==20.1.4
21+
- flake8-builtins==1.5.3
22+
- flake8-comprehensions==3.2.3
23+
- flake8-tidy-imports==4.1.0
24+
- flake8-black==0.3.2
25+
- repo: https://github.com/pre-commit/mirrors-autopep8
26+
rev: v1.5.7
27+
hooks:
28+
- id: autopep8
29+
- repo: https://github.com/asottile/add-trailing-comma
30+
rev: v2.2.1
31+
hooks:
32+
- id: add-trailing-comma
33+
args: [--py36-plus]
34+
- repo: https://github.com/asottile/pyupgrade
35+
rev: v2.29.1
36+
hooks:
37+
- id: pyupgrade
38+
args: [--py38-plus]
39+
- repo: https://github.com/pycqa/isort
40+
rev: 5.10.1
41+
hooks:
42+
- id: isort
43+
- repo: https://github.com/pre-commit/mirrors-mypy
44+
rev: v0.910-1
45+
hooks:
46+
- id: mypy
47+
additional_dependencies:
48+
- --no-compile
49+
- types-pyyaml==5.4.12
50+
- types-requests==2.27.7
51+
- types-botocore==1.0.1
52+
- types-boto3==1.0.1
53+
- repo: https://github.com/pre-commit/pygrep-hooks
54+
rev: v1.9.0
55+
hooks:
56+
- id: python-use-type-annotations

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ is a bug fix please include a regression test as well.
2323

2424
### Running Tests
2525

26-
The command below will run all of the unit tests for the package with lots of details
26+
The command below will run all of the unit tests for the package with lots of details
2727
and will spit out the current code coverage numbers. Code coverage for this project is
2828
high and the intent is that it stays that way.
2929

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ $ aws_okta_keyman --screen
142142
----snip----
143143
144144
14:14:04 (INFO) Assuming role: arn:aws:iam::1234567890:role/Admin
145-
14:14:04 (INFO) AWS Credentials:
145+
14:14:04 (INFO) AWS Credentials:
146146
147147
AWS_ACCESS_KEY_ID = AXXXXXXXXXXXXXXXXXXX
148148
AWS_SECRET_ACCESS_KEY = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -162,7 +162,7 @@ key durations from a minimum of 15 minutes (900 seconds) or up to 12 hours (4320
162162
limits are enforced by AWS and are not a limitation of Keyman.
163163

164164
### AWS Console Logins
165-
AWS Console login links can optionally be generated when yo request keys with Keyman.
165+
AWS Console login links can optionally be generated when yo request keys with Keyman.
166166
The console login link will be output on the screen for you to use. Just provide the `--console`
167167
parameter when running Keyman.
168168

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
AWS Okta Keyman handles authentication and given that there's certainly concerns about security. Given how this project
66
has been written and that it runs locally and is user-driven it's highly unlikely that there is going to be a security
7-
vulnerability in the project that requires private disclosure. In such a case, however, please
8-
[contact](https://www.nathanv.com/contact) me directly.
7+
vulnerability in the project that requires private disclosure. In such a case, however, please
8+
[contact](https://www.nathanv.com/contact) me directly.

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
theme: jekyll-theme-hacker
1+
theme: jekyll-theme-hacker

aws_okta_keyman/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
# limitations under the License.
1212
#
1313
# Copyright 2018 Nextdoor.com, Inc
14-
# Copyright 2018 Nathan V
14+
# Copyright 2022 Nathan V
1515
"""Empty init."""

aws_okta_keyman/__main__.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
32
# Licensed under the Apache License, Version 2.0 (the "License");
43
# you may not use this file except in compliance with the License.
54
# You may obtain a copy of the License at
@@ -13,11 +12,8 @@
1312
# limitations under the License.
1413
#
1514
# Copyright 2018 Nextdoor.com, Inc
16-
# Copyright 2018 Nathan V
15+
# Copyright 2022 Nathan V
1716
"""Main function that passes off to the Keyman module."""
18-
19-
from __future__ import unicode_literals
20-
2117
import logging
2218
import sys
2319

@@ -31,15 +27,13 @@ def entry_point():
3127
logger = logging.getLogger()
3228
logger.setLevel(logging.INFO)
3329
handler = colorlog.StreamHandler()
34-
fmt = (
35-
'%(asctime)-8s (%(bold)s%(log_color)s%(levelname)s%(reset)s) '
36-
'%(message)s')
37-
formatter = colorlog.ColoredFormatter(fmt, datefmt='%H:%M:%S')
30+
fmt = "%(asctime)-8s (%(bold)s%(log_color)s%(levelname)s%(reset)s) " "%(message)s"
31+
formatter = colorlog.ColoredFormatter(fmt, datefmt="%H:%M:%S")
3832
handler.setFormatter(formatter)
3933
logger.addHandler(handler)
4034
keyman = Keyman(sys.argv)
4135
raise SystemExit(keyman.main())
4236

4337

44-
if __name__ == '__main__':
38+
if __name__ == "__main__":
4539
entry_point()

0 commit comments

Comments
 (0)