tba-storage-did 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.
- tba_storage_did/__init__.py +7 -0
- tba_storage_did/component.toml +41 -0
- tba_storage_did/manifest.py +9 -0
- tba_storage_did/migrations/__init__.py +0 -0
- tba_storage_did/migrations/versions/7900a065_d6b7_5f37_aab2_8083fafb462e_initial_schema.py +23 -0
- tba_storage_did/migrations/versions/__init__.py +0 -0
- tba_storage_did/py.typed +0 -0
- tba_storage_did/tables/__init__.py +16 -0
- tba_storage_did/tables/did_gnap_state.py +49 -0
- tba_storage_did-0.4.0.dev2.dist-info/METADATA +22 -0
- tba_storage_did-0.4.0.dev2.dist-info/RECORD +12 -0
- tba_storage_did-0.4.0.dev2.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""Standalone identity storage component."""
|
|
2
|
+
|
|
3
|
+
from .manifest import MANIFEST, load_manifest
|
|
4
|
+
from .tables import * # noqa: F401,F403
|
|
5
|
+
from .tables import TABLE_MODEL_BY_NAME, TABLE_MODEL_BY_TABLENAME, TABLE_MODELS
|
|
6
|
+
|
|
7
|
+
__all__ = ["MANIFEST", "load_manifest", "TABLE_MODELS", "TABLE_MODEL_BY_NAME", "TABLE_MODEL_BY_TABLENAME"] + [model.__name__ for model in TABLE_MODELS]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
manifest_version = "1.0.0"
|
|
2
|
+
|
|
3
|
+
[component]
|
|
4
|
+
id = "tigrbl.identity.storage.did"
|
|
5
|
+
distribution = "tba-storage-did"
|
|
6
|
+
import_root = "tba_storage_did"
|
|
7
|
+
|
|
8
|
+
[schema]
|
|
9
|
+
contract = "1.0.0"
|
|
10
|
+
migration_head = "7900a065-d6b7-5f37-aab2-8083fafb462e"
|
|
11
|
+
migrations_package = "tba_storage_did.migrations.versions"
|
|
12
|
+
|
|
13
|
+
[[schema.objects]]
|
|
14
|
+
id = "tigrbl.identity.storage.did:table:did_documents"
|
|
15
|
+
kind = "table"
|
|
16
|
+
physical_name = "authn.did_documents"
|
|
17
|
+
model = "tba_storage_did.tables:DidDocument"
|
|
18
|
+
|
|
19
|
+
[[schema.objects]]
|
|
20
|
+
id = "tigrbl.identity.storage.did:table:did_document_versions"
|
|
21
|
+
kind = "table"
|
|
22
|
+
physical_name = "authn.did_document_versions"
|
|
23
|
+
model = "tba_storage_did.tables:DidDocumentVersion"
|
|
24
|
+
|
|
25
|
+
[[schema.objects]]
|
|
26
|
+
id = "tigrbl.identity.storage.did:table:did_verification_methods"
|
|
27
|
+
kind = "table"
|
|
28
|
+
physical_name = "authn.did_verification_methods"
|
|
29
|
+
model = "tba_storage_did.tables:DidVerificationMethod"
|
|
30
|
+
|
|
31
|
+
[[schema.objects]]
|
|
32
|
+
id = "tigrbl.identity.storage.did:table:did_services"
|
|
33
|
+
kind = "table"
|
|
34
|
+
physical_name = "authn.did_services"
|
|
35
|
+
model = "tba_storage_did.tables:DidService"
|
|
36
|
+
|
|
37
|
+
[[schema.objects]]
|
|
38
|
+
id = "tigrbl.identity.storage.did:table:did_resolution_cache"
|
|
39
|
+
kind = "table"
|
|
40
|
+
physical_name = "authn.did_resolution_cache"
|
|
41
|
+
model = "tba_storage_did.tables:DidResolutionCache"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""Installed component manifest access."""
|
|
2
|
+
from importlib.resources import as_file, files
|
|
3
|
+
from tigrbl_migrations import StorageManifest
|
|
4
|
+
|
|
5
|
+
def load_manifest() -> StorageManifest:
|
|
6
|
+
with as_file(files(__package__).joinpath("component.toml")) as path:
|
|
7
|
+
return StorageManifest.from_toml(path)
|
|
8
|
+
|
|
9
|
+
MANIFEST = load_manifest()
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Initial owned schema for tigrbl.identity.storage.did."""
|
|
2
|
+
from tigrbl_migrations import Migration
|
|
3
|
+
from tba_storage_did.tables import TABLE_MODELS
|
|
4
|
+
|
|
5
|
+
REVISION = "7900a065-d6b7-5f37-aab2-8083fafb462e"
|
|
6
|
+
|
|
7
|
+
def upgrade(connection):
|
|
8
|
+
for model in TABLE_MODELS:
|
|
9
|
+
model.__table__.create(bind=connection, checkfirst=True)
|
|
10
|
+
|
|
11
|
+
def downgrade(connection):
|
|
12
|
+
for model in reversed(TABLE_MODELS):
|
|
13
|
+
model.__table__.drop(bind=connection, checkfirst=True)
|
|
14
|
+
|
|
15
|
+
MIGRATION = Migration(
|
|
16
|
+
component="tigrbl.identity.storage.did",
|
|
17
|
+
revision=REVISION,
|
|
18
|
+
parents=(),
|
|
19
|
+
kind="standard",
|
|
20
|
+
reversible=True,
|
|
21
|
+
upgrade=upgrade,
|
|
22
|
+
downgrade=downgrade,
|
|
23
|
+
)
|
|
File without changes
|
tba_storage_did/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Owned mapped-table inventory."""
|
|
2
|
+
|
|
3
|
+
from .did_gnap_state import DidDocument, DidDocumentVersion, DidVerificationMethod, DidService, DidResolutionCache
|
|
4
|
+
|
|
5
|
+
TABLE_MODELS = (
|
|
6
|
+
DidDocument,
|
|
7
|
+
DidDocumentVersion,
|
|
8
|
+
DidVerificationMethod,
|
|
9
|
+
DidService,
|
|
10
|
+
DidResolutionCache,
|
|
11
|
+
)
|
|
12
|
+
TABLE_MODEL_BY_NAME = {model.__name__: model for model in TABLE_MODELS}
|
|
13
|
+
TABLE_MODEL_BY_TABLENAME = {model.__tablename__: model for model in TABLE_MODELS}
|
|
14
|
+
__all__ = [model.__name__ for model in TABLE_MODELS] + [
|
|
15
|
+
"TABLE_MODELS", "TABLE_MODEL_BY_NAME", "TABLE_MODEL_BY_TABLENAME",
|
|
16
|
+
]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ruff: noqa: F401
|
|
2
|
+
"""Optional durable DID authority/cache and GNAP transaction state."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
import datetime as dt
|
|
5
|
+
from tba_primitives_identity.orm import Boolean, GUIDPk, JSON, Mapped, RestOltpTable, S, String, TZDateTime, Timestamped, acol
|
|
6
|
+
|
|
7
|
+
class DidDocument(RestOltpTable, GUIDPk, Timestamped):
|
|
8
|
+
__tablename__ = 'did_documents'
|
|
9
|
+
__table_args__ = ({'schema': 'authn'},)
|
|
10
|
+
did: Mapped[str] = acol(storage=S(String(1000), nullable=False, unique=True, index=True))
|
|
11
|
+
method: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
12
|
+
authoritative: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=False, index=True))
|
|
13
|
+
current_version: Mapped[str | None] = acol(storage=S(String(128), nullable=True, index=True))
|
|
14
|
+
|
|
15
|
+
class DidDocumentVersion(RestOltpTable, GUIDPk, Timestamped):
|
|
16
|
+
__tablename__ = 'did_document_versions'
|
|
17
|
+
__table_args__ = ({'schema': 'authn'},)
|
|
18
|
+
did: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
19
|
+
version: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
|
|
20
|
+
document: Mapped[dict] = acol(storage=S(JSON, nullable=False))
|
|
21
|
+
document_digest: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
|
|
22
|
+
valid_until: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True, index=True))
|
|
23
|
+
|
|
24
|
+
class DidVerificationMethod(RestOltpTable, GUIDPk, Timestamped):
|
|
25
|
+
__tablename__ = 'did_verification_methods'
|
|
26
|
+
__table_args__ = ({'schema': 'authn'},)
|
|
27
|
+
did: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
28
|
+
method_id: Mapped[str] = acol(storage=S(String(1000), nullable=False, unique=True, index=True))
|
|
29
|
+
method_type: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
30
|
+
controller: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
31
|
+
public_key: Mapped[dict] = acol(storage=S(JSON, nullable=False))
|
|
32
|
+
relationships: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
33
|
+
|
|
34
|
+
class DidService(RestOltpTable, GUIDPk, Timestamped):
|
|
35
|
+
__tablename__ = 'did_services'
|
|
36
|
+
__table_args__ = ({'schema': 'authn'},)
|
|
37
|
+
did: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
38
|
+
service_id: Mapped[str] = acol(storage=S(String(1000), nullable=False, unique=True, index=True))
|
|
39
|
+
service_type: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
40
|
+
endpoint: Mapped[dict | list | str] = acol(storage=S(JSON, nullable=False))
|
|
41
|
+
|
|
42
|
+
class DidResolutionCache(RestOltpTable, GUIDPk, Timestamped):
|
|
43
|
+
__tablename__ = 'did_resolution_cache'
|
|
44
|
+
__table_args__ = ({'schema': 'authn'},)
|
|
45
|
+
did_url: Mapped[str] = acol(storage=S(String(1000), nullable=False, unique=True, index=True))
|
|
46
|
+
result_digest: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
|
|
47
|
+
result: Mapped[dict] = acol(storage=S(JSON, nullable=False))
|
|
48
|
+
resolved_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True, index=True))
|
|
49
|
+
expires_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True, index=True))
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tba-storage-did
|
|
3
|
+
Version: 0.4.0.dev2
|
|
4
|
+
Summary: Owned did identity database tables and migrations.
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.10,<3.15
|
|
7
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Requires-Dist: tba-primitives-identity[storage] (>=0.4.0.dev2)
|
|
15
|
+
Requires-Dist: tigrbl (>=0.4.4.dev1,<0.5)
|
|
16
|
+
Requires-Dist: tigrbl-migrations (>=0.4.5.dev4)
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# tba-storage-did
|
|
20
|
+
|
|
21
|
+
Owns the `tigrbl.identity.storage.did` schema component.
|
|
22
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
tba_storage_did/__init__.py,sha256=HoJ8HOyxQOG9vvo4LEJPfEUW3IDGqZF6ZIgJQ59tK6Q,366
|
|
2
|
+
tba_storage_did/component.toml,sha256=64ovwSiB1JFFtS1w6Vd_PCH3YTi_0ygU3ICb49ZQRe4,1222
|
|
3
|
+
tba_storage_did/manifest.py,sha256=bYZmb6ItB8bRxtuCspB1us5eTvB1RqlTedISJZbws_w,325
|
|
4
|
+
tba_storage_did/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
tba_storage_did/migrations/versions/7900a065_d6b7_5f37_aab2_8083fafb462e_initial_schema.py,sha256=a2pR8INM7COpLZTFrx_taScKqWCvTZdypLROtopRBIk,651
|
|
6
|
+
tba_storage_did/migrations/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
tba_storage_did/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
tba_storage_did/tables/__init__.py,sha256=arQtT9R1XjC66QyYl-zQH1yHk25XTZMZg3_JCRWZViE,564
|
|
9
|
+
tba_storage_did/tables/did_gnap_state.py,sha256=QDl7SpE7eMqYMuDKCawwTHUDvJuvC61oiicXsHUp0I8,3112
|
|
10
|
+
tba_storage_did-0.4.0.dev2.dist-info/METADATA,sha256=nayJKNyX3iRn8wqVXWeBkUAIHfj2KBNL7dcKhXu-fGA,811
|
|
11
|
+
tba_storage_did-0.4.0.dev2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
12
|
+
tba_storage_did-0.4.0.dev2.dist-info/RECORD,,
|