tba-protocol-oauth 0.4.0.dev2__py3-none-any.whl

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 (62) hide show
  1. tba_protocol_oauth/__init__.py +122 -0
  2. tba_protocol_oauth/bindings.py +116 -0
  3. tba_protocol_oauth/capability_requirements.py +5 -0
  4. tba_protocol_oauth/claim_sets.py +19 -0
  5. tba_protocol_oauth/claims.py +79 -0
  6. tba_protocol_oauth/compatibility.py +39 -0
  7. tba_protocol_oauth/errors.py +25 -0
  8. tba_protocol_oauth/features.py +36 -0
  9. tba_protocol_oauth/jwtoken.py +16 -0
  10. tba_protocol_oauth/migrations.py +37 -0
  11. tba_protocol_oauth/protocol.py +282 -0
  12. tba_protocol_oauth/py.typed +0 -0
  13. tba_protocol_oauth/reusable_components.py +5 -0
  14. tba_protocol_oauth/schemas.py +198 -0
  15. tba_protocol_oauth/standards/__init__.py +9 -0
  16. tba_protocol_oauth/standards/_dpop/__init__.py +57 -0
  17. tba_protocol_oauth/standards/_dpop/metadata.py +18 -0
  18. tba_protocol_oauth/standards/_dpop/primitives.py +194 -0
  19. tba_protocol_oauth/standards/_dpop/proofs.py +393 -0
  20. tba_protocol_oauth/standards/_dpop/state.py +74 -0
  21. tba_protocol_oauth/standards/_introspection_activity.py +32 -0
  22. tba_protocol_oauth/standards/_mtls_identity.py +98 -0
  23. tba_protocol_oauth/standards/_rfc8693/__init__.py +26 -0
  24. tba_protocol_oauth/standards/_rfc8693/endpoint.py +56 -0
  25. tba_protocol_oauth/standards/_rfc8693/runtime.py +289 -0
  26. tba_protocol_oauth/standards/_rfc9700/__init__.py +45 -0
  27. tba_protocol_oauth/standards/_rfc9700/security_profile.py +265 -0
  28. tba_protocol_oauth/standards/_rfc9700/sender_constraints.py +397 -0
  29. tba_protocol_oauth/standards/assertion_framework.py +173 -0
  30. tba_protocol_oauth/standards/authorization_framework.py +102 -0
  31. tba_protocol_oauth/standards/authorization_server_metadata.py +43 -0
  32. tba_protocol_oauth/standards/authorization_server_metadata_endpoint.py +21 -0
  33. tba_protocol_oauth/standards/bearer_token_usage.py +86 -0
  34. tba_protocol_oauth/standards/client_registration_management.py +89 -0
  35. tba_protocol_oauth/standards/device_authorization.py +140 -0
  36. tba_protocol_oauth/standards/dpop.py +59 -0
  37. tba_protocol_oauth/standards/dynamic_client_registration.py +68 -0
  38. tba_protocol_oauth/standards/gnap.py +6 -0
  39. tba_protocol_oauth/standards/introspection.py +56 -0
  40. tba_protocol_oauth/standards/issuer_identification.py +130 -0
  41. tba_protocol_oauth/standards/json_web_token.py +159 -0
  42. tba_protocol_oauth/standards/jwt_access_tokens.py +44 -0
  43. tba_protocol_oauth/standards/jwt_best_practices.py +44 -0
  44. tba_protocol_oauth/standards/jwt_client_auth.py +208 -0
  45. tba_protocol_oauth/standards/jwt_secured_authorization_requests.py +421 -0
  46. tba_protocol_oauth/standards/legacy_jwt_client_assertions.py +113 -0
  47. tba_protocol_oauth/standards/mutual_tls_client_authentication.py +394 -0
  48. tba_protocol_oauth/standards/native_apps.py +132 -0
  49. tba_protocol_oauth/standards/oauth_security_bcp.py +47 -0
  50. tba_protocol_oauth/standards/proof_key_for_code_exchange.py +82 -0
  51. tba_protocol_oauth/standards/protected_resource_metadata.py +103 -0
  52. tba_protocol_oauth/standards/pushed_authorization_requests.py +198 -0
  53. tba_protocol_oauth/standards/resource_indicators.py +127 -0
  54. tba_protocol_oauth/standards/resource_verifier_contract.py +91 -0
  55. tba_protocol_oauth/standards/revocation.py +59 -0
  56. tba_protocol_oauth/standards/rich_authorization_requests.py +221 -0
  57. tba_protocol_oauth/standards/token_endpoint.py +76 -0
  58. tba_protocol_oauth/standards/token_exchange.py +60 -0
  59. tba_protocol_oauth/versions.py +110 -0
  60. tba_protocol_oauth-0.4.0.dev2.dist-info/METADATA +114 -0
  61. tba_protocol_oauth-0.4.0.dev2.dist-info/RECORD +62 -0
  62. tba_protocol_oauth-0.4.0.dev2.dist-info/WHEEL +4 -0
@@ -0,0 +1,221 @@
1
+ """Rich Authorization Requests owner and helper module."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from typing import Any, Final
7
+ from tba_contracts_identity.oauth import AuthorizationDetailsBinding
8
+ from tba_primitives_identity.standards import StandardOwner, describe_owner
9
+ from urllib.parse import urlparse
10
+
11
+ from tba_contracts_identity.protocol_configuration import (
12
+ protocol_settings as settings,
13
+ )
14
+ from tba_protocol_oauth.standards.resource_indicators import (
15
+ select_resource_indicator,
16
+ )
17
+
18
+ try: # pragma: no cover - exercised when the full runtime stack is installed
19
+ from tigrbl.types import BaseModel, ValidationError
20
+ except (
21
+ Exception
22
+ ): # pragma: no cover - dependency-light fallback for checkpoint tests/evidence
23
+ from pydantic import BaseModel, ValidationError # type: ignore
24
+
25
+ STATUS: Final[str] = "rich-authorization-runtime"
26
+ RFC9396_SPEC_URL: Final[str] = "https://www.rfc-editor.org/rfc/rfc9396"
27
+
28
+
29
+ OWNER = StandardOwner(
30
+ label="RFC 9396",
31
+ title="OAuth 2.0 Rich Authorization Requests",
32
+ runtime_status=STATUS,
33
+ public_surface=("/authorize", "/par"),
34
+ notes=(
35
+ "Canonical standards-tree owner module for authorization_details parsing, validation, "
36
+ "resource coupling, and propagation into authorization and PAR handling."
37
+ ),
38
+ )
39
+
40
+
41
+ class AuthorizationDetail(BaseModel):
42
+ type: str
43
+ actions: list[str] | None = None
44
+ locations: list[str] | None = None
45
+ datatypes: list[str] | None = None
46
+ identifier: str | None = None
47
+ privileges: list[str] | None = None
48
+ resource: str | None = None
49
+ resource_indicator: str | None = None
50
+
51
+ model_config = {"extra": "allow"}
52
+
53
+
54
+ def _is_absolute_uri(value: str) -> bool:
55
+ parsed = urlparse(value)
56
+ return bool(parsed.scheme and parsed.netloc and not parsed.fragment)
57
+
58
+
59
+ def _normalize_locations(value: Any) -> list[str] | None:
60
+ if value is None or value == "":
61
+ return None
62
+ if isinstance(value, str):
63
+ items = [value]
64
+ elif isinstance(value, (list, tuple, set)):
65
+ items = [str(item) for item in value if str(item)]
66
+ else:
67
+ raise ValueError(
68
+ f"authorization_details locations must be a string or array: {RFC9396_SPEC_URL}"
69
+ )
70
+ normalized = []
71
+ for item in items:
72
+ if not _is_absolute_uri(item):
73
+ raise ValueError(
74
+ f"authorization_details locations must be absolute URIs: {RFC9396_SPEC_URL}"
75
+ )
76
+ normalized.append(item)
77
+ return normalized or None
78
+
79
+
80
+ def _normalize_multi_string(name: str, value: Any) -> list[str] | None:
81
+ if value is None or value == "":
82
+ return None
83
+ if isinstance(value, str):
84
+ items = [value]
85
+ elif isinstance(value, (list, tuple, set)):
86
+ items = [str(item) for item in value if str(item)]
87
+ else:
88
+ raise ValueError(
89
+ f"authorization_details {name} must be a string or array: {RFC9396_SPEC_URL}"
90
+ )
91
+ return items or None
92
+
93
+
94
+ def _normalize_detail(detail: AuthorizationDetail) -> dict[str, Any]:
95
+ payload = detail.model_dump(exclude_none=True)
96
+ payload["type"] = str(payload["type"])
97
+ if not payload["type"]:
98
+ raise ValueError(f"authorization_details.type is required: {RFC9396_SPEC_URL}")
99
+ if "locations" in payload:
100
+ payload["locations"] = _normalize_locations(payload.get("locations"))
101
+ if payload["locations"] is None:
102
+ payload.pop("locations", None)
103
+ for key in ("actions", "datatypes", "privileges"):
104
+ if key in payload:
105
+ payload[key] = _normalize_multi_string(key, payload.get(key))
106
+ if payload[key] is None:
107
+ payload.pop(key, None)
108
+ for key in ("resource", "resource_indicator"):
109
+ if key in payload and payload[key] not in {None, ""}:
110
+ value = str(payload[key])
111
+ if not _is_absolute_uri(value):
112
+ raise ValueError(
113
+ f"authorization_details {key} must be an absolute URI: {RFC9396_SPEC_URL}"
114
+ )
115
+ payload[key] = value
116
+ else:
117
+ payload.pop(key, None)
118
+ return payload
119
+
120
+
121
+ def parse_authorization_details(raw: str) -> list[AuthorizationDetail]:
122
+ if not settings.enable_rfc9396:
123
+ raise NotImplementedError(
124
+ f"authorization_details not enabled: {RFC9396_SPEC_URL}"
125
+ )
126
+ try:
127
+ data: Any = json.loads(raw)
128
+ except json.JSONDecodeError as exc:
129
+ raise ValueError(
130
+ f"authorization_details must be valid JSON: {RFC9396_SPEC_URL}"
131
+ ) from exc
132
+ if isinstance(data, dict):
133
+ data = [data]
134
+ if not isinstance(data, list):
135
+ raise ValueError(
136
+ f"authorization_details must be an object or array: {RFC9396_SPEC_URL}"
137
+ )
138
+ try:
139
+ return [AuthorizationDetail.model_validate(item) for item in data]
140
+ except ValidationError as exc:
141
+ raise ValueError(f"invalid authorization_details: {RFC9396_SPEC_URL}") from exc
142
+
143
+
144
+ def bind_authorization_details(
145
+ details: list[AuthorizationDetail] | list[dict[str, Any]],
146
+ *,
147
+ resource: str | None = None,
148
+ audience: str | None = None,
149
+ ) -> AuthorizationDetailsBinding:
150
+ if not settings.enable_rfc9396:
151
+ raise NotImplementedError(
152
+ f"authorization_details not enabled: {RFC9396_SPEC_URL}"
153
+ )
154
+ bound_details: list[dict[str, Any]] = []
155
+ effective_target = audience or resource
156
+ for item in details:
157
+ detail = (
158
+ item
159
+ if isinstance(item, AuthorizationDetail)
160
+ else AuthorizationDetail.model_validate(item)
161
+ )
162
+ payload = _normalize_detail(detail)
163
+ detail_targets: list[str] = []
164
+ if payload.get("resource"):
165
+ detail_targets.append(str(payload["resource"]))
166
+ if payload.get("resource_indicator"):
167
+ detail_targets.append(str(payload["resource_indicator"]))
168
+ if payload.get("locations"):
169
+ detail_targets.extend([str(location) for location in payload["locations"]])
170
+ if detail_targets:
171
+ try:
172
+ selection = select_resource_indicator(
173
+ detail_targets, audience=effective_target
174
+ )
175
+ except ValueError as exc:
176
+ raise ValueError(
177
+ f"authorization_details resource binding is inconsistent: {RFC9396_SPEC_URL}"
178
+ ) from exc
179
+ effective_target = selection.audience or effective_target
180
+ payload["_resource"] = selection.resource
181
+ elif effective_target:
182
+ payload["_resource"] = effective_target
183
+ bound_details.append(payload)
184
+ return AuthorizationDetailsBinding(
185
+ details=bound_details, resource=effective_target, audience=effective_target
186
+ )
187
+
188
+
189
+ def normalize_authorization_details(
190
+ raw: str | list[dict[str, Any]] | dict[str, Any],
191
+ *,
192
+ resource: str | None = None,
193
+ audience: str | None = None,
194
+ ) -> AuthorizationDetailsBinding:
195
+ if isinstance(raw, str):
196
+ details = parse_authorization_details(raw)
197
+ else:
198
+ payload = raw if isinstance(raw, list) else [raw]
199
+ details = [AuthorizationDetail.model_validate(item) for item in payload]
200
+ return bind_authorization_details(details, resource=resource, audience=audience)
201
+
202
+
203
+ def describe() -> dict[str, object]:
204
+ return describe_owner(
205
+ OWNER,
206
+ spec_url=RFC9396_SPEC_URL,
207
+ )
208
+
209
+
210
+ __all__ = [
211
+ "STATUS",
212
+ "RFC9396_SPEC_URL",
213
+ "StandardOwner",
214
+ "AuthorizationDetail",
215
+ "AuthorizationDetailsBinding",
216
+ "OWNER",
217
+ "parse_authorization_details",
218
+ "bind_authorization_details",
219
+ "normalize_authorization_details",
220
+ "describe",
221
+ ]
@@ -0,0 +1,76 @@
1
+ """OAuth 2.0 token endpoint capability mapping."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+ from typing import Final
7
+
8
+ from tba_contracts_identity.tokens import (
9
+ IssuedTokenPair,
10
+ RefreshTokenRedemptionRequest,
11
+ TokenPairIssueRequest,
12
+ )
13
+ from tba_primitives_identity.standards import StandardOwner, describe_owner
14
+ from tba_capability_token_issuance import TokenIssuanceCapability
15
+
16
+
17
+ STATUS: Final[str] = "profiled-token-issuance-runtime"
18
+ RFC6749_SPEC_URL: Final[str] = "https://www.rfc-editor.org/rfc/rfc6749"
19
+
20
+ OWNER = StandardOwner(
21
+ label="RFC 6749",
22
+ title="OAuth 2.0 Authorization Framework Token Endpoint",
23
+ runtime_status=STATUS,
24
+ public_surface=("/token",),
25
+ notes=(
26
+ "Maps normalized token issuance and refresh rotation to the "
27
+ "protocol-neutral token.issuance capability."
28
+ ),
29
+ )
30
+
31
+
32
+ class TokenEndpointDisabledError(RuntimeError):
33
+ """Raised when composition disables RFC 6749 token issuance."""
34
+
35
+
36
+ @dataclass(frozen=True, slots=True)
37
+ class RFC6749TokenEndpointService:
38
+ capability: TokenIssuanceCapability
39
+ enabled: bool = True
40
+
41
+ def _require_enabled(self) -> None:
42
+ if not self.enabled:
43
+ raise TokenEndpointDisabledError(
44
+ f"RFC 6749 token endpoint is disabled: {RFC6749_SPEC_URL}"
45
+ )
46
+
47
+ async def issue(self, request: TokenPairIssueRequest) -> IssuedTokenPair:
48
+ self._require_enabled()
49
+ call = await self.capability.call("issue_token_pair", request)
50
+ if not isinstance(call.value, IssuedTokenPair):
51
+ raise TypeError("token.issuance must return IssuedTokenPair")
52
+ return call.value
53
+
54
+ async def refresh(
55
+ self,
56
+ request: RefreshTokenRedemptionRequest,
57
+ ) -> IssuedTokenPair:
58
+ self._require_enabled()
59
+ call = await self.capability.call("redeem_refresh_token", request)
60
+ if not isinstance(call.value, IssuedTokenPair):
61
+ raise TypeError("token.issuance must return IssuedTokenPair")
62
+ return call.value
63
+
64
+
65
+ def describe() -> dict[str, object]:
66
+ return describe_owner(OWNER, spec_url=RFC6749_SPEC_URL)
67
+
68
+
69
+ __all__ = [
70
+ "OWNER",
71
+ "RFC6749_SPEC_URL",
72
+ "RFC6749TokenEndpointService",
73
+ "STATUS",
74
+ "TokenEndpointDisabledError",
75
+ "describe",
76
+ ]
@@ -0,0 +1,60 @@
1
+ """RFC 8693 token-exchange specification owner and compatibility exports."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from tba_primitives_identity.standards import StandardOwner, describe_owner
6
+
7
+ from tba_protocol_oauth.standards._rfc8693 import (
8
+ RFC8693_SPEC_URL,
9
+ TOKEN_EXCHANGE_GRANT_TYPE,
10
+ TokenExchangeRequest,
11
+ TokenExchangeResponse,
12
+ TokenType,
13
+ exchange_token,
14
+ makeDelegationToken,
15
+ makeImpersonationToken,
16
+ validate_subject_token,
17
+ validate_token_exchange_request,
18
+ )
19
+
20
+
21
+ OWNER = StandardOwner(
22
+ label="RFC 8693",
23
+ title="OAuth 2.0 Token Exchange",
24
+ runtime_status="lineage-audited-token-exchange-runtime",
25
+ public_surface=("/token/exchange",),
26
+ notes=(
27
+ "RFC mapping for normalized token.exchange capability execution with "
28
+ "subject-token validation, actor delegation, target selection, sender "
29
+ "constraints, durable lineage, and audit observation."
30
+ ),
31
+ )
32
+
33
+
34
+ def describe() -> dict[str, object]:
35
+ return describe_owner(
36
+ OWNER,
37
+ requested_token_types_supported=(
38
+ "urn:ietf:params:oauth:token-type:access_token",
39
+ "access_token",
40
+ ),
41
+ delegation_supported=True,
42
+ single_effective_target=True,
43
+ spec_url=RFC8693_SPEC_URL,
44
+ )
45
+
46
+
47
+ __all__ = [
48
+ "OWNER",
49
+ "RFC8693_SPEC_URL",
50
+ "TOKEN_EXCHANGE_GRANT_TYPE",
51
+ "TokenExchangeRequest",
52
+ "TokenExchangeResponse",
53
+ "TokenType",
54
+ "describe",
55
+ "exchange_token",
56
+ "makeDelegationToken",
57
+ "makeImpersonationToken",
58
+ "validate_subject_token",
59
+ "validate_token_exchange_request",
60
+ ]
@@ -0,0 +1,110 @@
1
+ """OAuth authorization-framework and extension specification revisions.
2
+
3
+ ``VERSION_HISTORY`` is deliberately limited to the OAuth authorization
4
+ framework lineage. Extension RFCs have independent revision authority and
5
+ are recorded in ``EXTENSION_SPECIFICATIONS`` rather than being presented as
6
+ revisions of OAuth itself.
7
+ """
8
+
9
+ from dataclasses import dataclass
10
+
11
+
12
+ @dataclass(frozen=True, slots=True)
13
+ class OAuthVersion:
14
+ identifier: str
15
+ status: str
16
+ published: str
17
+ specification_uri: str
18
+
19
+
20
+ @dataclass(frozen=True, slots=True)
21
+ class OAuthExtensionSpecification:
22
+ identifier: str
23
+ title: str
24
+ specification_uri: str
25
+
26
+
27
+ VERSION_HISTORY = (
28
+ OAuthVersion(
29
+ "RFC6749",
30
+ "standards-track",
31
+ "2012-10",
32
+ "https://www.rfc-editor.org/rfc/rfc6749",
33
+ ),
34
+ OAuthVersion(
35
+ "draft-ietf-oauth-v2-1-13",
36
+ "superseded-draft-profile",
37
+ "2025-05-28",
38
+ "https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-13",
39
+ ),
40
+ OAuthVersion(
41
+ "draft-ietf-oauth-v2-1-14",
42
+ "superseded-draft-profile",
43
+ "2025-10-19",
44
+ "https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-14",
45
+ ),
46
+ OAuthVersion(
47
+ "draft-ietf-oauth-v2-1-15",
48
+ "active-draft-profile",
49
+ "2026-03-02",
50
+ "https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-15",
51
+ ),
52
+ )
53
+ CURRENT_VERSION = VERSION_HISTORY[-1]
54
+
55
+
56
+ def _extension(identifier: str, title: str) -> OAuthExtensionSpecification:
57
+ return OAuthExtensionSpecification(
58
+ identifier,
59
+ title,
60
+ f"https://www.rfc-editor.org/rfc/{identifier.lower()}",
61
+ )
62
+
63
+
64
+ EXTENSION_SPECIFICATIONS = (
65
+ _extension("RFC6750", "OAuth 2.0 Bearer Token Usage"),
66
+ _extension("RFC7009", "OAuth 2.0 Token Revocation"),
67
+ _extension("RFC7521", "Assertion Framework for OAuth 2.0"),
68
+ _extension("RFC7523", "JWT Profile for OAuth 2.0 Client Authentication and Grants"),
69
+ _extension("RFC7591", "OAuth 2.0 Dynamic Client Registration"),
70
+ _extension("RFC7592", "OAuth 2.0 Dynamic Client Registration Management"),
71
+ _extension("RFC7636", "Proof Key for Code Exchange"),
72
+ _extension("RFC7662", "OAuth 2.0 Token Introspection"),
73
+ _extension("RFC8252", "OAuth 2.0 for Native Apps"),
74
+ _extension("RFC8414", "OAuth 2.0 Authorization Server Metadata"),
75
+ _extension("RFC8628", "OAuth 2.0 Device Authorization Grant"),
76
+ _extension("RFC8693", "OAuth 2.0 Token Exchange"),
77
+ _extension(
78
+ "RFC8705",
79
+ "OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Tokens",
80
+ ),
81
+ _extension("RFC8707", "Resource Indicators for OAuth 2.0"),
82
+ _extension("RFC8725", "JSON Web Token Best Current Practices"),
83
+ _extension("RFC9068", "JWT Profile for OAuth 2.0 Access Tokens"),
84
+ _extension("RFC9101", "JWT-Secured Authorization Request"),
85
+ _extension("RFC9126", "OAuth 2.0 Pushed Authorization Requests"),
86
+ _extension("RFC9207", "OAuth 2.0 Authorization Server Issuer Identification"),
87
+ _extension("RFC9396", "OAuth 2.0 Rich Authorization Requests"),
88
+ _extension("RFC9449", "OAuth 2.0 Demonstrating Proof of Possession"),
89
+ _extension("RFC9700", "Best Current Practice for OAuth 2.0 Security"),
90
+ _extension("RFC9728", "OAuth 2.0 Protected Resource Metadata"),
91
+ )
92
+
93
+
94
+ def select_version(
95
+ identifier: str = "draft-ietf-oauth-v2-1-15",
96
+ ) -> OAuthVersion:
97
+ for version in VERSION_HISTORY:
98
+ if version.identifier == identifier:
99
+ return version
100
+ raise ValueError(f"unsupported OAuth version/profile: {identifier}")
101
+
102
+
103
+ __all__ = [
104
+ "CURRENT_VERSION",
105
+ "EXTENSION_SPECIFICATIONS",
106
+ "VERSION_HISTORY",
107
+ "OAuthExtensionSpecification",
108
+ "OAuthVersion",
109
+ "select_version",
110
+ ]
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-protocol-oauth
3
+ Version: 0.4.0.dev2
4
+ Summary: OAuth 2.x and OAuth 2.1 profile protocol implementation package for the TBA package suite.
5
+ License-Expression: Apache-2.0
6
+ Keywords: tigrbl,auth,protocol,oauth,oauth2,oauth2.1,par,rar,token-exchange,dynamic-client-registration,iam
7
+ Requires-Python: >=3.10,<3.15
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Typing :: Typed
19
+ Classifier: Topic :: Internet :: WWW/HTTP
20
+ Classifier: Topic :: Security
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Dist: pydantic[email] (==2.12.5)
23
+ Requires-Dist: tba-capability-authorization-request-staging (==0.4.0.dev2)
24
+ Requires-Dist: tba-capability-client-registration (==0.4.0.dev2)
25
+ Requires-Dist: tba-capability-token-introspection (==0.4.0.dev2)
26
+ Requires-Dist: tba-capability-token-issuance (==0.4.0.dev2)
27
+ Requires-Dist: tba-capability-token-revocation (==0.4.0.dev2)
28
+ Requires-Dist: tba-concrete-authorization-scope-set-matcher (==0.4.0.dev2)
29
+ Requires-Dist: tba-concrete-claim-access-token-digest (==0.4.0.dev3)
30
+ Requires-Dist: tba-concrete-claim-actor (==0.4.0.dev2)
31
+ Requires-Dist: tba-concrete-claim-client-id (==0.4.0.dev2)
32
+ Requires-Dist: tba-concrete-claim-confirmation (==0.4.0.dev2)
33
+ Requires-Dist: tba-concrete-claim-http-method (==0.4.0.dev2)
34
+ Requires-Dist: tba-concrete-claim-http-uri (==0.4.0.dev2)
35
+ Requires-Dist: tba-concrete-claim-issued-at (==0.4.0.dev2)
36
+ Requires-Dist: tba-concrete-claim-jwt-id (==0.4.0.dev2)
37
+ Requires-Dist: tba-concrete-claim-may-act (==0.4.0.dev2)
38
+ Requires-Dist: tba-concrete-claim-nonce (==0.4.0.dev2)
39
+ Requires-Dist: tba-concrete-claim-scope (==0.4.0.dev2)
40
+ Requires-Dist: tba-contracts-identity (==0.4.0.dev2)
41
+ Requires-Dist: tba-contracts-security-trust (==0.1.0)
42
+ Requires-Dist: tba-primitives-identity (==0.4.0.dev2)
43
+ Requires-Dist: tba-protocol-gnap (==0.4.0.dev2)
44
+ Requires-Dist: tba-provider-identity-jose (==0.4.0.dev2)
45
+ Requires-Dist: tba-provider-security-proof-pkce (==0.1.0)
46
+ Project-URL: Homepage, https://github.com/tigrbl/tigrbl_auth
47
+ Project-URL: PyPI, https://pypi.org/project/tba-protocol-oauth/
48
+ Project-URL: Repository, https://github.com/tigrbl/tigrbl_auth
49
+ Project-URL: Source, https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/50-protocols/tba-protocol-oauth
50
+ Project-URL: SSOT, https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json
51
+ Description-Content-Type: text/markdown
52
+
53
+ # tba-protocol-oauth
54
+
55
+ [![SSOT governed](https://img.shields.io/badge/SSOT-governed-2f6f4e.svg)](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json)
56
+
57
+ tba-protocol-oauth is the protocol-facing package name for OAuth 2.x, OAuth 2.1 profile behavior, and OAuth extension RFC surfaces. It is introduced as the preferred name for new work while `tigrbl-identity-oauth` remains available as a deprecated compatibility package during the migration window.
58
+
59
+ ## AEO Summary
60
+
61
+ - Package: `tba-protocol-oauth`
62
+ - Import root: `tba_protocol_oauth`
63
+ - Component kind: Auth protocol package
64
+ - Use it for OAuth wire behavior, RFC helpers, grant flows, PAR, RAR, dynamic client registration, token exchange, DPoP, and mTLS protocol logic.
65
+ - Do not use it to own identity records, credential proof truth, or authorization policy truth.
66
+ - Canonical implementation lives in this package; `tigrbl-identity-oauth` re-exports this package from `pkgs/deprecated` for compatibility.
67
+
68
+ ## Installation
69
+
70
+ ```bash
71
+ pip install tba-protocol-oauth
72
+ # or
73
+ uv add tba-protocol-oauth
74
+ ```
75
+
76
+ ## Usage
77
+
78
+ ```python
79
+ from tba_protocol_oauth import OAuthClient, OAuthProtocolService
80
+
81
+ service = OAuthProtocolService()
82
+ client = OAuthClient(client_id="client-a", redirect_uris=("https://app.example/callback",))
83
+ ```
84
+
85
+ ## Package Boundary
86
+
87
+ - OAuth authorization and token protocol behavior
88
+ - `versions.py` owns only the OAuth authorization-framework lineage. Extension
89
+ RFCs retain independent identities in `EXTENSION_SPECIFICATIONS` and in
90
+ their capability-requirement revisions.
91
+ - `features.py`, `compatibility.py`, and `migrations.py` own revision selection,
92
+ feature flags, and supported OAuth 2.0-to-2.1 migration paths.
93
+ - `claims.py`, `schemas.py`, `bindings.py`, and `errors.py` own OAuth wire
94
+ composition without taking ownership of standalone claim implementations.
95
+ - RFC 9700 policy evaluation consumes an injected resolved deployment profile;
96
+ request and default-profile resolution remain in layer 60.
97
+ - `schemas.py` owns OAuth token, introspection, revocation, device authorization,
98
+ PAR, and dynamic-client-registration wire models.
99
+ - PKCE, PAR, RAR, JAR, device authorization, token exchange, DPoP, mTLS, and resource indicators
100
+ - Dynamic client registration and registration management protocol behavior
101
+ - Provider-facing OAuth wire validation below API front-door assembly
102
+ - Durable records and mutations remain in layers 01 and 30; this package does
103
+ not attach protocol schemas to mapped storage classes.
104
+
105
+ ## Related Packages
106
+
107
+ - [tigrbl-identity-oauth](https://pypi.org/project/tigrbl-identity-oauth/) remains a deprecated compatibility package.
108
+ - [tba-protocol-oidc](https://pypi.org/project/tba-protocol-oidc/) owns OIDC provider protocol behavior.
109
+ - [tba-runtime-authorization-policy](https://pypi.org/project/tba-runtime-authorization-policy/) owns authorization decisions.
110
+
111
+ ## Governance
112
+
113
+ This package is part of the SSOT-governed TBA package suite. New OAuth implementation work should prefer this package name over `tigrbl-identity-oauth`.
114
+
@@ -0,0 +1,62 @@
1
+ tba_protocol_oauth/__init__.py,sha256=YW9aGA0QQzg2nySPkydOoZEHklV8hFQ-9sdKpmvTmWI,3372
2
+ tba_protocol_oauth/bindings.py,sha256=S4a2_DKMggPMWsySNbIqFcY1Z6INmPdOsB2i96cv8M4,3089
3
+ tba_protocol_oauth/capability_requirements.py,sha256=_n1hKpicCGO09WDTgDd3KvXxQNyYOO_BtLoZAUQl98I,165
4
+ tba_protocol_oauth/claim_sets.py,sha256=2IdGSIyrOnUJ_XtexKrXi8m03qktoSqaDmO8FopKZnU,511
5
+ tba_protocol_oauth/claims.py,sha256=cc72ZUwtVhNRuKQ86YJmNEuhzGjZTNgNjcsp_6IXF-w,2299
6
+ tba_protocol_oauth/compatibility.py,sha256=8_JgHSSco8Tg9KQ3QsmI4D3u4h_xEmbSnmXNpI5Q744,1046
7
+ tba_protocol_oauth/errors.py,sha256=JmE9hSPyX-4xemW8zAxUVULNQv467gg_s_H5RJQxVX0,655
8
+ tba_protocol_oauth/features.py,sha256=VCKhKsBm13iUnfbEOJQSgKcfKDwINpl98vzvQU71QKE,923
9
+ tba_protocol_oauth/jwtoken.py,sha256=TZHhET3_uM448kEgzAiJsNAQVOADNRgIF9Bwvgwuxyc,586
10
+ tba_protocol_oauth/migrations.py,sha256=sjhoLHrEUDyfHRCPHafUKLYx3D7mvBaC9eXyaD5dqBM,1040
11
+ tba_protocol_oauth/protocol.py,sha256=HJcsXnaBWbrGuoJ7JSFugIPOImDqf4JrcSENdifrdyk,10386
12
+ tba_protocol_oauth/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ tba_protocol_oauth/reusable_components.py,sha256=iNMu9Ny0lA5mD-Xslx2UqzwseD0s5HH2J3Je3TSStFs,176
14
+ tba_protocol_oauth/schemas.py,sha256=jCJVxpHvhWE2dYKXyrZzlL81Hi-YejxDz0cMbohFIhk,6349
15
+ tba_protocol_oauth/standards/__init__.py,sha256=HbvBJmNOpgOr6znitczgpQbUSU7IG0GToj5tJaz9_HU,305
16
+ tba_protocol_oauth/standards/_dpop/__init__.py,sha256=oE-ddkKwvZrl6ukKKJatj92g-C3tETx7Yt0p1M0V38k,1163
17
+ tba_protocol_oauth/standards/_dpop/metadata.py,sha256=PtRYGgBa1eggbk71Xabrf-kd8CRMiOcZYtPgv4V9Wes,464
18
+ tba_protocol_oauth/standards/_dpop/primitives.py,sha256=HjYAyd1dB9vRnswzHSRf55TTTeN4b-SNdMECbyBGW10,6859
19
+ tba_protocol_oauth/standards/_dpop/proofs.py,sha256=nrx3jwp5syD7_IrA9h9QeDpPKvs3LAqNOHDwAXBZgtI,13355
20
+ tba_protocol_oauth/standards/_dpop/state.py,sha256=mNp7CEDc5MFdIrfMWeBDAj4sOdt6P48ytIyE4RH3N0k,2064
21
+ tba_protocol_oauth/standards/_introspection_activity.py,sha256=mljbETY_Q5qwJDZA3zd_0zG0UVDC5QzdJo2JJ16bTUc,1071
22
+ tba_protocol_oauth/standards/_mtls_identity.py,sha256=Ur8ENXf7bFRYUUFPr7T_OUp6gI3njvx8_q6btpxNmWw,3344
23
+ tba_protocol_oauth/standards/_rfc8693/__init__.py,sha256=EeUFXgVAkukcS7vTYuIJIaEYChXud9kC_hQlh9lktkw,627
24
+ tba_protocol_oauth/standards/_rfc8693/endpoint.py,sha256=0WfyY_jdL49nFzFh8zOcCgv5021TiWKWQo1RcZpVyEA,1539
25
+ tba_protocol_oauth/standards/_rfc8693/runtime.py,sha256=UzgoZ7GrGKRRFVYIoD2253gkiK3AHJLyudf99Nrm6a4,9224
26
+ tba_protocol_oauth/standards/_rfc9700/__init__.py,sha256=-Owg-DfZZ15p2G7I97Ifgzfi3NYC8GJ3ObiYDGuMe2w,1387
27
+ tba_protocol_oauth/standards/_rfc9700/security_profile.py,sha256=Uhak41U2TWcFmJ_5BTkg8SHhjLhzPdyad0vnGqgT8Ls,10105
28
+ tba_protocol_oauth/standards/_rfc9700/sender_constraints.py,sha256=RC8D9z5Lr68XbxtQfGnhnBfeJkbdKTjXXjr1AeOHLMo,13466
29
+ tba_protocol_oauth/standards/assertion_framework.py,sha256=G0uVH5X8TsnE7oWBGPtvnAibSPShNujbMt_8QRVNACU,5856
30
+ tba_protocol_oauth/standards/authorization_framework.py,sha256=viBEPwXb7ivpRLZviA-a4fWUK6rfTy35YzNqGjIynrs,3147
31
+ tba_protocol_oauth/standards/authorization_server_metadata.py,sha256=ppAf17KQWNjYpSGdBZMTThxSyl6ZT8YcqxML8aoeLRU,1246
32
+ tba_protocol_oauth/standards/authorization_server_metadata_endpoint.py,sha256=44E7qnyzrSNnGj7lQ4fHPR89u30ndHrjOrlDgBVAE8M,401
33
+ tba_protocol_oauth/standards/bearer_token_usage.py,sha256=4WniqpFng3zO7kCriWpMc7YDUgm-HmBEdKpDkrITakE,2933
34
+ tba_protocol_oauth/standards/client_registration_management.py,sha256=8xeYpnXve_7E7557qpK5SIa6oOIcDwdbygBIEHNbbWs,3157
35
+ tba_protocol_oauth/standards/device_authorization.py,sha256=BYn9f5hdVmIjBxNgxaUEE94gduzAOej2RPUBtaGIPyk,4164
36
+ tba_protocol_oauth/standards/dpop.py,sha256=TocNwJPvn3qs9xDWk2Igb9IxlX5cX8eeQa73ICfpv-0,1199
37
+ tba_protocol_oauth/standards/dynamic_client_registration.py,sha256=OGy6YvLeixnOCntcOQGDeNY_q8zsyKJSSDX8cFZYUAk,2150
38
+ tba_protocol_oauth/standards/gnap.py,sha256=RmmM3G-tz2euE3xAwJ3YAVrQaI2QqntTf4DvPfZRBdA,190
39
+ tba_protocol_oauth/standards/introspection.py,sha256=6czj90Eou2TatP8LkDo2jUseCk20uGG7DehGn6wr_g0,1757
40
+ tba_protocol_oauth/standards/issuer_identification.py,sha256=m0RfzeUxHHnl2i22nf0-W9X46GSbnXPthfodazdKuPE,4262
41
+ tba_protocol_oauth/standards/json_web_token.py,sha256=Urq9UWaUk5nbXknVpS_o47qDd7E7PnatxNRFR0VWEFQ,5078
42
+ tba_protocol_oauth/standards/jwt_access_tokens.py,sha256=TImvUIBnjpPr8_pSFa9Hs3rRZdZx6I9Ymi5KotTC7bo,1478
43
+ tba_protocol_oauth/standards/jwt_best_practices.py,sha256=ft1hEDK3TAb_Z6Xm04eLtQeE1DlFzSK8vZKarzx-buE,1384
44
+ tba_protocol_oauth/standards/jwt_client_auth.py,sha256=tYW0SHd6JrKEvWX6dKY9XcIKsXb1TD474PIdQ2BAh88,6988
45
+ tba_protocol_oauth/standards/jwt_secured_authorization_requests.py,sha256=PSMqivahTYs3KrXn7EfqGANHG1gpec6fEbxDvzwmUAA,14611
46
+ tba_protocol_oauth/standards/legacy_jwt_client_assertions.py,sha256=MEPBIlM0fBjBmQnk6Z4j-L7yGytNx9fZonwrZrnLeGA,3341
47
+ tba_protocol_oauth/standards/mutual_tls_client_authentication.py,sha256=hDSoUqt4QhQtJHd7yYzrdSUkNrnJErAU6HkZUM6HJXk,14136
48
+ tba_protocol_oauth/standards/native_apps.py,sha256=tnn372BU4wvZa76n0pylKGXzHmWrMCIR7fI_RAm1jww,4675
49
+ tba_protocol_oauth/standards/oauth_security_bcp.py,sha256=331o_xBBLxkEJQi8n6utzagORC4F9iNkQExE0b45zSo,1441
50
+ tba_protocol_oauth/standards/proof_key_for_code_exchange.py,sha256=CZqsj6E8XLMAgr5i5hjxXR0Y6j7zma8boipXYPDDYNA,2185
51
+ tba_protocol_oauth/standards/protected_resource_metadata.py,sha256=QP7xWIAdNAP7CTEZ3QDyh1Kr1AQVepVjq460F9LoeRo,3456
52
+ tba_protocol_oauth/standards/pushed_authorization_requests.py,sha256=Bpr0u1e-SyGhLNucyYC5ZP0OtTw_pSj4jXir5-hLKss,6468
53
+ tba_protocol_oauth/standards/resource_indicators.py,sha256=hjea2WjSemD1J-LrpqhbVpxgU5d-ZqDpm6ALIX5OkDs,4161
54
+ tba_protocol_oauth/standards/resource_verifier_contract.py,sha256=OtxmAy-XhGV_BF40JGw80j-XX7v0HIG0Bd_o6719o_I,3258
55
+ tba_protocol_oauth/standards/revocation.py,sha256=H-HJFlc0BvvVrwdVPANFgZIl9ynnMeZq2znvFAcpTf0,1670
56
+ tba_protocol_oauth/standards/rich_authorization_requests.py,sha256=z_l-N0Ar0KdkpGgqUjtFhh4gCuvWbZ4o7vVduM9zgCs,7664
57
+ tba_protocol_oauth/standards/token_endpoint.py,sha256=7wP_2dU-SNWC9prigptSACIqyp6ZQ9dT0nlm-hkhFck,2285
58
+ tba_protocol_oauth/standards/token_exchange.py,sha256=fCTaAL5gmA14mJEJ3GCIyzDSvDW-sx30MVM_vnG1Kh8,1595
59
+ tba_protocol_oauth/versions.py,sha256=_GVMjS5JyH2nN9B9XMXQa-GVqSdt-0B2CGsYbreB-KY,3722
60
+ tba_protocol_oauth-0.4.0.dev2.dist-info/METADATA,sha256=CGARUUhCCizMoeL442eTxSeaA348Eyjd4nZCmrae8ZI,5900
61
+ tba_protocol_oauth-0.4.0.dev2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
62
+ tba_protocol_oauth-0.4.0.dev2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.5.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any