tba-storage-federation 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_federation/__init__.py +7 -0
- tba_storage_federation/component.toml +35 -0
- tba_storage_federation/manifest.py +9 -0
- tba_storage_federation/migrations/__init__.py +0 -0
- tba_storage_federation/migrations/versions/__init__.py +0 -0
- tba_storage_federation/migrations/versions/d0a7da98_00a5_58f8_ac3e_d0912c96f0db_initial_schema.py +23 -0
- tba_storage_federation/py.typed +0 -0
- tba_storage_federation/tables/__init__.py +18 -0
- tba_storage_federation/tables/federated_session/__init__.py +5 -0
- tba_storage_federation/tables/federated_session/_table.py +32 -0
- tba_storage_federation/tables/federation/__init__.py +5 -0
- tba_storage_federation/tables/federation/_table.py +37 -0
- tba_storage_federation/tables/identity_provider/__init__.py +5 -0
- tba_storage_federation/tables/identity_provider/_table.py +37 -0
- tba_storage_federation/tables/provider_artifact/__init__.py +9 -0
- tba_storage_federation/tables/provider_artifact/_table.py +22 -0
- tba_storage_federation-0.4.0.dev2.dist-info/METADATA +22 -0
- tba_storage_federation-0.4.0.dev2.dist-info/RECORD +19 -0
- tba_storage_federation-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,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()
|
|
File without changes
|
|
File without changes
|
tba_storage_federation/migrations/versions/d0a7da98_00a5_58f8_ac3e_d0912c96f0db_initial_schema.py
ADDED
|
@@ -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
|
+
)
|
|
File without changes
|
|
@@ -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,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,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,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,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"]
|
|
@@ -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,19 @@
|
|
|
1
|
+
tba_storage_federation/__init__.py,sha256=HoJ8HOyxQOG9vvo4LEJPfEUW3IDGqZF6ZIgJQ59tK6Q,366
|
|
2
|
+
tba_storage_federation/component.toml,sha256=9UOr7z-CQm0NLMNeVbg8Nwm3TfWjZxk6Empogk7SD-Y,1100
|
|
3
|
+
tba_storage_federation/manifest.py,sha256=bYZmb6ItB8bRxtuCspB1us5eTvB1RqlTedISJZbws_w,325
|
|
4
|
+
tba_storage_federation/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
tba_storage_federation/migrations/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
tba_storage_federation/migrations/versions/d0a7da98_00a5_58f8_ac3e_d0912c96f0db_initial_schema.py,sha256=lUY_6N04TD9uJG0VxrRg3DyChCLJuprDbX8QqYdNOnU,672
|
|
7
|
+
tba_storage_federation/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
tba_storage_federation/tables/__init__.py,sha256=PoM8MvOaooyrDQdQ-MU0momchCuQgBJXIG83y8lj1-M,602
|
|
9
|
+
tba_storage_federation/tables/federated_session/__init__.py,sha256=UhxslmMCqQehIzgp9Swo8KOey7Ps-uPb7OkCUg0RIys,108
|
|
10
|
+
tba_storage_federation/tables/federated_session/_table.py,sha256=oGsVFB60aO29ujPVfQcuYMd3bpEML-2j4AqhIzC_oBU,1143
|
|
11
|
+
tba_storage_federation/tables/federation/__init__.py,sha256=aCc4QhHUi9rCJMZp8EqztNelZ84rTbGz9tO_DHTWuak,98
|
|
12
|
+
tba_storage_federation/tables/federation/_table.py,sha256=6-6VN0gDX5GhmpU9YmiAAylFcbr0SXhrgroEpaCAXTg,1457
|
|
13
|
+
tba_storage_federation/tables/identity_provider/__init__.py,sha256=qP-61egl8xuhSc3j2rs87rPJsqAFEcrlf6q4amER9dk,108
|
|
14
|
+
tba_storage_federation/tables/identity_provider/_table.py,sha256=U77ZSdU9ki1hBAdJlkgXUSJv_SLERLHCRpjLNAjdcEk,1482
|
|
15
|
+
tba_storage_federation/tables/provider_artifact/__init__.py,sha256=IO-lx8EAbqZxccRxlGAfRQiRNXAD9GwDwavuAChnnVw,227
|
|
16
|
+
tba_storage_federation/tables/provider_artifact/_table.py,sha256=07AyQaZJSwTL0BG5LtNWvTSPAZlL5w5O1U5qfscvfS8,948
|
|
17
|
+
tba_storage_federation-0.4.0.dev2.dist-info/METADATA,sha256=j8WcYlEZEyucd5Q27S5RoLnWsYxSNbjO6uEpY89Y_3Q,839
|
|
18
|
+
tba_storage_federation-0.4.0.dev2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
19
|
+
tba_storage_federation-0.4.0.dev2.dist-info/RECORD,,
|