tba-storage-federation 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.
Files changed (19) hide show
  1. tba_storage_federation-0.4.0.dev2/PKG-INFO +22 -0
  2. tba_storage_federation-0.4.0.dev2/README.md +3 -0
  3. tba_storage_federation-0.4.0.dev2/pyproject.toml +20 -0
  4. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/__init__.py +7 -0
  5. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/component.toml +35 -0
  6. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/manifest.py +9 -0
  7. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/migrations/__init__.py +0 -0
  8. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/migrations/versions/__init__.py +0 -0
  9. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/migrations/versions/d0a7da98_00a5_58f8_ac3e_d0912c96f0db_initial_schema.py +23 -0
  10. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/py.typed +0 -0
  11. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/__init__.py +18 -0
  12. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/federated_session/__init__.py +5 -0
  13. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/federated_session/_table.py +32 -0
  14. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/federation/__init__.py +5 -0
  15. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/federation/_table.py +37 -0
  16. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/identity_provider/__init__.py +5 -0
  17. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/identity_provider/_table.py +37 -0
  18. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/provider_artifact/__init__.py +9 -0
  19. tba_storage_federation-0.4.0.dev2/src/tba_storage_federation/tables/provider_artifact/_table.py +22 -0
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-storage-federation
3
+ Version: 0.4.0.dev2
4
+ Summary: Owned federation 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-federation
20
+
21
+ Owns the `tigrbl.identity.storage.federation` schema component.
22
+
@@ -0,0 +1,3 @@
1
+ # tba-storage-federation
2
+
3
+ Owns the `tigrbl.identity.storage.federation` schema component.
@@ -0,0 +1,20 @@
1
+ [project]
2
+ name = "tba-storage-federation"
3
+ version = "0.4.0.dev2"
4
+ description = "Owned federation 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_federation", from = "src" }]
20
+ include = ["src/tba_storage_federation/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,35 @@
1
+ manifest_version = "1.0.0"
2
+
3
+ [component]
4
+ id = "tigrbl.identity.storage.federation"
5
+ distribution = "tba-storage-federation"
6
+ import_root = "tba_storage_federation"
7
+
8
+ [schema]
9
+ contract = "1.0.0"
10
+ migration_head = "d0a7da98-00a5-58f8-ac3e-d0912c96f0db"
11
+ migrations_package = "tba_storage_federation.migrations.versions"
12
+
13
+ [[schema.objects]]
14
+ id = "tigrbl.identity.storage.federation:table:provider_artifacts"
15
+ kind = "table"
16
+ physical_name = "authn.provider_artifacts"
17
+ model = "tba_storage_federation.tables:ProviderArtifact"
18
+
19
+ [[schema.objects]]
20
+ id = "tigrbl.identity.storage.federation:table:identity_providers"
21
+ kind = "table"
22
+ physical_name = "authn.identity_providers"
23
+ model = "tba_storage_federation.tables:IdentityProvider"
24
+
25
+ [[schema.objects]]
26
+ id = "tigrbl.identity.storage.federation:table:federations"
27
+ kind = "table"
28
+ physical_name = "authn.federations"
29
+ model = "tba_storage_federation.tables:Federation"
30
+
31
+ [[schema.objects]]
32
+ id = "tigrbl.identity.storage.federation:table:federated_sessions"
33
+ kind = "table"
34
+ physical_name = "authn.federated_sessions"
35
+ model = "tba_storage_federation.tables:FederatedSession"
@@ -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()
@@ -0,0 +1,23 @@
1
+ """Initial owned schema for tigrbl.identity.storage.federation."""
2
+ from tigrbl_migrations import Migration
3
+ from tba_storage_federation.tables import TABLE_MODELS
4
+
5
+ REVISION = "d0a7da98-00a5-58f8-ac3e-d0912c96f0db"
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.federation",
17
+ revision=REVISION,
18
+ parents=(),
19
+ kind="standard",
20
+ reversible=True,
21
+ upgrade=upgrade,
22
+ downgrade=downgrade,
23
+ )
@@ -0,0 +1,18 @@
1
+ """Owned mapped-table inventory."""
2
+
3
+ from .federated_session import FederatedSession
4
+ from .federation import Federation
5
+ from .identity_provider import IdentityProvider
6
+ from .provider_artifact import ProviderArtifact
7
+
8
+ TABLE_MODELS = (
9
+ ProviderArtifact,
10
+ IdentityProvider,
11
+ Federation,
12
+ FederatedSession,
13
+ )
14
+ TABLE_MODEL_BY_NAME = {model.__name__: model for model in TABLE_MODELS}
15
+ TABLE_MODEL_BY_TABLENAME = {model.__tablename__: model for model in TABLE_MODELS}
16
+ __all__ = [model.__name__ for model in TABLE_MODELS] + [
17
+ "TABLE_MODELS", "TABLE_MODEL_BY_NAME", "TABLE_MODEL_BY_TABLENAME",
18
+ ]
@@ -0,0 +1,5 @@
1
+ """Federated session table export."""
2
+
3
+ from ._table import FederatedSession
4
+
5
+ __all__ = ["FederatedSession"]
@@ -0,0 +1,32 @@
1
+ """Durable federated login session records."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from tba_primitives_identity.orm import (
6
+ Boolean,
7
+ GUIDPk,
8
+ JSON,
9
+ Mapped,
10
+ RestOltpTable,
11
+ S,
12
+ String,
13
+ Timestamped,
14
+ acol,
15
+ )
16
+
17
+
18
+ class FederatedSession(RestOltpTable, GUIDPk, Timestamped):
19
+ __tablename__ = "federated_sessions"
20
+ __table_args__ = ({"schema": "authn"},)
21
+
22
+ session_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
23
+ provider_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
24
+ tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
25
+ issuer: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
26
+ audience: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
27
+ logout_supported: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=False, index=True))
28
+ normalized_claims: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
29
+ bound_at: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
30
+
31
+
32
+ __all__ = ["FederatedSession"]
@@ -0,0 +1,5 @@
1
+ """Federation registry table export."""
2
+
3
+ from ._table import Federation
4
+
5
+ __all__ = ["Federation"]
@@ -0,0 +1,37 @@
1
+ """Durable federation registry records."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from tba_primitives_identity.orm import (
6
+ Boolean,
7
+ GUIDPk,
8
+ Integer,
9
+ JSON,
10
+ Mapped,
11
+ RestOltpTable,
12
+ S,
13
+ String,
14
+ Timestamped,
15
+ acol,
16
+ )
17
+
18
+
19
+ class Federation(RestOltpTable, GUIDPk, Timestamped):
20
+ __tablename__ = "federations"
21
+ __table_args__ = ({"schema": "authn"},)
22
+
23
+ federation_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
24
+ tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
25
+ kind: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
26
+ issuer: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
27
+ discovery_url: Mapped[str] = acol(storage=S(String(1000), nullable=False))
28
+ audience: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
29
+ logout_supported: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=False, index=True))
30
+ display_name: Mapped[str] = acol(storage=S(String(255), nullable=False))
31
+ claim_mapping: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
32
+ scopes: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
33
+ key_set_version: Mapped[int] = acol(storage=S(Integer, nullable=False, default=1))
34
+ enabled: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=True, index=True))
35
+
36
+
37
+ __all__ = ["Federation"]
@@ -0,0 +1,5 @@
1
+ """Identity provider table export."""
2
+
3
+ from ._table import IdentityProvider
4
+
5
+ __all__ = ["IdentityProvider"]
@@ -0,0 +1,37 @@
1
+ """Durable federated identity provider records."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from tba_primitives_identity.orm import (
6
+ Boolean,
7
+ GUIDPk,
8
+ Integer,
9
+ JSON,
10
+ Mapped,
11
+ RestOltpTable,
12
+ S,
13
+ String,
14
+ Timestamped,
15
+ acol,
16
+ )
17
+
18
+
19
+ class IdentityProvider(RestOltpTable, GUIDPk, Timestamped):
20
+ __tablename__ = "identity_providers"
21
+ __table_args__ = ({"schema": "authn"},)
22
+
23
+ provider_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
24
+ tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
25
+ kind: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
26
+ issuer: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
27
+ discovery_url: Mapped[str] = acol(storage=S(String(1000), nullable=False))
28
+ audience: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
29
+ logout_supported: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=False, index=True))
30
+ display_name: Mapped[str] = acol(storage=S(String(255), nullable=False))
31
+ claim_mapping: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
32
+ scopes: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
33
+ key_set_version: Mapped[int] = acol(storage=S(Integer, nullable=False, default=1))
34
+ enabled: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=True, index=True))
35
+
36
+
37
+ __all__ = ["IdentityProvider"]
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+
3
+ from . import _table as _table
4
+ from ._table import *
5
+
6
+ try:
7
+ __all__ = list(_table.__all__)
8
+ except AttributeError:
9
+ __all__ = [name for name in globals() if not name.startswith("_")]
@@ -0,0 +1,22 @@
1
+ """Durable provider artifact and descriptor registry."""
2
+
3
+ from __future__ import annotations
4
+
5
+
6
+ from tba_primitives_identity.orm import RestOltpTable, GUIDPk, JSON, Mapped, S, String, Timestamped, acol
7
+
8
+
9
+
10
+ class ProviderArtifact(RestOltpTable, GUIDPk, Timestamped):
11
+ __tablename__ = "provider_artifacts"
12
+ __table_args__ = ({"schema": "authn"},)
13
+
14
+ artifact_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
15
+ artifact_kind: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
16
+ provider_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
17
+ tenant_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
18
+ status: Mapped[str] = acol(storage=S(String(64), nullable=False, default="active", index=True))
19
+ artifact_payload: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
20
+
21
+
22
+ __all__ = ["ProviderArtifact"]