imbi-plugin-oidc 1.0.1__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.
@@ -0,0 +1,45 @@
1
+ name: Publish to PyPI
2
+ on:
3
+ release:
4
+ types: [published]
5
+
6
+ permissions:
7
+ id-token: write
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout repository
14
+ uses: actions/checkout@v6
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v5
20
+
21
+ - name: Set up Python
22
+ run: uv python install 3.14
23
+
24
+ - name: Build
25
+ run: uv build
26
+
27
+ - name: Upload dist
28
+ uses: actions/upload-artifact@v4
29
+ with:
30
+ name: dist
31
+ path: dist/
32
+
33
+ publish:
34
+ needs: build
35
+ runs-on: ubuntu-latest
36
+ environment: pypi
37
+ steps:
38
+ - name: Download dist
39
+ uses: actions/download-artifact@v4
40
+ with:
41
+ name: dist
42
+ path: dist/
43
+
44
+ - name: Publish package
45
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,54 @@
1
+ name: Testing
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches: [ "main" ]
6
+ paths-ignore:
7
+ - 'docs/**'
8
+ - '*.md'
9
+ tags-ignore: [ "*" ]
10
+
11
+ jobs:
12
+ lint:
13
+ name: "Static Analysis"
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v5
18
+ - name: Install just
19
+ uses: extractions/setup-just@v2
20
+ with:
21
+ just-version: '1.47.1'
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v7
24
+ with:
25
+ enable-cache: true
26
+ - name: Run linters
27
+ run: just lint
28
+
29
+ test:
30
+ name: "Automated Tests"
31
+ runs-on: ubuntu-latest
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ python: [ "3.14" ]
36
+ steps:
37
+ - name: Checkout repository
38
+ uses: actions/checkout@v5
39
+ - name: Install just
40
+ uses: extractions/setup-just@v2
41
+ with:
42
+ just-version: '1.47.1'
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v7
45
+ with:
46
+ python-version: "${{ matrix.python }}"
47
+ enable-cache: true
48
+ - name: Test with python ${{ matrix.python }}
49
+ run: just test
50
+ - name: Upload Coverage
51
+ uses: codecov/codecov-action@v5
52
+ with:
53
+ files: ./build/coverage.xml
54
+ flags: unittests
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .pytest_cache/
5
+ .coverage
6
+ htmlcov/
7
+ dist/
8
+ build/
9
+ *.egg-info/
10
+ .ruff_cache/
@@ -0,0 +1,36 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+ - id: check-merge-conflict
10
+ - id: check-toml
11
+ - id: debug-statements
12
+
13
+ - repo: https://github.com/astral-sh/ruff-pre-commit
14
+ rev: v0.14.6
15
+ hooks:
16
+ - id: ruff-check
17
+ args: [--fix]
18
+ - id: ruff-format
19
+
20
+ - repo: https://github.com/tombi-toml/tombi-pre-commit
21
+ rev: v0.7.25
22
+ hooks:
23
+ - id: tombi-format
24
+
25
+ - repo: local
26
+ hooks:
27
+ - id: basedpyright
28
+ name: basedpyright
29
+ language: system
30
+ types: [python]
31
+ pass_filenames: false
32
+ entry: uv
33
+ args:
34
+ - run
35
+ - basedpyright
36
+ - src
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, AWeber Communications, Inc.
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: imbi-plugin-oidc
3
+ Version: 1.0.1
4
+ Summary: Generic OIDC identity plugin for Imbi
5
+ Author-email: "Gavin M. Roy" <gavinr@aweber.com>
6
+ License: BSD-3-Clause
7
+ License-File: LICENSE
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Natural Language :: English
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Requires-Python: >=3.14
15
+ Requires-Dist: httpx>=0.27
16
+ Requires-Dist: imbi-common>=0.1.0a1
17
+ Requires-Dist: pydantic>=2
18
+ Description-Content-Type: text/markdown
19
+
20
+ # imbi-plugin-oidc
21
+
22
+ Generic OIDC identity plugin for Imbi. Implements the OIDC authorization
23
+ code + PKCE flow against any provider that publishes a
24
+ `.well-known/openid-configuration` discovery document.
25
+
26
+ ## Manifest options
27
+
28
+ | Option | Required | Description |
29
+ | ------------------------ | -------- | ---------------------------------------------------------------------- |
30
+ | `issuer_url` | yes | OIDC issuer URL (no trailing slash). |
31
+ | `authorization_endpoint` | no | Override the discovered authorization endpoint. |
32
+ | `token_endpoint` | no | Override the discovered token endpoint. |
33
+ | `userinfo_endpoint` | no | Override the discovered userinfo endpoint. |
34
+ | `jwks_uri` | no | Override the discovered JWKS URI. |
35
+ | `revocation_endpoint` | no | Override the discovered revocation endpoint (optional in OIDC). |
36
+ | `audience` | no | Audience parameter sent on `/authorize`. |
37
+ | `pkce_required` | no | Force PKCE for public clients (default: `true`). |
38
+ | `default_scopes` | no | Comma-separated default scopes (default: `openid profile email`). |
39
+
40
+ ## Credentials
41
+
42
+ | Field | Required |
43
+ | ---------------- | ------------------------------ |
44
+ | `client_id` | yes |
45
+ | `client_secret` | only when `pkce_required=false` |
46
+
47
+ ## License
48
+
49
+ BSD-3-Clause.
@@ -0,0 +1,30 @@
1
+ # imbi-plugin-oidc
2
+
3
+ Generic OIDC identity plugin for Imbi. Implements the OIDC authorization
4
+ code + PKCE flow against any provider that publishes a
5
+ `.well-known/openid-configuration` discovery document.
6
+
7
+ ## Manifest options
8
+
9
+ | Option | Required | Description |
10
+ | ------------------------ | -------- | ---------------------------------------------------------------------- |
11
+ | `issuer_url` | yes | OIDC issuer URL (no trailing slash). |
12
+ | `authorization_endpoint` | no | Override the discovered authorization endpoint. |
13
+ | `token_endpoint` | no | Override the discovered token endpoint. |
14
+ | `userinfo_endpoint` | no | Override the discovered userinfo endpoint. |
15
+ | `jwks_uri` | no | Override the discovered JWKS URI. |
16
+ | `revocation_endpoint` | no | Override the discovered revocation endpoint (optional in OIDC). |
17
+ | `audience` | no | Audience parameter sent on `/authorize`. |
18
+ | `pkce_required` | no | Force PKCE for public clients (default: `true`). |
19
+ | `default_scopes` | no | Comma-separated default scopes (default: `openid profile email`). |
20
+
21
+ ## Credentials
22
+
23
+ | Field | Required |
24
+ | ---------------- | ------------------------------ |
25
+ | `client_id` | yes |
26
+ | `client_secret` | only when `pkce_required=false` |
27
+
28
+ ## License
29
+
30
+ BSD-3-Clause.
@@ -0,0 +1,59 @@
1
+ [default]
2
+ [private]
3
+ @help:
4
+ just --list
5
+
6
+ [private]
7
+ ci: lint test
8
+
9
+ [doc("Set up your development environment")]
10
+ [group("Environment")]
11
+ setup:
12
+ uv sync --all-groups --all-extras --frozen
13
+ uv run pre-commit install --install-hooks --overwrite
14
+
15
+ [doc("Run tests")]
16
+ [group("Testing")]
17
+ test *FILES: setup
18
+ #!/usr/bin/env sh
19
+ set -e
20
+ env_args=""
21
+ if [ -f .env ]; then
22
+ env_args="--env-file .env"
23
+ fi
24
+ if [ -z "{{ FILES }}" ]; then
25
+ uv run $env_args coverage run -m pytest tests
26
+ uv run coverage report
27
+ uv run coverage xml -o build/coverage.xml
28
+ else
29
+ uv run $env_args pytest {{ FILES }}
30
+ fi
31
+
32
+ [doc("Run linters")]
33
+ [group("Testing")]
34
+ lint: setup
35
+ uv run pre-commit run --all-files
36
+
37
+ [doc("Reformat code (optionally pass specific files)")]
38
+ [group("Development")]
39
+ format *FILES: setup
40
+ #!/usr/bin/env sh
41
+ if [ "{{ FILES }}" = '' ]; then
42
+ args='--all-files'
43
+ else
44
+ args='--files {{ FILES }}'
45
+ fi
46
+ uv run pre-commit run ruff-format $args
47
+ uv run pre-commit run tombi-format $args
48
+
49
+ [doc("Remove runtime development artifacts")]
50
+ [group("Environment")]
51
+ clean:
52
+ rm -f .coverage .env
53
+ rm -fR build
54
+
55
+ [confirm]
56
+ [doc("Remove caches, virtual env, and output files")]
57
+ [group("Environment")]
58
+ real-clean: clean
59
+ rm -fR .venv .*_cache dist
@@ -0,0 +1,119 @@
1
+ [project]
2
+ name = "imbi-plugin-oidc"
3
+ version = "1.0.1"
4
+ description = "Generic OIDC identity plugin for Imbi"
5
+ readme = "README.md"
6
+ requires-python = ">=3.14"
7
+ license = { text = "BSD-3-Clause" }
8
+ authors = [{ name = "Gavin M. Roy", email = "gavinr@aweber.com" }]
9
+ classifiers = [
10
+ "Development Status :: 3 - Alpha",
11
+ "Intended Audience :: Developers",
12
+ "Natural Language :: English",
13
+ "Operating System :: OS Independent",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3.14",
16
+ ]
17
+ dependencies = [
18
+ "httpx>=0.27",
19
+ "imbi-common>=0.1.0a1",
20
+ "pydantic>=2",
21
+ ]
22
+
23
+ [project.entry-points."imbi.plugins"]
24
+ oidc = "imbi_plugin_oidc.plugin:OIDCPlugin"
25
+
26
+ [dependency-groups]
27
+ dev = [
28
+ "basedpyright",
29
+ "coverage[toml]",
30
+ "imbi-common[server,databases]",
31
+ "pre-commit",
32
+ "pytest",
33
+ "pytest-asyncio",
34
+ "respx",
35
+ "ruff~=0.14.6",
36
+ ]
37
+ dist = ["build", "twine", "wheel"]
38
+
39
+ [build-system]
40
+ requires = ["hatchling"]
41
+ build-backend = "hatchling.build"
42
+
43
+ [tool.hatch.build.targets.wheel]
44
+ packages = ["src/imbi_plugin_oidc"]
45
+
46
+ [tool.coverage.report]
47
+ exclude_also = ["typing.TYPE_CHECKING"]
48
+ fail_under = 90
49
+ show_missing = true
50
+
51
+ [tool.coverage.run]
52
+ branch = true
53
+ source = ["src/imbi_plugin_oidc"]
54
+
55
+ [tool.pytest.ini_options]
56
+ asyncio_mode = "auto"
57
+ asyncio_default_fixture_loop_scope = "function"
58
+
59
+ [tool.pyright]
60
+ executionEnvironments = [
61
+ { root = "src" },
62
+ { root = "tests", reportPrivateUsage = false },
63
+ ]
64
+ deprecateTypingAliases = true
65
+ reportMissingSuperCall = "hint"
66
+ reportMissingTypeStubs = false
67
+ typeCheckingMode = "strict"
68
+
69
+ [tool.ruff]
70
+ line-length = 79
71
+ target-version = "py314"
72
+
73
+ [tool.ruff.format]
74
+ quote-style = "single"
75
+
76
+ [tool.ruff.lint]
77
+ select = [
78
+ "BLE",
79
+ "C4",
80
+ "C90",
81
+ "E",
82
+ "W",
83
+ "F",
84
+ "G",
85
+ "I",
86
+ "N",
87
+ "Q",
88
+ "S",
89
+ "ASYNC",
90
+ "B",
91
+ "DTZ",
92
+ "FURB",
93
+ "RUF",
94
+ "T20",
95
+ "UP",
96
+ ]
97
+ ignore = [
98
+ "ASYNC109",
99
+ "N818",
100
+ "RSE",
101
+ "S105",
102
+ "TRY003",
103
+ "TRY400",
104
+ "UP047",
105
+ ]
106
+ flake8-quotes = { inline-quotes = "single" }
107
+
108
+ [tool.ruff.lint.mccabe]
109
+ max-complexity = 15
110
+
111
+ [tool.ruff.lint.per-file-ignores]
112
+ "tests/**/*.py" = ["S"]
113
+
114
+ [tool.uv]
115
+ default-groups = ["dev"]
116
+
117
+ [[tool.uv.index]]
118
+ url = "https://pypi.org/simple"
119
+ default = true
@@ -0,0 +1,5 @@
1
+ """Imbi OIDC identity plugin."""
2
+
3
+ from imbi_plugin_oidc.plugin import OIDCPlugin
4
+
5
+ __all__ = ['OIDCPlugin']