tba-app-backend-developer 0.4.0.dev2__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,65 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-app-backend-developer
3
+ Version: 0.4.0.dev2
4
+ Summary: Developer OIDC/OAuth backend application for TBA.
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.10,<3.15
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Requires-Dist: tba-app-backend-core (==0.4.0.dev2)
14
+ Requires-Dist: tba-auth (==0.4.0.dev2)
15
+ Requires-Dist: tba-router-administration-gate (==0.4.0.dev2)
16
+ Requires-Dist: tba-router-oauth-authorization-server-metadata (==0.4.0.dev2)
17
+ Requires-Dist: tba-router-oauth-registration (==0.4.0.dev2)
18
+ Requires-Dist: tba-router-oidc-discovery (==0.4.0.dev2)
19
+ Project-URL: Homepage, https://github.com/tigrbl/tigrbl_auth
20
+ Project-URL: Repository, https://github.com/tigrbl/tigrbl_auth
21
+ Project-URL: Source, https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/90-backend-apps/tba-app-backend-developer
22
+ Description-Content-Type: text/markdown
23
+
24
+ # tba-app-backend-developer
25
+
26
+ Developer self-service OAuth/OIDC client registration API front door.
27
+
28
+ ## Surface
29
+
30
+ | Property | Value |
31
+ | --- | --- |
32
+ | Product surface | `developer-app` |
33
+ | Intended UIX | `@tba/ui-developer` |
34
+ | Exposes | Dynamic client registration, client management, client metadata, JWKS/discovery helpers |
35
+ | Excludes | Tenant lifecycle operations, platform authority assignment, service identity administration |
36
+
37
+ ## Entrypoint
38
+
39
+ ```python
40
+ from tba_app_backend_developer import app, build_app
41
+ ```
42
+
43
+ ## Local dev deployment
44
+
45
+ ```powershell
46
+ docker compose -f docker/docker-compose.developer-app.yml up -d --build
47
+ ```
48
+
49
+ The dev deployment listens on `http://localhost:8017` and uses
50
+ `dev-developer-key` for the admin client-management routes and RPC methods.
51
+
52
+ Useful checks:
53
+
54
+ | Check | Expected |
55
+ | --- | --- |
56
+ | `GET /openapi.json` | Developer OpenAPI document |
57
+ | `GET /openrpc.json` | Client-management OpenRPC document |
58
+ | `POST /register` | Dynamic client-registration route exists without admin key |
59
+ | `GET /client` | Admin-key guarded client REST surface |
60
+ | `GET /clientregistration` | Admin-key guarded client-registration REST surface |
61
+ | `GET /tenants/public/.well-known/jwks.json` | Tenant JWKS metadata helper |
62
+
63
+ The developer API intentionally does not expose `/tenant`, `/authorize`,
64
+ `/token`, or service/workload administration routes.
65
+
@@ -0,0 +1,41 @@
1
+ # tba-app-backend-developer
2
+
3
+ Developer self-service OAuth/OIDC client registration API front door.
4
+
5
+ ## Surface
6
+
7
+ | Property | Value |
8
+ | --- | --- |
9
+ | Product surface | `developer-app` |
10
+ | Intended UIX | `@tba/ui-developer` |
11
+ | Exposes | Dynamic client registration, client management, client metadata, JWKS/discovery helpers |
12
+ | Excludes | Tenant lifecycle operations, platform authority assignment, service identity administration |
13
+
14
+ ## Entrypoint
15
+
16
+ ```python
17
+ from tba_app_backend_developer import app, build_app
18
+ ```
19
+
20
+ ## Local dev deployment
21
+
22
+ ```powershell
23
+ docker compose -f docker/docker-compose.developer-app.yml up -d --build
24
+ ```
25
+
26
+ The dev deployment listens on `http://localhost:8017` and uses
27
+ `dev-developer-key` for the admin client-management routes and RPC methods.
28
+
29
+ Useful checks:
30
+
31
+ | Check | Expected |
32
+ | --- | --- |
33
+ | `GET /openapi.json` | Developer OpenAPI document |
34
+ | `GET /openrpc.json` | Client-management OpenRPC document |
35
+ | `POST /register` | Dynamic client-registration route exists without admin key |
36
+ | `GET /client` | Admin-key guarded client REST surface |
37
+ | `GET /clientregistration` | Admin-key guarded client-registration REST surface |
38
+ | `GET /tenants/public/.well-known/jwks.json` | Tenant JWKS metadata helper |
39
+
40
+ The developer API intentionally does not expose `/tenant`, `/authorize`,
41
+ `/token`, or service/workload administration routes.
@@ -0,0 +1,27 @@
1
+ [project]
2
+ name = "tba-app-backend-developer"
3
+ version = "0.4.0.dev2"
4
+ description = "Developer OIDC/OAuth backend application for TBA."
5
+ readme = "README.md"
6
+ requires-python = ">=3.10,<3.15"
7
+ license = "Apache-2.0"
8
+ dependencies = [
9
+ "tba-auth==0.4.0.dev2",
10
+ "tba-app-backend-core==0.4.0.dev2",
11
+ "tba-router-administration-gate==0.4.0.dev2",
12
+ "tba-router-oauth-authorization-server-metadata==0.4.0.dev2",
13
+ "tba-router-oauth-registration==0.4.0.dev2",
14
+ "tba-router-oidc-discovery==0.4.0.dev2",
15
+ ]
16
+
17
+ [project.urls]
18
+ Homepage = "https://github.com/tigrbl/tigrbl_auth"
19
+ Repository = "https://github.com/tigrbl/tigrbl_auth"
20
+ Source = "https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/90-backend-apps/tba-app-backend-developer"
21
+
22
+ [build-system]
23
+ requires = ["poetry-core>=1.0.0"]
24
+ build-backend = "poetry.core.masonry.api"
25
+
26
+ [tool.poetry]
27
+ packages = [{ include = "tba_app_backend_developer", from = "src" }]
@@ -0,0 +1,14 @@
1
+ """Developer backend application package for TBA."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .app import PRODUCT_SURFACE, app, build_app
6
+ from .contract import DEVELOPER_BACKEND_APP_CONTRACT, DeveloperBackendAppContract
7
+
8
+ __all__ = [
9
+ "DEVELOPER_BACKEND_APP_CONTRACT",
10
+ "DeveloperBackendAppContract",
11
+ "PRODUCT_SURFACE",
12
+ "app",
13
+ "build_app",
14
+ ]
@@ -0,0 +1,52 @@
1
+ """ASGI entrypoint for the developer TBA backend application."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from typing import TYPE_CHECKING
7
+
8
+ from tba_app_backend_core import build_product_app
9
+ from tba_app_backend_developer.contract import DEVELOPER_BACKEND_APP_CONTRACT
10
+ from tba_auth.runtime import LazyASGIApplication
11
+
12
+ if TYPE_CHECKING:
13
+ from tigrbl import TigrblApp
14
+
15
+ PRODUCT_SURFACE = "developer-app"
16
+
17
+
18
+ def _default_settings() -> object:
19
+ from tba_auth.config.settings import Settings
20
+
21
+ settings = Settings()
22
+ env_overrides = {
23
+ "issuer": os.environ.get("AUTHN_ISSUER"),
24
+ "protected_resource_identifier": os.environ.get(
25
+ "TBA_AUTH_PROTECTED_RESOURCE_IDENTIFIER"
26
+ ),
27
+ "deployment_profile": os.environ.get("TBA_AUTH_PROFILE"),
28
+ "require_tls": os.environ.get("TBA_AUTH_REQUIRE_TLS"),
29
+ "admin_api_key": os.environ.get("TBA_AUTH_ADMIN_API_KEY"),
30
+ "admin_api_key_dir": os.environ.get("TBA_AUTH_ADMIN_API_KEY_DIR"),
31
+ }
32
+ for name, value in env_overrides.items():
33
+ if value in {None, ""}:
34
+ continue
35
+ current = getattr(settings, name, None)
36
+ if isinstance(current, bool):
37
+ value = str(value).lower() in {"1", "true", "yes", "on"}
38
+ setattr(settings, name, value)
39
+ return settings
40
+
41
+
42
+ def build_app(settings_obj: object | None = None) -> "TigrblApp":
43
+ if settings_obj is None:
44
+ settings_obj = _default_settings()
45
+ return build_product_app(
46
+ PRODUCT_SURFACE, settings_obj, contract=DEVELOPER_BACKEND_APP_CONTRACT
47
+ )
48
+
49
+
50
+ app = LazyASGIApplication(build_app)
51
+
52
+ __all__ = ["PRODUCT_SURFACE", "app", "build_app"]
@@ -0,0 +1,83 @@
1
+ """Developer backend-app contract for TBA."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+
7
+
8
+ @dataclass(frozen=True, slots=True)
9
+ class DeveloperBackendAppContract:
10
+ """Machine-readable boundary for the developer self-service backend app."""
11
+
12
+ product_surface: str
13
+ intended_uix: str
14
+ public_capabilities: tuple[str, ...]
15
+ admin_resources: tuple[str, ...]
16
+ admin_rest_groups: tuple[str, ...]
17
+ forbidden_route_prefixes: tuple[str, ...]
18
+ forbidden_exact_routes: tuple[str, ...]
19
+ consumed_packages: tuple[str, ...]
20
+ mounted_router_packages: tuple[str, ...]
21
+ app_local_route_groups: tuple[str, ...]
22
+
23
+
24
+ DEVELOPER_BACKEND_APP_CONTRACT = DeveloperBackendAppContract(
25
+ product_surface="developer-app",
26
+ intended_uix="@tba/ui-developer",
27
+ public_capabilities=(
28
+ "register",
29
+ "register-management",
30
+ "openid-configuration",
31
+ "tenant-openid-configuration",
32
+ "realm-openid-configuration",
33
+ "oauth-authorization-server-metadata",
34
+ "jwks",
35
+ "tenant-jwks",
36
+ "realm-jwks",
37
+ ),
38
+ admin_resources=("Client", "ClientRegistration", "AuditEvent"),
39
+ admin_rest_groups=(),
40
+ forbidden_route_prefixes=(
41
+ "/tenant",
42
+ "/user",
43
+ "/authsession",
44
+ "/consent",
45
+ "/serviceidentity",
46
+ "/credentialservicekey",
47
+ "/credentialapikey",
48
+ "/cryptokey",
49
+ "/cryptokeyversion",
50
+ "/principalkeybinding",
51
+ "/keyenvelope",
52
+ "/keyattestationevidence",
53
+ "/tokenrecord",
54
+ "/revokedtoken",
55
+ ),
56
+ forbidden_exact_routes=(
57
+ "/login",
58
+ "/authorize",
59
+ "/token",
60
+ "/logout",
61
+ "/revoke",
62
+ "/userinfo",
63
+ "/introspect",
64
+ ),
65
+ consumed_packages=(
66
+ "tba-auth",
67
+ "tba-server-identity",
68
+ "tba-runtime-identity",
69
+ "tba-runtime-identity-administration",
70
+ "tba-concrete-identity-principals",
71
+ "tba-protocol-oauth",
72
+ "tba-protocol-oidc",
73
+ ),
74
+ mounted_router_packages=(
75
+ "tba-router-administration-gate",
76
+ "tba-router-oauth-authorization-server-metadata",
77
+ "tba-router-oauth-registration",
78
+ "tba-router-oidc-discovery",
79
+ ),
80
+ app_local_route_groups=(),
81
+ )
82
+
83
+ __all__ = ["DEVELOPER_BACKEND_APP_CONTRACT", "DeveloperBackendAppContract"]