tba-storage-claims 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.
@@ -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,46 @@
1
+ manifest_version = "1.0.0"
2
+
3
+ [component]
4
+ id = "tigrbl.identity.storage.claims"
5
+ distribution = "tba-storage-claims"
6
+ import_root = "tba_storage_claims"
7
+
8
+ [schema]
9
+ contract = "1.0.0"
10
+ migration_head = "6b5acf6a-8d14-51f3-af78-0534d36dac44"
11
+ migrations_package = "tba_storage_claims.migrations.versions"
12
+
13
+ [[schema.objects]]
14
+ id = "tigrbl.identity.storage.claims:table:claim_definitions"
15
+ kind = "table"
16
+ physical_name = "authn.claim_definitions"
17
+ model = "tba_storage_claims.tables:ClaimDefinition"
18
+
19
+ [[schema.objects]]
20
+ id = "tigrbl.identity.storage.claims:table:claim_source_bindings"
21
+ kind = "table"
22
+ physical_name = "authn.claim_source_bindings"
23
+ model = "tba_storage_claims.tables:ClaimSourceBinding"
24
+
25
+ [[schema.objects]]
26
+ id = "tigrbl.identity.storage.claims:table:claim_release_policies"
27
+ kind = "table"
28
+ physical_name = "authn.claim_release_policies"
29
+ model = "tba_storage_claims.tables:ClaimReleasePolicy"
30
+
31
+ [[schema.objects]]
32
+ id = "tigrbl.identity.storage.claims:table:claim_provenance_records"
33
+ kind = "table"
34
+ physical_name = "authn.claim_provenance_records"
35
+ model = "tba_storage_claims.tables:ClaimProvenanceRecord"
36
+
37
+ [[schema.objects]]
38
+ id = "tigrbl.identity.storage.claims:table:claim_snapshots"
39
+ kind = "table"
40
+ physical_name = "authn.claim_snapshots"
41
+ model = "tba_storage_claims.tables:ClaimSnapshot"
42
+
43
+ [[schema.requires]]
44
+ component = "tigrbl.identity.storage.tenancy"
45
+ contract = ">=1.0.0,<2.0.0"
46
+ minimum_revision = "69854e73-52d3-53ec-9542-6737159e42d6"
@@ -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.claims."""
2
+ from tigrbl_migrations import Migration
3
+ from tba_storage_claims.tables import TABLE_MODELS
4
+
5
+ REVISION = "6b5acf6a-8d14-51f3-af78-0534d36dac44"
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.claims",
17
+ revision=REVISION,
18
+ parents=(),
19
+ kind="standard",
20
+ reversible=True,
21
+ upgrade=upgrade,
22
+ downgrade=downgrade,
23
+ )
File without changes
File without changes
@@ -0,0 +1,16 @@
1
+ """Owned mapped-table inventory."""
2
+
3
+ from .claim_state import ClaimDefinition, ClaimSourceBinding, ClaimReleasePolicy, ClaimProvenanceRecord, ClaimSnapshot
4
+
5
+ TABLE_MODELS = (
6
+ ClaimDefinition,
7
+ ClaimSourceBinding,
8
+ ClaimReleasePolicy,
9
+ ClaimProvenanceRecord,
10
+ ClaimSnapshot,
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,98 @@
1
+ """Durable tenant-defined claim metadata, policy, and provenance.
2
+
3
+ Standard claim semantics remain code-owned. These tables exist for private
4
+ claim registration, source binding, release policy, and protected snapshots.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import datetime as dt
10
+
11
+ from tba_primitives_identity.orm import (
12
+ Boolean,
13
+ GUIDPk,
14
+ JSON,
15
+ Mapped,
16
+ RestOltpTable,
17
+ S,
18
+ String,
19
+ TZDateTime,
20
+ TenantColumn,
21
+ Timestamped,
22
+ acol,
23
+ )
24
+
25
+
26
+ class ClaimDefinition(RestOltpTable, GUIDPk, Timestamped, TenantColumn):
27
+ __tablename__ = "claim_definitions"
28
+ __table_args__ = ({"schema": "authn"},)
29
+
30
+ label: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
31
+ label_kind: Mapped[str] = acol(storage=S(String(32), nullable=False, index=True))
32
+ namespace: Mapped[str | None] = acol(storage=S(String(1000), nullable=True, index=True))
33
+ registry: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
34
+ semantic_type: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
35
+ value_type: Mapped[str] = acol(storage=S(String(64), nullable=False))
36
+ standards: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
37
+ active: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=True, index=True))
38
+
39
+
40
+ class ClaimSourceBinding(RestOltpTable, GUIDPk, Timestamped, TenantColumn):
41
+ __tablename__ = "claim_source_bindings"
42
+ __table_args__ = ({"schema": "authn"},)
43
+
44
+ claim_definition_id: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
45
+ source_kind: Mapped[str] = acol(storage=S(String(32), nullable=False, index=True))
46
+ provider_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
47
+ source_path: Mapped[str | None] = acol(storage=S(String(1000), nullable=True))
48
+ transformation: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
49
+ active: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=True, index=True))
50
+
51
+
52
+ class ClaimReleasePolicy(RestOltpTable, GUIDPk, Timestamped, TenantColumn):
53
+ __tablename__ = "claim_release_policies"
54
+ __table_args__ = ({"schema": "authn"},)
55
+
56
+ claim_definition_id: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
57
+ audience_pattern: Mapped[str | None] = acol(storage=S(String(1000), nullable=True, index=True))
58
+ protocol_tag: Mapped[str | None] = acol(storage=S(String(64), nullable=True, index=True))
59
+ disclosure_mode: Mapped[str] = acol(storage=S(String(32), nullable=False, index=True))
60
+ purpose: Mapped[str | None] = acol(storage=S(String(1000), nullable=True))
61
+ conditions: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
62
+ active: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=True, index=True))
63
+
64
+
65
+ class ClaimProvenanceRecord(RestOltpTable, GUIDPk, Timestamped, TenantColumn):
66
+ __tablename__ = "claim_provenance_records"
67
+ __table_args__ = ({"schema": "authn"},)
68
+
69
+ claim_label: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
70
+ namespace: Mapped[str | None] = acol(storage=S(String(1000), nullable=True, index=True))
71
+ subject_reference: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
72
+ source_kind: Mapped[str] = acol(storage=S(String(32), nullable=False, index=True))
73
+ source_reference: Mapped[str | None] = acol(storage=S(String(1000), nullable=True))
74
+ evidence_reference: Mapped[str | None] = acol(storage=S(String(1000), nullable=True))
75
+ value_digest: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
76
+ verified_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True, index=True))
77
+ assurance_framework: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
78
+
79
+
80
+ class ClaimSnapshot(RestOltpTable, GUIDPk, Timestamped, TenantColumn):
81
+ __tablename__ = "claim_snapshots"
82
+ __table_args__ = ({"schema": "authn"},)
83
+
84
+ claim_set_reference: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
85
+ protocol_tag: Mapped[str | None] = acol(storage=S(String(64), nullable=True, index=True))
86
+ specification_version: Mapped[str | None] = acol(storage=S(String(128), nullable=True))
87
+ payload_digest: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
88
+ protected_artifact_locator: Mapped[str] = acol(storage=S(String(1000), nullable=False))
89
+ retention_expires_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True, index=True))
90
+
91
+
92
+ __all__ = [
93
+ "ClaimDefinition",
94
+ "ClaimProvenanceRecord",
95
+ "ClaimReleasePolicy",
96
+ "ClaimSnapshot",
97
+ "ClaimSourceBinding",
98
+ ]
@@ -0,0 +1,23 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-storage-claims
3
+ Version: 0.4.0.dev2
4
+ Summary: Owned claims 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: tba-storage-tenancy (>=0.4.0.dev2)
16
+ Requires-Dist: tigrbl (>=0.4.4.dev1,<0.5)
17
+ Requires-Dist: tigrbl-migrations (>=0.4.5.dev4)
18
+ Description-Content-Type: text/markdown
19
+
20
+ # tba-storage-claims
21
+
22
+ Owns the `tigrbl.identity.storage.claims` schema component.
23
+
@@ -0,0 +1,12 @@
1
+ tba_storage_claims/__init__.py,sha256=HoJ8HOyxQOG9vvo4LEJPfEUW3IDGqZF6ZIgJQ59tK6Q,366
2
+ tba_storage_claims/component.toml,sha256=NVm-BiFgd__j9vDI2sqwvma2vy4867ZWMhdK0rRg65w,1442
3
+ tba_storage_claims/manifest.py,sha256=bYZmb6ItB8bRxtuCspB1us5eTvB1RqlTedISJZbws_w,325
4
+ tba_storage_claims/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ tba_storage_claims/migrations/versions/6b5acf6a_8d14_51f3_af78_0534d36dac44_initial_schema.py,sha256=WBIRwB7pz5NQDJ7I_Fw5A9xlYIifIgEPloYYeBtJIoQ,660
6
+ tba_storage_claims/migrations/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ tba_storage_claims/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ tba_storage_claims/tables/__init__.py,sha256=lgNPS2soWuPDd6W4Sk3aEJ4tT7JYGIWUZaCs3iXTsXc,575
9
+ tba_storage_claims/tables/claim_state.py,sha256=UKe6ahJbCgN3oCa5uzzrxEcC3rUCdCsYZw7lPqWZz0I,4684
10
+ tba_storage_claims-0.4.0.dev2.dist-info/METADATA,sha256=krlESmR-DSSQOuYlFA_5qdhlzsAkVdZr_QoHfTnlqD8,873
11
+ tba_storage_claims-0.4.0.dev2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
12
+ tba_storage_claims-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