Skip to content

Commit 9937c34

Browse files
authored
Merge pull request #307 from ral-facilities/release/v3.0.0
Release `v3.0.0`
2 parents 96ef42b + 15faf35 commit 9937c34

33 files changed

+1727
-612
lines changed

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ AUTHENTICATION__PUBLIC_KEY_PATH=./keys/jwt-key.pub
1111
AUTHENTICATION__JWT_ALGORITHM=RS256
1212
AUTHENTICATION__ACCESS_TOKEN_VALIDITY_MINUTES=5
1313
AUTHENTICATION__REFRESH_TOKEN_VALIDITY_DAYS=7
14-
AUTHENTICATION__ACTIVE_USERNAMES_PATH=./active_usernames.txt
14+
AUTHENTICATION__USERS_CONFIG_PATH=./users_config.yaml
1515
MAINTENANCE__MAINTENANCE_PATH=./maintenance/maintenance.json
1616
MAINTENANCE__SCHEDULED_MAINTENANCE_PATH=./maintenance/scheduled_maintenance.json
1717
LDAP_SERVER__URL=ldaps://ldap.example.com:636
1818
LDAP_SERVER__REALM=LDAP.EXAMPLE.COM
1919
LDAP_SERVER__CERTIFICATE_VALIDATION=true
2020
LDAP_SERVER__CA_CERTIFICATE_FILE_PATH=./ldap_server_certs/cacert.pem
21+
OIDC_PROVIDERS__keycloak__DISPLAY_NAME=keycloak
22+
OIDC_PROVIDERS__keycloak__CONFIGURATION_URL=http://localhost:9004/realms/testrealm/.well-known/openid-configuration
23+
OIDC_PROVIDERS__keycloak__CLIENT_ID=test-client-id

.github/workflows/.ci.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout repository
24-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2525

2626
- name: Install python-ldap system dependencies
2727
run: |
2828
sudo apt-get update
2929
sudo apt-get install -y libsasl2-dev python3-dev libldap2-dev libssl-dev
3030
3131
- name: Set up Python
32-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
32+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
3333
with:
34-
python-version: "3.12"
34+
python-version: "3.13"
3535
cache: "pip"
3636

3737
- name: Install dependencies
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
steps:
5353
- name: Checkout repository
54-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
54+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5555

5656
- name: Create logging configuration file
5757
run: cp logging.example.ini logging.ini
@@ -72,27 +72,56 @@ jobs:
7272
with:
7373
token: ${{ secrets.CODECOV_TOKEN }}
7474

75+
e2e-tests:
76+
needs: [unit-tests]
77+
name: End-to-End Tests
78+
runs-on: ubuntu-latest
79+
steps:
80+
- name: Checkout repository
81+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
82+
83+
- name: Create logging configuration file
84+
run: cp logging.example.ini logging.ini
85+
86+
- name: Setup keycloak
87+
run: |
88+
docker compose up --detach keycloak
89+
90+
- name: Run e2e tests
91+
run: |
92+
docker build --file Dockerfile --target test --tag ldap-jwt-auth:test .
93+
docker run \
94+
--name ldap-jwt-auth \
95+
--volume ./logging.ini:/app/logging.ini \
96+
--add-host localhost:host-gateway \
97+
ldap-jwt-auth:test \
98+
pytest --config-file test/pytest.ini test/e2e -v
99+
100+
- name: Output docker logs (keycloak)
101+
if: failure()
102+
run: docker logs keycloak
103+
75104
docker:
76105
# This job triggers only if all the other jobs succeed. It builds the Docker image
77106
# and if run manually from Github Actions, it pushes to Harbor.
78-
needs: [linting, unit-tests]
107+
needs: [linting, unit-tests, e2e-tests]
79108
name: Docker
80109
runs-on: ubuntu-latest
81110
env:
82111
PUSH_DOCKER_IMAGE_TO_HARBOR: ${{ inputs.push-docker-image-to-harbor != null && inputs.push-docker-image-to-harbor || 'false' }}
83112
steps:
84113
- name: Check out repo
85-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
114+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
86115

87116
- name: Extract metadata (tags, labels) for Docker
88117
id: meta
89-
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
118+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
90119
with:
91120
images: ${{ vars.HARBOR_URL }}/auth-api
92121

93122
- name: Login to Harbor
94123
if: ${{ fromJSON(env.PUSH_DOCKER_IMAGE_TO_HARBOR) }}
95-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
124+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
96125
with:
97126
registry: ${{ vars.HARBOR_URL }}
98127
username: ${{ secrets.HARBOR_USERNAME }}

.github/workflows/release-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Check out repo
16-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1717

1818
- name: Login to Harbor
19-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
19+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
2020
with:
2121
registry: ${{ vars.HARBOR_URL }}
2222
username: ${{ secrets.HARBOR_USERNAME }}
2323
password: ${{ secrets.HARBOR_TOKEN }}
2424

2525
- name: Extract metadata (tags, labels) for Docker
2626
id: meta
27-
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
27+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
2828
with:
2929
images: ${{ vars.HARBOR_URL }}/auth-api
3030
tags: |

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
logging.ini
2-
/active_usernames.txt
2+
/users_config.yaml
33
keys/*
44
!keys/.keep
55
ldap_server_certs/*

.pylintrc

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ ignore-paths=
5959
# Emacs file locks
6060
ignore-patterns=^\.#
6161

62-
# List of module names for which member attributes should not be checked
63-
# (useful for modules/projects where namespaces are manipulated during runtime
64-
# and thus existing member attributes cannot be deduced by static analysis). It
65-
# supports qualified module names, as well as Unix pattern matching.
62+
# List of module names for which member attributes should not be checked and
63+
# will not be imported (useful for modules/projects where namespaces are
64+
# manipulated during runtime and thus existing member attributes cannot be
65+
# deduced by static analysis). It supports qualified module names, as well as
66+
# Unix pattern matching.
6667
ignored-modules=
6768

6869
# Python code to execute, usually for sys.path manipulation such as
@@ -86,9 +87,13 @@ load-plugins=
8687
# Pickle collected data for later comparisons.
8788
persistent=yes
8889

90+
# Resolve imports to .pyi stubs if available. May reduce no-member messages and
91+
# increase not-an-iterable messages.
92+
prefer-stubs=no
93+
8994
# Minimum Python version to use for version dependent checks. Will default to
9095
# the version used to run pylint.
91-
py-version=3.12
96+
py-version=3.13
9297

9398
# Discover python modules and packages in the file system subtree.
9499
recursive=no
@@ -99,10 +104,6 @@ recursive=no
99104
# source root.
100105
source-roots=
101106

102-
# When enabled, pylint would attempt to guess common misconfiguration and emit
103-
# user-friendly hints instead of false-positive error messages.
104-
suggestion-mode=yes
105-
106107
# Allow loading of arbitrary C extensions. Extensions are imported into the
107108
# active Python interpreter and may run arbitrary code.
108109
unsafe-load-any-extension=no
@@ -229,6 +230,11 @@ name-group=
229230
# not require a docstring.
230231
no-docstring-rgx=^_
231232

233+
# Regular expression matching correct parameter specification variable names.
234+
# If left empty, parameter specification variable names will be checked with
235+
# the set naming style.
236+
#paramspec-rgx=
237+
232238
# List of decorators that produce properties, such as abc.abstractproperty. Add
233239
# to this list to register other decorators that produce valid properties.
234240
# These decorators are taken in consideration only for invalid-name.
@@ -242,6 +248,10 @@ property-classes=abc.abstractproperty
242248
# variable names will be checked with the set naming style.
243249
#typevar-rgx=
244250

251+
# Regular expression matching correct type variable tuple names. If left empty,
252+
# type variable tuple names will be checked with the set naming style.
253+
#typevartuple-rgx=
254+
245255
# Naming style matching correct variable names.
246256
variable-naming-style=snake_case
247257

@@ -302,6 +312,9 @@ max-locals=15
302312
# Maximum number of parents for a class (see R0901).
303313
max-parents=7
304314

315+
# Maximum number of positional arguments for function / method.
316+
max-positional-arguments=5
317+
305318
# Maximum number of public methods for a class (see R0904).
306319
max-public-methods=20
307320

@@ -336,7 +349,9 @@ indent-after-paren=4
336349
# tab).
337350
indent-string=' '
338351

339-
# Maximum number of characters on a single line.
352+
# Maximum number of characters on a single line. Pylint's default of 100 is
353+
# based on PEP 8's guidance that teams may choose line lengths up to 99
354+
# characters.
340355
max-line-length=120
341356

342357
# Maximum number of lines in a module.
@@ -448,6 +463,9 @@ timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.
448463

449464
[MISCELLANEOUS]
450465

466+
# Whether or not to search for fixme's in docstrings.
467+
check-fixme-in-docstring=no
468+
451469
# List of note tags to take in consideration, separated by a comma.
452470
notes=FIXME,
453471
XXX,
@@ -468,6 +486,11 @@ max-nested-blocks=5
468486
# printed.
469487
never-returning-functions=sys.exit,argparse.parse_error
470488

489+
# Let 'consider-using-join' be raised when the separator to join on would be
490+
# non-empty (resulting in expected fixes of the type: ``"- " + " -
491+
# ".join(items)``)
492+
suggest-join-with-non-empty-separator=yes
493+
471494

472495
[REPORTS]
473496

@@ -482,10 +505,10 @@ evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor
482505
# used to format the message information. See doc for all details.
483506
msg-template=
484507

485-
# Set the output format. Available formats are: text, parseable, colorized,
486-
# json2 (improved json format), json (old json format) and msvs (visual
487-
# studio). You can also give a reporter class, e.g.
488-
# mypackage.mymodule.MyReporterClass.
508+
# Set the output format. Available formats are: 'text', 'parseable',
509+
# 'colorized', 'json2' (improved json format), 'json' (old json format), msvs
510+
# (visual studio) and 'github' (GitHub actions). You can also give a reporter
511+
# class, e.g. mypackage.mymodule.MyReporterClass.
489512
#output-format=
490513

491514
# Tells whether to display a full report or only the messages.
@@ -587,7 +610,7 @@ ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
587610
# of finding the hint is based on edit distance.
588611
missing-member-hint=yes
589612

590-
# The minimum edit distance a name should have in order to be considered a
613+
# The maximum edit distance a name should have in order to be considered a
591614
# similar match for a missing member name.
592615
missing-member-hint-distance=1
593616

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12.11-alpine3.22@sha256:9b8808206f4a956130546a32cbdd8633bc973b19db2923b7298e6f90cc26db08 AS base
1+
FROM python:3.13.10-alpine3.23@sha256:65fe04ddc51a8ccbf14ecb882903251e4a124914673001b03c393eb65dd9502a AS base
22

33
# Install python-ldap system dependencies
44
RUN apk add --no-cache build-base openldap-dev

0 commit comments

Comments
 (0)