simple-module-oidc 0.0.47__tar.gz → 0.0.48__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.
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/.gitignore +6 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/PKG-INFO +9 -6
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/README.md +4 -1
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/core/constants.py +0 -1
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/core/settings.py +1 -9
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/provider.py +0 -1
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/module.py +9 -14
- simple_module_oidc-0.0.48/oidc/pages/i18n.generated.ts +34 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/web/endpoints/api.py +3 -2
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/web/endpoints/views.py +2 -1
- simple_module_oidc-0.0.48/package.json +4 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/pyproject.toml +6 -5
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/core/module/test_oidc_module.py +1 -1
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/core/settings/test_oidc_settings_presets.py +1 -2
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/renewal/test_oidc_session_transaction.py +6 -1
- simple_module_oidc-0.0.47/package.json +0 -7
- simple_module_oidc-0.0.47/tsconfig.json +0 -4
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/__init__.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/contracts/__init__.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/core/__init__.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/core/presets.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/core/runtime.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/core/state.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/__init__.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/client.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/directory.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/discovery.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/jwks.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/persistence.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/renewal.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/identity/tokens.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/locales/de.json +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/locales/en.json +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/models.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/pages/LoggedOut.tsx +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/pages/Login.tsx +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/py.typed +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/web/__init__.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/oidc/web/endpoints/__init__.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/conftest.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/core/module/test_oidc_boot.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/core/module/test_oidc_migration.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/core/runtime/test_oidc_settings_runtime.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/client/test_oidc_client.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/directory/test_oidc_directory.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/discovery/test_oidc_discovery.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/jwks/test_oidc_jwks.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/jwks/test_oidc_jwks_resilience.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/persistence/test_oidc_cache_persistence.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/provider/test_oidc_bearer_policy.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/provider/test_oidc_jwt_policy.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/provider/test_oidc_legacy_authority.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/provider/test_oidc_provider.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/provider/test_oidc_sign_in_from_claims.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/provider/test_oidc_tenant_resolver.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/renewal/test_oidc_refresh.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/oidc_flow_helpers.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/web/endpoints/test_oidc_authorization.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/web/endpoints/test_oidc_authorization_query.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/web/endpoints/test_oidc_endpoint_auth.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/web/endpoints/test_oidc_flow.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/web/endpoints/test_oidc_keycloak_flow.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/web/endpoints/test_oidc_logout.py +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests-js/oidc-login.test.tsx +0 -0
- {simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests-js/oidc-translations.test.tsx +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: simple_module_oidc
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.48
|
|
4
4
|
Summary: Generic OIDC authentication provider for simple_module — native Microsoft Entra ID, Auth0, Okta, Keycloak, and any OpenID Connect identity provider
|
|
5
5
|
Project-URL: Homepage, https://github.com/antosubash/simple_module_python
|
|
6
6
|
Project-URL: Repository, https://github.com/antosubash/simple_module_python
|
|
@@ -21,10 +21,10 @@ Requires-Python: >=3.12
|
|
|
21
21
|
Requires-Dist: cryptography>=42
|
|
22
22
|
Requires-Dist: httpx<0.29,>=0.27
|
|
23
23
|
Requires-Dist: pyjwt[crypto]<3,>=2.8
|
|
24
|
-
Requires-Dist: simple-module-auth==0.0.
|
|
25
|
-
Requires-Dist: simple-module-core==0.0.
|
|
26
|
-
Requires-Dist: simple-module-db==0.0.
|
|
27
|
-
Requires-Dist: simple-module-hosting==0.0.
|
|
24
|
+
Requires-Dist: simple-module-auth==0.0.48
|
|
25
|
+
Requires-Dist: simple-module-core==0.0.48
|
|
26
|
+
Requires-Dist: simple-module-db==0.0.48
|
|
27
|
+
Requires-Dist: simple-module-hosting==0.0.48
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
|
|
30
30
|
# simple_module_oidc
|
|
@@ -183,7 +183,6 @@ and tenant-claim trust read the live settings state.
|
|
|
183
183
|
| `email_claim` | `email` | Display email; only generic OIDC literal `email_verified=true` attests ownership. Entra never attests it. |
|
|
184
184
|
| `roles_claim_path` | `roles` for Entra, otherwise empty | Dotted claim path to role list. |
|
|
185
185
|
| `role_mapping` | admin/user map to themselves | External roles to application roles; `tenant:*` roles are filtered on login and restored sessions. |
|
|
186
|
-
| `login_redirect_url` | `/dashboard/` | Blank values normalize to the default. Saved deep links must be local paths. |
|
|
187
186
|
| `jwks_cache_ttl_seconds` | 3600 | Last-good signing keys retained on outage; unknown keys share a 30-second fetch cooldown. |
|
|
188
187
|
|
|
189
188
|
## Login, sessions and logout
|
|
@@ -229,3 +228,7 @@ Alternatively scope active modules with `SM_MODULES_ENABLED`.
|
|
|
229
228
|
|
|
230
229
|
See [the full configuration reference](../../docs/modules/oidc.md)
|
|
231
230
|
for every setting, its environment support, tenancy policy and deployment limits.
|
|
231
|
+
|
|
232
|
+
Post-login destinations use `host.login_redirect_url` for every provider. The
|
|
233
|
+
default `/dashboard/` falls back to the first other view when Dashboard is absent,
|
|
234
|
+
then `/`. Old per-provider redirect rows are ignored quietly.
|
|
@@ -154,7 +154,6 @@ and tenant-claim trust read the live settings state.
|
|
|
154
154
|
| `email_claim` | `email` | Display email; only generic OIDC literal `email_verified=true` attests ownership. Entra never attests it. |
|
|
155
155
|
| `roles_claim_path` | `roles` for Entra, otherwise empty | Dotted claim path to role list. |
|
|
156
156
|
| `role_mapping` | admin/user map to themselves | External roles to application roles; `tenant:*` roles are filtered on login and restored sessions. |
|
|
157
|
-
| `login_redirect_url` | `/dashboard/` | Blank values normalize to the default. Saved deep links must be local paths. |
|
|
158
157
|
| `jwks_cache_ttl_seconds` | 3600 | Last-good signing keys retained on outage; unknown keys share a 30-second fetch cooldown. |
|
|
159
158
|
|
|
160
159
|
## Login, sessions and logout
|
|
@@ -200,3 +199,7 @@ Alternatively scope active modules with `SM_MODULES_ENABLED`.
|
|
|
200
199
|
|
|
201
200
|
See [the full configuration reference](../../docs/modules/oidc.md)
|
|
202
201
|
for every setting, its environment support, tenancy policy and deployment limits.
|
|
202
|
+
|
|
203
|
+
Post-login destinations use `host.login_redirect_url` for every provider. The
|
|
204
|
+
default `/dashboard/` falls back to the first other view when Dashboard is absent,
|
|
205
|
+
then `/`. Old per-provider redirect rows are ignored quietly.
|
|
@@ -9,15 +9,13 @@ from __future__ import annotations
|
|
|
9
9
|
|
|
10
10
|
import os
|
|
11
11
|
|
|
12
|
-
from pydantic import Field,
|
|
12
|
+
from pydantic import Field, model_validator
|
|
13
13
|
from pydantic_settings import SettingsConfigDict
|
|
14
14
|
from simple_module_core.dotenv import env_str
|
|
15
15
|
from simple_module_core.environments import NON_PROD_ENVIRONMENTS
|
|
16
|
-
from simple_module_core.redirect_safety import non_empty_redirect
|
|
17
16
|
from simple_module_core.settings_base import DbBackedSettings
|
|
18
17
|
from simple_module_core.stored_settings import field_error
|
|
19
18
|
|
|
20
|
-
from oidc.core.constants import DEFAULT_LOGIN_REDIRECT_URL
|
|
21
19
|
from oidc.core.presets import get_preset
|
|
22
20
|
|
|
23
21
|
# Sentinel for "unset by the user" so the preset can supply a default while still
|
|
@@ -74,7 +72,6 @@ class OidcSettings(DbBackedSettings):
|
|
|
74
72
|
# the Settings UI that edits this needs an admin. A stored value still wins.
|
|
75
73
|
roles_claim_path: str = env_str("SM_OIDC_ROLES_CLAIM_PATH", _UNSET)
|
|
76
74
|
|
|
77
|
-
login_redirect_url: str = DEFAULT_LOGIN_REDIRECT_URL
|
|
78
75
|
jwks_cache_ttl_seconds: int = Field(
|
|
79
76
|
default=3600, ge=0, json_schema_extra={"requires_restart": True}
|
|
80
77
|
)
|
|
@@ -83,11 +80,6 @@ class OidcSettings(DbBackedSettings):
|
|
|
83
80
|
default_factory=lambda: {"admin": "admin", "user": "user"},
|
|
84
81
|
)
|
|
85
82
|
|
|
86
|
-
@field_validator("login_redirect_url")
|
|
87
|
-
@classmethod
|
|
88
|
-
def _non_empty_redirect(cls, value: str) -> str:
|
|
89
|
-
return non_empty_redirect(value, default=DEFAULT_LOGIN_REDIRECT_URL)
|
|
90
|
-
|
|
91
83
|
@model_validator(mode="after")
|
|
92
84
|
def _apply_preset(self) -> OidcSettings:
|
|
93
85
|
preset = get_preset(self.provider)
|
|
@@ -32,7 +32,6 @@ class OidcAuthProvider(CachePersistence, SessionRenewal):
|
|
|
32
32
|
"""Generic OIDC authentication with issuer-scoped identities."""
|
|
33
33
|
|
|
34
34
|
name = "oidc"
|
|
35
|
-
_is_auth_provider = True
|
|
36
35
|
|
|
37
36
|
def __init__(
|
|
38
37
|
self, settings: OidcSettings | None = None, *, state: OidcState | None = None
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import importlib.resources
|
|
6
|
-
from pathlib import Path
|
|
7
5
|
from typing import TYPE_CHECKING
|
|
8
6
|
|
|
9
7
|
from simple_module_core.menu import MenuItem, MenuRegistry, MenuSection
|
|
10
8
|
from simple_module_core.module import ModuleBase, ModuleMeta
|
|
11
9
|
from simple_module_core.module_settings import register_module_settings
|
|
10
|
+
from simple_module_core.role_directory import MappedRoleDirectory, set_role_directory
|
|
12
11
|
from simple_module_core.user_directory import set_user_directory
|
|
13
12
|
|
|
14
13
|
from oidc.core.constants import (
|
|
@@ -22,18 +21,23 @@ from oidc.core.constants import (
|
|
|
22
21
|
)
|
|
23
22
|
|
|
24
23
|
if TYPE_CHECKING:
|
|
25
|
-
from fastapi import
|
|
24
|
+
from fastapi import FastAPI
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
class OidcModule(ModuleBase):
|
|
29
28
|
meta = ModuleMeta(
|
|
30
29
|
name="Oidc",
|
|
30
|
+
provides_auth=True,
|
|
31
31
|
route_prefix="/api/oidc",
|
|
32
32
|
view_prefix="/oidc",
|
|
33
33
|
depends_on=[_MODULE_AUTH],
|
|
34
34
|
optional_depends_on=[_MODULE_SETTINGS],
|
|
35
35
|
)
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
def register_principal_builder(self, registry) -> None:
|
|
38
|
+
from oidc.identity.directory import OidcDirectory
|
|
39
|
+
|
|
40
|
+
registry.directory = OidcDirectory()
|
|
37
41
|
|
|
38
42
|
def register_settings(self, app: FastAPI) -> None:
|
|
39
43
|
from oidc.core.settings import OidcSettings
|
|
@@ -49,6 +53,7 @@ class OidcModule(ModuleBase):
|
|
|
49
53
|
)
|
|
50
54
|
|
|
51
55
|
set_user_directory(app, OidcDirectory())
|
|
56
|
+
set_role_directory(app, MappedRoleDirectory(lambda: app.state.oidc.settings.role_mapping))
|
|
52
57
|
app.state.auth.auth_provider = OidcAuthProvider(
|
|
53
58
|
app.state.oidc.settings, state=app.state.oidc
|
|
54
59
|
)
|
|
@@ -66,13 +71,6 @@ class OidcModule(ModuleBase):
|
|
|
66
71
|
)
|
|
67
72
|
)
|
|
68
73
|
|
|
69
|
-
def register_routes(self, api_router: APIRouter, view_router: APIRouter) -> None:
|
|
70
|
-
from oidc.web.endpoints.api import router as api
|
|
71
|
-
from oidc.web.endpoints.views import router as views
|
|
72
|
-
|
|
73
|
-
api_router.include_router(api)
|
|
74
|
-
view_router.include_router(views)
|
|
75
|
-
|
|
76
74
|
def register_public_routes(self, registry) -> None:
|
|
77
75
|
for path in (LOGIN_PATH, LOGGED_OUT_PATH, AUTH_LOGIN_PATH, AUTH_CALLBACK_PATH):
|
|
78
76
|
registry.add_exact(path, methods={"GET"})
|
|
@@ -82,6 +80,3 @@ class OidcModule(ModuleBase):
|
|
|
82
80
|
from oidc.core.runtime import initialize
|
|
83
81
|
|
|
84
82
|
await initialize(app)
|
|
85
|
-
|
|
86
|
-
def locale_dirs(self) -> dict[str, Path]:
|
|
87
|
-
return {"oidc": Path(str(importlib.resources.files(__package__) / "locales"))}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import '@simple-module-py/i18n';
|
|
2
|
+
|
|
3
|
+
// AUTO-GENERATED by simple_module_hosting.i18n_manifest — do not edit by hand.
|
|
4
|
+
// Regenerate by booting the host in development mode or `make gen-i18n`.
|
|
5
|
+
|
|
6
|
+
export const keys = {
|
|
7
|
+
oidc: {
|
|
8
|
+
login: {
|
|
9
|
+
manual: 'oidc.login.manual',
|
|
10
|
+
redirecting: 'oidc.login.redirecting',
|
|
11
|
+
},
|
|
12
|
+
logout: {
|
|
13
|
+
message: 'oidc.logout.message',
|
|
14
|
+
sign_in_again: 'oidc.logout.sign_in_again',
|
|
15
|
+
title: 'oidc.logout.title',
|
|
16
|
+
},
|
|
17
|
+
nav: {
|
|
18
|
+
logout: 'oidc.nav.logout',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
type ModuleTranslationResources = {
|
|
24
|
+
readonly 'oidc.login.manual': '';
|
|
25
|
+
readonly 'oidc.login.redirecting': '';
|
|
26
|
+
readonly 'oidc.logout.message': '';
|
|
27
|
+
readonly 'oidc.logout.sign_in_again': '';
|
|
28
|
+
readonly 'oidc.logout.title': '';
|
|
29
|
+
readonly 'oidc.nav.logout': '';
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
declare module '@simple-module-py/i18n' {
|
|
33
|
+
interface TranslationResources extends ModuleTranslationResources {}
|
|
34
|
+
}
|
|
@@ -8,6 +8,7 @@ import time
|
|
|
8
8
|
|
|
9
9
|
from auth.oidc_common.session import sign_in, stale_callback
|
|
10
10
|
from fastapi import APIRouter, HTTPException, Request
|
|
11
|
+
from simple_module_hosting.auth_policy import login_redirect_url
|
|
11
12
|
from starlette.responses import RedirectResponse
|
|
12
13
|
|
|
13
14
|
from oidc.core.constants import (
|
|
@@ -51,7 +52,7 @@ async def oidc_callback(request: Request):
|
|
|
51
52
|
request,
|
|
52
53
|
SESSION_STATE_KEY,
|
|
53
54
|
SESSION_USER_KEY,
|
|
54
|
-
request.app
|
|
55
|
+
login_redirect_url(request.app, "Oidc"),
|
|
55
56
|
)
|
|
56
57
|
if stale is not None:
|
|
57
58
|
return stale
|
|
@@ -108,7 +109,7 @@ async def oidc_callback(request: Request):
|
|
|
108
109
|
user=user_ctx,
|
|
109
110
|
expires_at=expires_at,
|
|
110
111
|
authority=provider._session_authority,
|
|
111
|
-
redirect=
|
|
112
|
+
redirect=login_redirect_url(request.app, "Oidc"),
|
|
112
113
|
user_key=SESSION_USER_KEY,
|
|
113
114
|
identity_key=SESSION_IDENTITY_KEY,
|
|
114
115
|
identity=identity,
|
|
@@ -4,6 +4,7 @@ import logging
|
|
|
4
4
|
|
|
5
5
|
from auth.oidc_common.renewal_outcomes import forget_outcomes
|
|
6
6
|
from fastapi import APIRouter, Request
|
|
7
|
+
from simple_module_hosting.auth_policy import login_redirect_url
|
|
7
8
|
from simple_module_hosting.inertia_deps import InertiaDep, is_inertia_request
|
|
8
9
|
from simple_module_inertia.response import location
|
|
9
10
|
from starlette.responses import RedirectResponse
|
|
@@ -32,7 +33,7 @@ async def logged_out_page(request: Request, inertia: InertiaDep):
|
|
|
32
33
|
# Only meaningful once the session is gone; a signed-in visitor is not
|
|
33
34
|
# told they were signed out.
|
|
34
35
|
if is_signed_in(request.session):
|
|
35
|
-
return RedirectResponse(request.app
|
|
36
|
+
return RedirectResponse(login_redirect_url(request.app, "Oidc"), 303)
|
|
36
37
|
return await inertia.render(_PAGE_LOGGED_OUT)
|
|
37
38
|
|
|
38
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "simple_module_oidc"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.48"
|
|
4
4
|
description = "Generic OIDC authentication provider for simple_module — native Microsoft Entra ID, Auth0, Okta, Keycloak, and any OpenID Connect identity provider"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -20,10 +20,10 @@ classifiers = [
|
|
|
20
20
|
"Typing :: Typed",
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
|
-
"simple_module_core==0.0.
|
|
24
|
-
"simple_module_db==0.0.
|
|
25
|
-
"simple_module_hosting==0.0.
|
|
26
|
-
"simple_module_auth==0.0.
|
|
23
|
+
"simple_module_core==0.0.48",
|
|
24
|
+
"simple_module_db==0.0.48",
|
|
25
|
+
"simple_module_hosting==0.0.48",
|
|
26
|
+
"simple_module_auth==0.0.48",
|
|
27
27
|
"PyJWT[crypto]>=2.8,<3",
|
|
28
28
|
"cryptography>=42",
|
|
29
29
|
"httpx>=0.27,<0.29",
|
|
@@ -43,6 +43,7 @@ build-backend = "hatchling.build"
|
|
|
43
43
|
[tool.hatch.build.targets.wheel]
|
|
44
44
|
packages = ["oidc"]
|
|
45
45
|
|
|
46
|
+
# Preserve the published @simple-module/oidc alias.
|
|
46
47
|
[tool.hatch.build.targets.wheel.force-include]
|
|
47
48
|
"package.json" = "oidc/package.json"
|
|
48
49
|
|
{simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/core/module/test_oidc_module.py
RENAMED
|
@@ -12,7 +12,7 @@ def test_oidc_module_meta():
|
|
|
12
12
|
assert mod.meta.name == "Oidc"
|
|
13
13
|
assert mod.meta.depends_on == ["Auth"]
|
|
14
14
|
assert mod.meta.optional_depends_on == ["Settings"]
|
|
15
|
-
assert mod.
|
|
15
|
+
assert mod.meta.provides_auth is True
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
def test_oidc_provider_satisfies_protocol():
|
|
@@ -76,8 +76,7 @@ def test_bare_environment_cannot_override_db_policy(monkeypatch):
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
def test_redirect_and_bearer_defaults():
|
|
79
|
-
settings = OidcSettings(client_id="app"
|
|
80
|
-
assert settings.login_redirect_url == "/dashboard/"
|
|
79
|
+
settings = OidcSettings(client_id="app")
|
|
81
80
|
assert settings.api_audience == ""
|
|
82
81
|
assert settings.trust_tenant_claim is False
|
|
83
82
|
|
|
@@ -13,6 +13,7 @@ from oidc.identity.provider import OidcAuthProvider
|
|
|
13
13
|
from oidc.identity.tokens import open_refresh_token
|
|
14
14
|
from oidc.web.endpoints import api
|
|
15
15
|
from simple_module_hosting.csrf import get_csrf_token
|
|
16
|
+
from simple_module_hosting.host_settings import HostSettings
|
|
16
17
|
from simple_module_hosting.session import SessionMiddleware, preserve_across_sign_in
|
|
17
18
|
from starlette.requests import Request
|
|
18
19
|
from starlette.responses import Response
|
|
@@ -26,6 +27,7 @@ def callback(monkeypatch):
|
|
|
26
27
|
claims = {"iss": "https://idp", "sub": "user", "nonce": "nonce", "exp": 2000}
|
|
27
28
|
app = SimpleNamespace(
|
|
28
29
|
state=SimpleNamespace(
|
|
30
|
+
host=SimpleNamespace(settings=HostSettings()),
|
|
29
31
|
oidc=SimpleNamespace(
|
|
30
32
|
settings=settings,
|
|
31
33
|
client=SimpleNamespace(
|
|
@@ -36,7 +38,10 @@ def callback(monkeypatch):
|
|
|
36
38
|
jwks_cache=SimpleNamespace(validate_jwt=AsyncMock(return_value=claims)),
|
|
37
39
|
),
|
|
38
40
|
auth=SimpleNamespace(auth_provider=provider),
|
|
39
|
-
sm=SimpleNamespace(
|
|
41
|
+
sm=SimpleNamespace(
|
|
42
|
+
settings=SimpleNamespace(secret_key="test-secret-key"),
|
|
43
|
+
modules=[SimpleNamespace(meta=SimpleNamespace(name="Dashboard"))],
|
|
44
|
+
),
|
|
40
45
|
)
|
|
41
46
|
)
|
|
42
47
|
preserve_across_sign_in(app, "gate")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/core/module/test_oidc_migration.py
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/client/test_oidc_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/jwks/test_oidc_jwks.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/identity/renewal/test_oidc_refresh.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/web/endpoints/test_oidc_flow.py
RENAMED
|
File without changes
|
|
File without changes
|
{simple_module_oidc-0.0.47 → simple_module_oidc-0.0.48}/tests/web/endpoints/test_oidc_logout.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|