From 29f8ed94c30643bd17b0cbb019366d0118d36a0a Mon Sep 17 00:00:00 2001 From: VKTB <45173816+VKTB@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:26:22 +0000 Subject: [PATCH 1/6] Update CI jobs to use Python 3.12 #39 --- .github/workflows/.ci.yml | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/.ci.yml b/.github/workflows/.ci.yml index 4cc8323..705b7d7 100644 --- a/.github/workflows/.ci.yml +++ b/.github/workflows/.ci.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: "3.10" + python-version: "3.12" cache: "pip" - name: Install dependencies @@ -50,7 +50,7 @@ jobs: - name: Set up Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: - python-version: "3.10" + python-version: "3.12" cache: "pip" - name: Install dependencies @@ -67,31 +67,31 @@ jobs: docker: # This job triggers only if all the other jobs succeed. It builds the Docker image and if successful, # it pushes it to Harbor. - needs: [linting, unit-tests] + needs: [ linting, unit-tests ] name: Docker runs-on: ubuntu-latest steps: - - name: Check out repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Check out repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Login to Harbor - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 - with: - registry: harbor.stfc.ac.uk/ldap-jwt-authentication - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_TOKEN }} + - name: Login to Harbor + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: harbor.stfc.ac.uk/ldap-jwt-authentication + username: ${{ secrets.HARBOR_USERNAME }} + password: ${{ secrets.HARBOR_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 - with: - images: harbor.stfc.ac.uk/ldap-jwt-authentication/auth-api + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + images: harbor.stfc.ac.uk/ldap-jwt-authentication/auth-api - - name: Build and push Docker image to Harbor - uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 - with: - context: . - file: ./Dockerfile.prod - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + - name: Build and push Docker image to Harbor + uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0 + with: + context: . + file: ./Dockerfile.prod + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 5bea4ed381125c662d47e85b1d677be660b9ea61 Mon Sep 17 00:00:00 2001 From: VKTB <45173816+VKTB@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:26:33 +0000 Subject: [PATCH 2/6] Update Docker images to use Python 3.12 #39 --- Dockerfile | 2 +- Dockerfile.prod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e0bff8..b238508 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10-alpine3.19 +FROM python:3.12-alpine3.19 WORKDIR /ldap-jwt-auth-run diff --git a/Dockerfile.prod b/Dockerfile.prod index cc15637..167c2f7 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -1,4 +1,4 @@ -FROM python:3.10-alpine3.19 +FROM python:3.12-alpine3.19 WORKDIR /ldap-jwt-auth-run From fc374554b0a5f282d23340f1915dcee975910bed Mon Sep 17 00:00:00 2001 From: VKTB <45173816+VKTB@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:26:51 +0000 Subject: [PATCH 3/6] Regnerate .pylintrc file #39 --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 5d667c1..2099ac5 100644 --- a/.pylintrc +++ b/.pylintrc @@ -88,7 +88,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.10 +py-version=3.12 # Discover python modules and packages in the file system subtree. recursive=no From da2fdf0450bc610de55f1d7d9898246b084a4e3c Mon Sep 17 00:00:00 2001 From: VKTB <45173816+VKTB@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:27:03 +0000 Subject: [PATCH 4/6] Update README #39 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c7f77f..9775979 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ This microservice requires an LDAP server to run against. ### Prerequisites - Docker and Docker Compose installed (if you want to run the microservice inside Docker) +- Python 3.12 installed on your machine (if you are not using Docker) - LDAP server to connect to -- Python 3.10 (or above) (if you are not using Docker) - Private and public key pair (must be OpenSSH encoded) for encrypting and decrypting the JWTs - A list of active usernames, defining who can use this service - This repository cloned From 0b5887c4f930794da3a32328d55f4f12d47bc640 Mon Sep 17 00:00:00 2001 From: VKTB <45173816+VKTB@users.noreply.github.com> Date: Mon, 26 Feb 2024 09:09:40 +0000 Subject: [PATCH 5/6] Fix formatting of CI workflow file #39 --- .github/workflows/.ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/.ci.yml b/.github/workflows/.ci.yml index 705b7d7..9310257 100644 --- a/.github/workflows/.ci.yml +++ b/.github/workflows/.ci.yml @@ -67,7 +67,7 @@ jobs: docker: # This job triggers only if all the other jobs succeed. It builds the Docker image and if successful, # it pushes it to Harbor. - needs: [ linting, unit-tests ] + needs: [linting, unit-tests] name: Docker runs-on: ubuntu-latest steps: From 18a5dcf8ac9e82b0392f60f1df92c1a688e9b948 Mon Sep 17 00:00:00 2001 From: VKTB <45173816+VKTB@users.noreply.github.com> Date: Mon, 26 Feb 2024 09:11:00 +0000 Subject: [PATCH 6/6] Update pyproject.toml to require Python 3.12 #39 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b7bdbaf..8106238 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "ldap-jwt-auth" description = "Python microservice providing user authentication against LDAP server and returning a JSON Web Token" readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.12" version = "0.0.1" dependencies = [