oqtopus-auth 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. oqtopus_auth-0.1.0/.editorconfig +22 -0
  2. oqtopus_auth-0.1.0/.github/CODEOWNERS +1 -0
  3. oqtopus_auth-0.1.0/.github/dependabot.yml +33 -0
  4. oqtopus_auth-0.1.0/.github/pull_request_template.md +9 -0
  5. oqtopus_auth-0.1.0/.github/workflows/ci.yaml +96 -0
  6. oqtopus_auth-0.1.0/.github/workflows/labeler.yaml +91 -0
  7. oqtopus_auth-0.1.0/.github/workflows/release.yaml +42 -0
  8. oqtopus_auth-0.1.0/.gitignore +166 -0
  9. oqtopus_auth-0.1.0/.gitmessage +18 -0
  10. oqtopus_auth-0.1.0/.markdownlint.json +6 -0
  11. oqtopus_auth-0.1.0/.python-version +1 -0
  12. oqtopus_auth-0.1.0/.readthedocs.yaml +24 -0
  13. oqtopus_auth-0.1.0/.uv-version +1 -0
  14. oqtopus_auth-0.1.0/.vscode/extensions.json +8 -0
  15. oqtopus_auth-0.1.0/.vscode/settings.json +16 -0
  16. oqtopus_auth-0.1.0/CITATION.cff +13 -0
  17. oqtopus_auth-0.1.0/LICENSE +201 -0
  18. oqtopus_auth-0.1.0/Makefile +42 -0
  19. oqtopus_auth-0.1.0/PKG-INFO +73 -0
  20. oqtopus_auth-0.1.0/README.md +45 -0
  21. oqtopus_auth-0.1.0/docs/CONTRIBUTING.md +29 -0
  22. oqtopus_auth-0.1.0/docs/asset/favicon.png +0 -0
  23. oqtopus_auth-0.1.0/docs/asset/oqtopus-black_symbol.svg +1 -0
  24. oqtopus_auth-0.1.0/docs/asset/oqtopus-logo.png +0 -0
  25. oqtopus_auth-0.1.0/docs/css/custom.css +58 -0
  26. oqtopus_auth-0.1.0/docs/developer_guidelines/development_flow.md +113 -0
  27. oqtopus_auth-0.1.0/docs/developer_guidelines/setup.md +116 -0
  28. oqtopus_auth-0.1.0/docs/index.md +62 -0
  29. oqtopus_auth-0.1.0/docs/usage/authentication.md +453 -0
  30. oqtopus_auth-0.1.0/docs/usage/getting_started.md +67 -0
  31. oqtopus_auth-0.1.0/docs_scripts/gen_ref_nav.py +37 -0
  32. oqtopus_auth-0.1.0/mkdocs.yml +96 -0
  33. oqtopus_auth-0.1.0/pyproject.toml +105 -0
  34. oqtopus_auth-0.1.0/src/oqtopus_auth/__init__.py +36 -0
  35. oqtopus_auth-0.1.0/src/oqtopus_auth/base.py +68 -0
  36. oqtopus_auth-0.1.0/src/oqtopus_auth/config.py +124 -0
  37. oqtopus_auth-0.1.0/src/oqtopus_auth/factory.py +38 -0
  38. oqtopus_auth-0.1.0/src/oqtopus_auth/fastapi/__init__.py +21 -0
  39. oqtopus_auth-0.1.0/src/oqtopus_auth/fastapi/depends.py +186 -0
  40. oqtopus_auth-0.1.0/src/oqtopus_auth/fastapi/middleware.py +47 -0
  41. oqtopus_auth-0.1.0/src/oqtopus_auth/header_provider.py +179 -0
  42. oqtopus_auth-0.1.0/src/oqtopus_auth/null_provider.py +32 -0
  43. oqtopus_auth-0.1.0/src/oqtopus_auth/permissions.py +86 -0
  44. oqtopus_auth-0.1.0/src/oqtopus_auth/py.typed +0 -0
  45. oqtopus_auth-0.1.0/tests/__init__.py +0 -0
  46. oqtopus_auth-0.1.0/tests/oqtopus_auth/__init__.py +0 -0
  47. oqtopus_auth-0.1.0/tests/oqtopus_auth/fastapi/__init__.py +0 -0
  48. oqtopus_auth-0.1.0/tests/oqtopus_auth/fastapi/test_depends.py +178 -0
  49. oqtopus_auth-0.1.0/tests/oqtopus_auth/fastapi/test_middleware.py +87 -0
  50. oqtopus_auth-0.1.0/tests/oqtopus_auth/test_base.py +43 -0
  51. oqtopus_auth-0.1.0/tests/oqtopus_auth/test_config.py +103 -0
  52. oqtopus_auth-0.1.0/tests/oqtopus_auth/test_factory.py +77 -0
  53. oqtopus_auth-0.1.0/tests/oqtopus_auth/test_header_provider.py +194 -0
  54. oqtopus_auth-0.1.0/tests/oqtopus_auth/test_permissions.py +150 -0
  55. oqtopus_auth-0.1.0/uv.lock +1659 -0
@@ -0,0 +1,22 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [*.{js,json}]
12
+ indent_size = 2
13
+
14
+ [*.md]
15
+ max_line_length = 0
16
+ trim_trailing_whitespace = false
17
+
18
+ [{Makefile,**.mk}]
19
+ indent_style = tab
20
+
21
+ [*.py]
22
+ indent_size = 4
@@ -0,0 +1 @@
1
+ * @snuffkin @katsujukou
@@ -0,0 +1,33 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for more information:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+ # https://containers.dev/guide/dependabot
6
+
7
+ version: 2
8
+ updates:
9
+ - package-ecosystem: "github-actions"
10
+ directory: "/"
11
+ schedule:
12
+ interval: monthly
13
+ cooldown:
14
+ default-days: 7
15
+ commit-message:
16
+ prefix: "chore(ci)"
17
+ groups:
18
+ github-actions:
19
+ patterns:
20
+ - "*"
21
+
22
+ - package-ecosystem: "uv"
23
+ directory: "/"
24
+ schedule:
25
+ interval: monthly
26
+ cooldown:
27
+ default-days: 7
28
+ commit-message:
29
+ prefix: "chore(deps)"
30
+ groups:
31
+ python-dependencies:
32
+ patterns:
33
+ - "*"
@@ -0,0 +1,9 @@
1
+ <!-- Keep this template minimal for Copilot/auto-drafting; remove these comments when ready. -->
2
+ ## Ticket
3
+ <!-- Link to the ticket / issue -->
4
+
5
+ ## Summary
6
+ <!-- What and why (1–2 sentences) -->
7
+
8
+ ## Changes
9
+ <!-- Bullet list of key changes -->
@@ -0,0 +1,96 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ # If you are using a develop branch, include it here (e.g., [main, develop]).
6
+ branches: [main]
7
+ pull_request:
8
+ # If you are using a develop branch, include it here as well.
9
+ branches: [main]
10
+
11
+ # Cancel outdated workflows for the same PR or branch
12
+ concurrency:
13
+ group: ci-${{ github.event.pull_request.number || github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ lint:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - name: Checkout
24
+ uses: actions/checkout@v6
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v7
28
+ with:
29
+ enable-cache: true
30
+ cache-dependency-glob: "**/uv.lock"
31
+ cache-python: true
32
+
33
+ - name: Set up Python
34
+ run: uv python install
35
+
36
+ - name: Install dependencies
37
+ run: uv sync --frozen --all-groups
38
+
39
+ - name: Lint and Format check
40
+ run: |
41
+ uv lock --check
42
+ uv run ruff check .
43
+ uv run ruff format --check .
44
+
45
+ - name: Type check
46
+ run: uv run mypy src tests
47
+
48
+ - name: Detect changed docs files
49
+ id: changes
50
+ uses: dorny/paths-filter@v4
51
+ with:
52
+ filters: |
53
+ docs:
54
+ - "docs/**"
55
+
56
+ - name: Documentation Lint
57
+ if: steps.changes.outputs.docs == 'true'
58
+ run: uv run pymarkdown scan -r docs
59
+
60
+ test:
61
+ runs-on: ubuntu-latest
62
+ needs: lint
63
+
64
+ strategy:
65
+ fail-fast: false
66
+ matrix:
67
+ python-version: ["3.12", "3.13", "3.14"]
68
+
69
+ steps:
70
+ - name: Checkout
71
+ uses: actions/checkout@v6
72
+
73
+ - name: Install uv
74
+ uses: astral-sh/setup-uv@v7
75
+ with:
76
+ enable-cache: true
77
+ cache-dependency-glob: "**/uv.lock"
78
+ cache-python: true
79
+
80
+ - name: Set up Python ${{ matrix.python-version }}
81
+ run: uv python install ${{ matrix.python-version }}
82
+
83
+ - name: Install dependencies
84
+ run: uv sync --frozen --all-groups
85
+
86
+ - name: Run tests
87
+ run: uv run pytest --cov=src --cov-report=xml
88
+
89
+ - name: Upload coverage to Codecov
90
+ # Only upload for the primary version to avoid collisions/redundancy
91
+ if: github.actor != 'dependabot[bot]' && matrix.python-version == '3.14'
92
+ uses: codecov/codecov-action@v6
93
+ with:
94
+ token: ${{ secrets.CODECOV_TOKEN }}
95
+ slug: oqtopus-team/oqtopus-auth
96
+ fail_ci_if_error: true
@@ -0,0 +1,91 @@
1
+ name: PR Labeler
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize]
6
+ branches:
7
+ # Specify the default branch of your repository (e.g., main or develop)
8
+ - main
9
+ # - develop
10
+
11
+ #Permissions are required for PRs by dependabot.
12
+ permissions:
13
+ pull-requests: write
14
+ contents: write
15
+
16
+ jobs:
17
+ labeler:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - name: Checkout code
21
+ uses: actions/checkout@v6
22
+ with:
23
+ fetch-depth: 0
24
+
25
+ - name: Fetch all branches
26
+ run: git fetch --all
27
+
28
+ - name: Extract commit messages
29
+ run: |
30
+ COMMITS=$(git log --format=%B origin/${{ github.event.pull_request.base.ref }}..HEAD)
31
+ echo "$COMMITS"
32
+ echo "$COMMITS" > commits.txt
33
+
34
+ - name: Debug - Print commits
35
+ run: cat commits.txt
36
+
37
+ - name: Set labels based on commit messages
38
+ id: set-labels
39
+ run: |
40
+ labels=()
41
+ while IFS= read -r commit; do
42
+ echo "Processing commit: $commit"
43
+ if [[ $commit =~ ^feat ]]; then
44
+ labels+=("feature")
45
+ elif [[ $commit =~ ^fix ]]; then
46
+ labels+=("bugfix")
47
+ elif [[ $commit =~ ^docs ]]; then
48
+ labels+=("documentation")
49
+ elif [[ $commit =~ ^style ]]; then
50
+ labels+=("style")
51
+ elif [[ $commit =~ ^refactor ]]; then
52
+ labels+=("refactor")
53
+ elif [[ $commit =~ ^test ]]; then
54
+ labels+=("test")
55
+ elif [[ $commit =~ ^ci ]]; then
56
+ labels+=("ci")
57
+ elif [[ $commit =~ ^chore ]]; then
58
+ labels+=("chore")
59
+ fi
60
+ done < commits.txt
61
+
62
+ # Remove duplicate labels and join them as a newline-separated string
63
+ unique_labels=$(printf "%s\n" "${labels[@]}" | sort -u)
64
+
65
+ # Debug output for unique labels
66
+ echo "Unique labels:"
67
+ echo "$unique_labels"
68
+
69
+ # Set the output as a newline-separated string
70
+ echo "labels<<EOF" >> $GITHUB_OUTPUT
71
+ echo "$unique_labels" >> $GITHUB_OUTPUT
72
+ echo "EOF" >> $GITHUB_OUTPUT
73
+
74
+ - name: Add labels to PR
75
+ uses: actions-ecosystem/action-add-labels@v1
76
+ with:
77
+ labels: ${{ steps.set-labels.outputs.labels }}
78
+
79
+ - name: Assign PR creator
80
+ if: >-
81
+ github.event.pull_request.head.repo.full_name == github.repository &&
82
+ github.event.pull_request.user.login != 'dependabot[bot]'
83
+ uses: actions/github-script@v9
84
+ with:
85
+ script: |
86
+ await github.rest.issues.addAssignees({
87
+ owner: context.repo.owner,
88
+ repo: context.repo.repo,
89
+ issue_number: context.issue.number,
90
+ assignees: [context.payload.pull_request.user.login]
91
+ })
@@ -0,0 +1,42 @@
1
+ name: Release
2
+ on:
3
+ release:
4
+ types: [published]
5
+
6
+ jobs:
7
+ release:
8
+ runs-on: ubuntu-latest
9
+ environment: pypi
10
+ permissions:
11
+ contents: read
12
+ id-token: write
13
+ steps:
14
+ # ----------------------------
15
+ # Setup
16
+ # ----------------------------
17
+ - name: Checkout code
18
+ uses: actions/checkout@v6
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v7
22
+ with:
23
+ enable-cache: true
24
+ cache-dependency-glob: "**/uv.lock"
25
+ cache-python: true
26
+
27
+ - name: Set up Python
28
+ run: uv python install
29
+
30
+ # ----------------------------
31
+ # Build
32
+ # ----------------------------
33
+ - name: Build
34
+ run: uv build
35
+
36
+ # ----------------------------
37
+ # Publish to PyPI
38
+ # ----------------------------
39
+ - name: Publish to PyPI
40
+ uses: pypa/gh-action-pypi-publish@release/v1
41
+ with:
42
+ packages-dir: dist/
@@ -0,0 +1,166 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # ruff
149
+ .ruff_cache/
150
+
151
+ # Pyre type checker
152
+ .pyre/
153
+
154
+ # pytype static type analyzer
155
+ .pytype/
156
+
157
+ # Cython debug symbols
158
+ cython_debug/
159
+
160
+ # PyCharm
161
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
162
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
163
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
164
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
165
+ #.idea/
166
+
@@ -0,0 +1,18 @@
1
+ # Overview (Uncomment one of the following templates)
2
+ #feat:
3
+ # └ A new feature
4
+ #fix:
5
+ # └ A bug fix
6
+ #docs:
7
+ # └ Documentation only changes
8
+ #style:
9
+ # └ Changes that do not affect the meaning of the code
10
+ # (white-space, formatting, missing semi-colons, etc)
11
+ #refactor:
12
+ # └ A code change that neither fixes a bug nor adds a featur
13
+ #test:
14
+ # └ Adding missing or correcting existing tests
15
+ #ci:
16
+ # └ Changes to our CI configuration files and scripts
17
+ #chore:
18
+ # └ Updating grunt tasks etc; no production code change
@@ -0,0 +1,6 @@
1
+ {
2
+ "MD013": false,
3
+ "MD041": false,
4
+ "MD046": false,
5
+ "MD060": false
6
+ }
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,24 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/build-customization.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Set the OS, Python version and other tools you might need
9
+ build:
10
+ os: ubuntu-24.04
11
+ tools:
12
+ python: "3.13"
13
+ jobs:
14
+ pre_create_environment:
15
+ - asdf plugin add uv
16
+ - asdf install uv latest
17
+ - asdf global uv latest
18
+ create_environment:
19
+ - uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
20
+ install:
21
+ - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
22
+ build:
23
+ html:
24
+ - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv run mkdocs build --site-dir "$READTHEDOCS_OUTPUT/html"
@@ -0,0 +1 @@
1
+ 0.10.9
@@ -0,0 +1,8 @@
1
+ {
2
+ "recommendations": [
3
+ "charliermarsh.ruff",
4
+ "davidanson.vscode-markdownlint",
5
+ "ms-python.mypy-type-checker",
6
+ "ms-python.python"
7
+ ]
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "[python]": {
3
+ "editor.formatOnSave": true,
4
+ "editor.codeActionsOnSave": {
5
+ "source.fixAll.ruff": "explicit",
6
+ "source.organizeImports.ruff": "explicit"
7
+ },
8
+ "editor.defaultFormatter": "charliermarsh.ruff"
9
+ },
10
+ "[markdown]": {
11
+ "editor.formatOnSave": true,
12
+ "editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
13
+ },
14
+ "python.terminal.activateEnvironment": true,
15
+ "python-envs.defaultEnvManager": "ms-python.python:uv"
16
+ }
@@ -0,0 +1,13 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ title: "OQTOPUS Auth"
4
+ authors:
5
+ - name: "OQTOPUS Team"
6
+ version: 0.1.0
7
+ date-released: 2026-08-11
8
+ license: Apache-2.0
9
+ contact:
10
+ - email: oqtopus-team@googlegroups.com
11
+ name: "OQTOPUS mailing list"
12
+ repository-code: "https://github.com/oqtopus-team/oqtopus-auth"
13
+ url: "https://oqtopus-auth.readthedocs.io/"