tba-bases-token-introspection 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.
- tba_bases_token_introspection-0.4.0.dev2/PKG-INFO +19 -0
- tba_bases_token_introspection-0.4.0.dev2/README.md +3 -0
- tba_bases_token_introspection-0.4.0.dev2/pyproject.toml +13 -0
- tba_bases_token_introspection-0.4.0.dev2/src/tba_bases_token_introspection/__init__.py +43 -0
- tba_bases_token_introspection-0.4.0.dev2/src/tba_bases_token_introspection/py.typed +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tba-bases-token-introspection
|
|
3
|
+
Version: 0.4.0.dev2
|
|
4
|
+
Summary: Reusable token introspection and verification-key cache bases.
|
|
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-contracts-security-trust (==0.1.0)
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# tba-bases-token-introspection
|
|
17
|
+
|
|
18
|
+
Reusable token introspection and verification-key resolution behavior.
|
|
19
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tba-bases-token-introspection"
|
|
3
|
+
version = "0.4.0.dev2"
|
|
4
|
+
description = "Reusable token introspection and verification-key cache bases."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10,<3.15"
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
dependencies = ["tba-contracts-security-trust==0.1.0"]
|
|
9
|
+
[build-system]
|
|
10
|
+
requires = ["poetry-core>=1.0.0"]
|
|
11
|
+
build-backend = "poetry.core.masonry.api"
|
|
12
|
+
[tool.poetry]
|
|
13
|
+
packages = [{ include = "tba_bases_token_introspection", from = "src" }]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""Reusable token-introspection and key-cache bases."""
|
|
2
|
+
|
|
3
|
+
from abc import ABC
|
|
4
|
+
from typing import Any, Mapping
|
|
5
|
+
|
|
6
|
+
from tba_contracts_security_trust import (
|
|
7
|
+
ICapabilityProvider,
|
|
8
|
+
ITokenIntrospectionClient,
|
|
9
|
+
IVerificationKeyCache,
|
|
10
|
+
IVerificationKeyResolver,
|
|
11
|
+
TokenIntrospectionRequest,
|
|
12
|
+
TokenIntrospectionResult,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class VerificationKeyResolverBase(IVerificationKeyResolver, ICapabilityProvider, ABC):
|
|
17
|
+
def get(self, key_id: str) -> Mapping[str, Any]:
|
|
18
|
+
raise NotImplementedError
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class VerificationKeyCacheBase(IVerificationKeyCache, VerificationKeyResolverBase):
|
|
22
|
+
@property
|
|
23
|
+
def keys(self) -> Mapping[str, Mapping[str, Any]]:
|
|
24
|
+
raise NotImplementedError
|
|
25
|
+
|
|
26
|
+
def put(self, key_id: str, key: Mapping[str, Any]) -> None:
|
|
27
|
+
raise NotImplementedError
|
|
28
|
+
|
|
29
|
+
def put_many(self, keys: Mapping[str, Mapping[str, Any]]) -> None:
|
|
30
|
+
for key_id, key in keys.items():
|
|
31
|
+
self.put(key_id, key)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TokenIntrospectionClientBase(ITokenIntrospectionClient, ICapabilityProvider, ABC):
|
|
35
|
+
def introspect(self, request: TokenIntrospectionRequest) -> TokenIntrospectionResult:
|
|
36
|
+
raise NotImplementedError
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
__all__ = [
|
|
40
|
+
"TokenIntrospectionClientBase",
|
|
41
|
+
"VerificationKeyCacheBase",
|
|
42
|
+
"VerificationKeyResolverBase",
|
|
43
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|