tba-storage-certificate 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_storage_certificate-0.4.0.dev2/PKG-INFO +22 -0
- tba_storage_certificate-0.4.0.dev2/README.md +3 -0
- tba_storage_certificate-0.4.0.dev2/pyproject.toml +20 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/__init__.py +7 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/component.toml +29 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/manifest.py +9 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/migrations/__init__.py +0 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/migrations/versions/__init__.py +0 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/migrations/versions/a7e704e3_722e_5a59_92a6_9825004d8817_initial_schema.py +23 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/py.typed +0 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/tables/__init__.py +14 -0
- tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/tables/certificate_state.py +82 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tba-storage-certificate
|
|
3
|
+
Version: 0.4.0.dev2
|
|
4
|
+
Summary: Owned certificate 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-certificate
|
|
20
|
+
|
|
21
|
+
Owns the `tigrbl.identity.storage.certificate` schema component.
|
|
22
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tba-storage-certificate"
|
|
3
|
+
version = "0.4.0.dev2"
|
|
4
|
+
description = "Owned certificate identity database tables and migrations."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10,<3.15"
|
|
7
|
+
license = { text = "Apache-2.0" }
|
|
8
|
+
dependencies = [
|
|
9
|
+
"tigrbl>=0.4.4.dev1,<0.5",
|
|
10
|
+
"tigrbl-migrations>=0.4.5.dev4",
|
|
11
|
+
"tba-primitives-identity[storage]>=0.4.0.dev2",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[build-system]
|
|
15
|
+
requires = ["poetry-core>=1.0.0"]
|
|
16
|
+
build-backend = "poetry.core.masonry.api"
|
|
17
|
+
|
|
18
|
+
[tool.poetry]
|
|
19
|
+
packages = [{ include = "tba_storage_certificate", from = "src" }]
|
|
20
|
+
include = ["src/tba_storage_certificate/component.toml"]
|
|
@@ -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,29 @@
|
|
|
1
|
+
manifest_version = "1.0.0"
|
|
2
|
+
|
|
3
|
+
[component]
|
|
4
|
+
id = "tigrbl.identity.storage.certificate"
|
|
5
|
+
distribution = "tba-storage-certificate"
|
|
6
|
+
import_root = "tba_storage_certificate"
|
|
7
|
+
|
|
8
|
+
[schema]
|
|
9
|
+
contract = "1.0.0"
|
|
10
|
+
migration_head = "a7e704e3-722e-5a59-92a6-9825004d8817"
|
|
11
|
+
migrations_package = "tba_storage_certificate.migrations.versions"
|
|
12
|
+
|
|
13
|
+
[[schema.objects]]
|
|
14
|
+
id = "tigrbl.identity.storage.certificate:table:certificate_records"
|
|
15
|
+
kind = "table"
|
|
16
|
+
physical_name = "authn.certificate_records"
|
|
17
|
+
model = "tba_storage_certificate.tables:CertificateRecord"
|
|
18
|
+
|
|
19
|
+
[[schema.objects]]
|
|
20
|
+
id = "tigrbl.identity.storage.certificate:table:trust_anchors"
|
|
21
|
+
kind = "table"
|
|
22
|
+
physical_name = "authn.trust_anchors"
|
|
23
|
+
model = "tba_storage_certificate.tables:TrustAnchor"
|
|
24
|
+
|
|
25
|
+
[[schema.objects]]
|
|
26
|
+
id = "tigrbl.identity.storage.certificate:table:certificate_status_snapshots"
|
|
27
|
+
kind = "table"
|
|
28
|
+
physical_name = "authn.certificate_status_snapshots"
|
|
29
|
+
model = "tba_storage_certificate.tables:CertificateStatusSnapshot"
|
|
@@ -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
|
tba_storage_certificate-0.4.0.dev2/src/tba_storage_certificate/migrations/versions/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Initial owned schema for tigrbl.identity.storage.certificate."""
|
|
2
|
+
from tigrbl_migrations import Migration
|
|
3
|
+
from tba_storage_certificate.tables import TABLE_MODELS
|
|
4
|
+
|
|
5
|
+
REVISION = "a7e704e3-722e-5a59-92a6-9825004d8817"
|
|
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.certificate",
|
|
17
|
+
revision=REVISION,
|
|
18
|
+
parents=(),
|
|
19
|
+
kind="standard",
|
|
20
|
+
reversible=True,
|
|
21
|
+
upgrade=upgrade,
|
|
22
|
+
downgrade=downgrade,
|
|
23
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Owned mapped-table inventory."""
|
|
2
|
+
|
|
3
|
+
from .certificate_state import CertificateRecord, TrustAnchor, CertificateStatusSnapshot
|
|
4
|
+
|
|
5
|
+
TABLE_MODELS = (
|
|
6
|
+
CertificateRecord,
|
|
7
|
+
TrustAnchor,
|
|
8
|
+
CertificateStatusSnapshot,
|
|
9
|
+
)
|
|
10
|
+
TABLE_MODEL_BY_NAME = {model.__name__: model for model in TABLE_MODELS}
|
|
11
|
+
TABLE_MODEL_BY_TABLENAME = {model.__tablename__: model for model in TABLE_MODELS}
|
|
12
|
+
__all__ = [model.__name__ for model in TABLE_MODELS] + [
|
|
13
|
+
"TABLE_MODELS", "TABLE_MODEL_BY_NAME", "TABLE_MODEL_BY_TABLENAME",
|
|
14
|
+
]
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""Durable certificate metadata, trust anchors, and status snapshots."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
import datetime as dt
|
|
5
|
+
from tba_primitives_identity.orm import (
|
|
6
|
+
Boolean,
|
|
7
|
+
GUIDPk,
|
|
8
|
+
JSON,
|
|
9
|
+
Mapped,
|
|
10
|
+
RestOltpTable,
|
|
11
|
+
S,
|
|
12
|
+
String,
|
|
13
|
+
TZDateTime,
|
|
14
|
+
Timestamped,
|
|
15
|
+
acol,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class CertificateRecord(RestOltpTable, GUIDPk, Timestamped):
|
|
20
|
+
__tablename__ = "certificate_records"
|
|
21
|
+
__table_args__ = ({"schema": "authn"},)
|
|
22
|
+
certificate_id: Mapped[str] = acol(
|
|
23
|
+
storage=S(String(255), nullable=False, unique=True, index=True)
|
|
24
|
+
)
|
|
25
|
+
profile: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
26
|
+
subject: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
27
|
+
issuer: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
28
|
+
serial_number: Mapped[str] = acol(
|
|
29
|
+
storage=S(String(255), nullable=False, index=True)
|
|
30
|
+
)
|
|
31
|
+
thumbprint_sha256: Mapped[str] = acol(
|
|
32
|
+
storage=S(String(128), nullable=False, unique=True, index=True)
|
|
33
|
+
)
|
|
34
|
+
artifact_locator: Mapped[str] = acol(storage=S(String(1000), nullable=False))
|
|
35
|
+
valid_from: Mapped[dt.datetime | None] = acol(
|
|
36
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
37
|
+
)
|
|
38
|
+
valid_until: Mapped[dt.datetime | None] = acol(
|
|
39
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
40
|
+
)
|
|
41
|
+
key_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class TrustAnchor(RestOltpTable, GUIDPk, Timestamped):
|
|
45
|
+
__tablename__ = "trust_anchors"
|
|
46
|
+
__table_args__ = ({"schema": "authn"},)
|
|
47
|
+
anchor_id: Mapped[str] = acol(
|
|
48
|
+
storage=S(String(255), nullable=False, unique=True, index=True)
|
|
49
|
+
)
|
|
50
|
+
profile: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
51
|
+
subject: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
52
|
+
thumbprint_sha256: Mapped[str] = acol(
|
|
53
|
+
storage=S(String(128), nullable=False, index=True)
|
|
54
|
+
)
|
|
55
|
+
artifact_locator: Mapped[str] = acol(storage=S(String(1000), nullable=False))
|
|
56
|
+
constraints: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
57
|
+
active: Mapped[bool] = acol(
|
|
58
|
+
storage=S(Boolean, nullable=False, default=True, index=True)
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class CertificateStatusSnapshot(RestOltpTable, GUIDPk, Timestamped):
|
|
63
|
+
__tablename__ = "certificate_status_snapshots"
|
|
64
|
+
__table_args__ = ({"schema": "authn"},)
|
|
65
|
+
certificate_id: Mapped[str] = acol(
|
|
66
|
+
storage=S(String(255), nullable=False, index=True)
|
|
67
|
+
)
|
|
68
|
+
source: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
69
|
+
status: Mapped[str] = acol(storage=S(String(32), nullable=False, index=True))
|
|
70
|
+
this_update: Mapped[dt.datetime | None] = acol(
|
|
71
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
72
|
+
)
|
|
73
|
+
next_update: Mapped[dt.datetime | None] = acol(
|
|
74
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
75
|
+
)
|
|
76
|
+
response_digest: Mapped[str] = acol(
|
|
77
|
+
storage=S(String(128), nullable=False, index=True)
|
|
78
|
+
)
|
|
79
|
+
artifact_locator: Mapped[str | None] = acol(storage=S(String(1000), nullable=True))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
__all__ = ["CertificateRecord", "TrustAnchor", "CertificateStatusSnapshot"]
|