Skip to content

Commit bb5355c

Browse files
feat: add SCA workflow and remove legacy snyk workflow (#48)
* feat: add SCA workflow and remove legacy snyk workflow * Update dependencies * refactor: reorder imports for consistency in middleware and test files * feat: update SCA workflow with Python version and pre-scan commands * fix: revert Python version to 3.10 and update requirements installation path * fix: update requirements installation path to use raw GitHub URL and clean up requirements file * feat: enhance pre-scan commands with directory information logging * fix: update requirements installation path to use local requirements file * debug: enhance pre-scan commands with additional output for requirements and installed packages * debug: activate the env * fix: update pre-scan commands to include skip-unresolved argument and clean up installation steps * fix the path
1 parent f2ec971 commit bb5355c

8 files changed

Lines changed: 591 additions & 354 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ jobs:
3939
uses: actions/checkout@v5
4040

4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v3
42+
uses: github/codeql-action/init@v4
4343
with:
4444
languages: ${{ matrix.language }}
4545
queries: +security-and-quality
4646

4747
- name: Autobuild
48-
uses: github/codeql-action/autobuild@v3
48+
uses: github/codeql-action/autobuild@v4
4949

5050
- name: Perform CodeQL Analysis
51-
uses: github/codeql-action/analyze@v3
51+
uses: github/codeql-action/analyze@v4
5252
with:
5353
category: "/language:${{ matrix.language }}"

.github/workflows/sca_scan.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: SCA
2+
3+
on:
4+
push:
5+
branches: ["master", "main", "**"]
6+
7+
jobs:
8+
snyk-cli:
9+
uses: auth0/devsecops-tooling/.github/workflows/sca-scan.yml@main
10+
with:
11+
additional-arguments: "--exclude=README.md,.jfrog --skip-unresolved"
12+
python-version: "3.10"
13+
pre-scan-commands: |
14+
python3 -m venv venv --upgrade-deps
15+
./venv/bin/pip3 install -r requirements.txt
16+
secrets: inherit

.github/workflows/snyk.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

examples/example-fastmcp-mcp/src/auth0/middleware.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
from collections.abc import Callable
33
from typing import Any
44

5-
from auth0_api_python import ApiClient, ApiClientOptions
6-
from auth0_api_python.errors import VerifyAccessTokenError
75
from starlette.middleware.base import BaseHTTPMiddleware
86
from starlette.requests import Request
97
from starlette.responses import Response
108
from starlette.types import ASGIApp
119

10+
from auth0_api_python import ApiClient, ApiClientOptions
11+
from auth0_api_python.errors import VerifyAccessTokenError
12+
1213
from .errors import AuthenticationRequired, MalformedAuthorizationRequest
1314

1415
logger = logging.getLogger(__name__)

poetry.lock

Lines changed: 559 additions & 297 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ python = "^3.9"
1515
authlib = "^1.0" # For JWT/OIDC features
1616
requests = "^2.31.0" # If you use requests for HTTP calls (e.g., discovery)
1717
httpx = "^0.28.1"
18-
ada-url = "^1.25.0"
18+
ada-url = "^1.27.0"
1919

2020
[tool.poetry.group.dev.dependencies]
2121
pytest = "^8.0"
2222
pytest-cov = "^4.0"
23-
pytest-asyncio = "^0.20.3"
24-
pytest-mock = "^3.14.0"
23+
pytest-asyncio = "^0.25.3"
24+
pytest-mock = "^3.15.1"
2525
pytest-httpx = "^0.35.0"
26-
ruff = "^0.1.0"
26+
ruff = ">=0.1,<0.15"
2727

2828
[tool.pytest.ini_options]
2929
addopts = "--cov=src --cov-report=term-missing:skip-covered --cov-report=xml"

requirements.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
# Core runtime dependencies
2-
authlib>=1.6.3
1+
authlib>=1.6.5
32
httpx>=0.28.1
4-
ada-url>=1.26.0
5-
6-
# Development and testing dependencies
3+
ada-url>=1.27.0
74
pytest>=8.0
85
pytest-cov>=4.0
9-
pytest-asyncio>=0.20.3
10-
pytest-mock>=3.14.1
6+
pytest-asyncio>=0.25.3
7+
pytest-mock>=3.15.1
118
pytest-httpx>=0.35.0
129

tests/test_api_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import httpx
77
import pytest
8+
from pytest_httpx import HTTPXMock
9+
810
from auth0_api_python.api_client import ApiClient
911
from auth0_api_python.config import ApiClientOptions
1012
from auth0_api_python.errors import (
@@ -24,7 +26,6 @@
2426
generate_token_with_cnf,
2527
sha256_base64url,
2628
)
27-
from pytest_httpx import HTTPXMock
2829

2930
# Create public RSA JWK by selecting only public key components
3031
PUBLIC_RSA_JWK = {k: PRIVATE_JWK[k] for k in ["kty", "n", "e", "alg", "use", "kid"] if k in PRIVATE_JWK}

0 commit comments

Comments
 (0)