tba-storage-core 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_core/__init__.py +25 -0
- tba_storage_core/components.py +35 -0
- tba_storage_core/framework.py +3 -0
- tba_storage_core/migrations/__init__.py +15 -0
- tba_storage_core/migrations/contract.py +74 -0
- tba_storage_core/migrations/env.py +7 -0
- tba_storage_core/migrations/helpers.py +219 -0
- tba_storage_core/migrations/versions/0001_initial_identity_tables.py +17 -0
- tba_storage_core/migrations/versions/0002_client_and_service_tables.py +23 -0
- tba_storage_core/migrations/versions/0003_authorization_runtime_tables.py +17 -0
- tba_storage_core/migrations/versions/0004_device_par_revocation_tables.py +17 -0
- tba_storage_core/migrations/versions/0005_session_logout_tables.py +17 -0
- tba_storage_core/migrations/versions/0006_key_rotation_and_audit_tables.py +17 -0
- tba_storage_core/migrations/versions/0007_browser_session_cookie_and_auth_code_linkage.py +50 -0
- tba_storage_core/migrations/versions/0008_refresh_token_family_state.py +44 -0
- tba_storage_core/migrations/versions/0009_admin_identity_bootstrap_and_password_recovery.py +48 -0
- tba_storage_core/migrations/versions/0010_realm_namespace_tables.py +33 -0
- tba_storage_core/migrations/versions/0011_delegation_grant_lifecycle_tables.py +39 -0
- tba_storage_core/migrations/versions/0012_key_version_and_token_provenance_tables.py +36 -0
- tba_storage_core/migrations/versions/0013_contract_durable_state_tables.py +59 -0
- tba_storage_core/migrations/versions/0014_optional_contract_state_tables.py +57 -0
- tba_storage_core/migrations/versions/0015_principal_identity_credential_tables.py +85 -0
- tba_storage_core/migrations/versions/0016_crypto_key_storage_tables.py +84 -0
- tba_storage_core/migrations/versions/0017_authorization_server_table.py +21 -0
- tba_storage_core/migrations/versions/0018_policy_tables.py +27 -0
- tba_storage_core/migrations/versions/0019_federation_and_invariant_tables.py +35 -0
- tba_storage_core/migrations/versions/0020_backchannel_logout_replay_table.py +21 -0
- tba_storage_core/migrations/versions/0021_authentication_challenge_table.py +21 -0
- tba_storage_core/migrations/versions/0022_authority_and_trust_graph_tables.py +35 -0
- tba_storage_core/migrations/versions/0023_artifact_and_token_profile_discriminators.py +65 -0
- tba_storage_core/migrations/versions/0024_credential_issuer_wallet_and_configuration.py +32 -0
- tba_storage_core/migrations/versions/0025_credential_issuance_and_status.py +34 -0
- tba_storage_core/migrations/versions/0026_presentation_transaction_and_replay.py +28 -0
- tba_storage_core/migrations/versions/0027_attestation_and_reference_material.py +32 -0
- tba_storage_core/migrations/versions/0028_spiffe_svid_and_trust_bundles.py +22 -0
- tba_storage_core/migrations/versions/0029_security_event_delivery.py +28 -0
- tba_storage_core/migrations/versions/0030_optional_did_and_gnap_state.py +37 -0
- tba_storage_core/migrations/versions/0031_certificate_trust_and_status.py +22 -0
- tba_storage_core/migrations/versions/0032_claim_definition_and_provenance.py +30 -0
- tba_storage_core/migrations/versions/0033_replay_reservations.py +18 -0
- tba_storage_core/migrations/versions/0034_dpop_replay_nonce_tables.py +21 -0
- tba_storage_core/migrations/versions/0035_webauthn_rp_ceremony_and_credentials.py +76 -0
- tba_storage_core/migrations/versions/0036_workload_credentials_artifacts_and_proof_replay.py +27 -0
- tba_storage_core/migrations/versions/0037_operator_tables.py +30 -0
- tba_storage_core/migrations/versions/0038_adopt_component_ownership.py +66 -0
- tba_storage_core/migrations/versions/0039_normalized_platform_iam.py +17 -0
- tba_storage_core/py.typed +0 -0
- tba_storage_core/storage.lock.toml +211 -0
- tba_storage_core/storage.toml +34 -0
- tba_storage_core/tables/__init__.py +179 -0
- tba_storage_core/tables/_graph_base.py +53 -0
- tba_storage_core/tables/_registry.py +200 -0
- tba_storage_core/tables/access_review_campaign/__init__.py +9 -0
- tba_storage_core/tables/access_review_campaign/_table.py +25 -0
- tba_storage_core/tables/access_review_decision/__init__.py +9 -0
- tba_storage_core/tables/access_review_decision/_table.py +27 -0
- tba_storage_core/tables/access_review_item/__init__.py +9 -0
- tba_storage_core/tables/access_review_item/_table.py +26 -0
- tba_storage_core/tables/attestation_appraisal_policy/__init__.py +3 -0
- tba_storage_core/tables/attestation_endorsement/__init__.py +3 -0
- tba_storage_core/tables/attestation_evidence/__init__.py +3 -0
- tba_storage_core/tables/attestation_reference_manifest/__init__.py +3 -0
- tba_storage_core/tables/attestation_reference_value/__init__.py +3 -0
- tba_storage_core/tables/attestation_result/__init__.py +3 -0
- tba_storage_core/tables/attestation_state.py +124 -0
- tba_storage_core/tables/attribute_policy/__init__.py +9 -0
- tba_storage_core/tables/attribute_policy/_table.py +40 -0
- tba_storage_core/tables/audit_event/__init__.py +10 -0
- tba_storage_core/tables/audit_event/_table.py +47 -0
- tba_storage_core/tables/auth_code/__init__.py +13 -0
- tba_storage_core/tables/auth_code/_table.py +41 -0
- tba_storage_core/tables/auth_session/__init__.py +13 -0
- tba_storage_core/tables/auth_session/_table.py +45 -0
- tba_storage_core/tables/authentication_challenge/__init__.py +7 -0
- tba_storage_core/tables/authentication_challenge/_table.py +38 -0
- tba_storage_core/tables/authority_derivation_graph/__init__.py +15 -0
- tba_storage_core/tables/authority_derivation_graph/_table.py +94 -0
- tba_storage_core/tables/authorization_invariant/__init__.py +5 -0
- tba_storage_core/tables/authorization_invariant/_table.py +34 -0
- tba_storage_core/tables/authorization_server/__init__.py +6 -0
- tba_storage_core/tables/authorization_server/_table.py +61 -0
- tba_storage_core/tables/authz_verification_report/__init__.py +9 -0
- tba_storage_core/tables/authz_verification_report/_table.py +29 -0
- tba_storage_core/tables/backchannel_logout_replay/__init__.py +5 -0
- tba_storage_core/tables/backchannel_logout_replay/_table.py +37 -0
- tba_storage_core/tables/certificate_record/__init__.py +3 -0
- tba_storage_core/tables/certificate_state.py +82 -0
- tba_storage_core/tables/certificate_status_snapshot/__init__.py +3 -0
- tba_storage_core/tables/claim_state.py +98 -0
- tba_storage_core/tables/client/__init__.py +9 -0
- tba_storage_core/tables/client/_table.py +41 -0
- tba_storage_core/tables/client_registration/__init__.py +10 -0
- tba_storage_core/tables/client_registration/_table.py +47 -0
- tba_storage_core/tables/consent/__init__.py +13 -0
- tba_storage_core/tables/consent/_table.py +57 -0
- tba_storage_core/tables/control_correctness_report/__init__.py +9 -0
- tba_storage_core/tables/control_correctness_report/_table.py +20 -0
- tba_storage_core/tables/credential/__init__.py +9 -0
- tba_storage_core/tables/credential/_table.py +74 -0
- tba_storage_core/tables/credential_api_key/__init__.py +9 -0
- tba_storage_core/tables/credential_api_key/_table.py +50 -0
- tba_storage_core/tables/credential_audit_event/__init__.py +9 -0
- tba_storage_core/tables/credential_audit_event/_table.py +25 -0
- tba_storage_core/tables/credential_client_secret/__init__.py +9 -0
- tba_storage_core/tables/credential_client_secret/_table.py +24 -0
- tba_storage_core/tables/credential_configuration/__init__.py +3 -0
- tba_storage_core/tables/credential_deferred_transaction/__init__.py +3 -0
- tba_storage_core/tables/credential_dpop_key/__init__.py +9 -0
- tba_storage_core/tables/credential_dpop_key/_table.py +22 -0
- tba_storage_core/tables/credential_ecosystem_registry.py +119 -0
- tba_storage_core/tables/credential_issuance_state.py +154 -0
- tba_storage_core/tables/credential_issuance_transaction/__init__.py +3 -0
- tba_storage_core/tables/credential_issuer/__init__.py +3 -0
- tba_storage_core/tables/credential_mfa_factor/__init__.py +9 -0
- tba_storage_core/tables/credential_mfa_factor/_table.py +24 -0
- tba_storage_core/tables/credential_mtls_certificate/__init__.py +9 -0
- tba_storage_core/tables/credential_mtls_certificate/_table.py +26 -0
- tba_storage_core/tables/credential_notification/__init__.py +3 -0
- tba_storage_core/tables/credential_offer/__init__.py +3 -0
- tba_storage_core/tables/credential_password/__init__.py +9 -0
- tba_storage_core/tables/credential_password/_table.py +24 -0
- tba_storage_core/tables/credential_recovery_code/__init__.py +9 -0
- tba_storage_core/tables/credential_recovery_code/_table.py +23 -0
- tba_storage_core/tables/credential_service_key/__init__.py +9 -0
- tba_storage_core/tables/credential_service_key/_table.py +49 -0
- tba_storage_core/tables/credential_status_entry/__init__.py +3 -0
- tba_storage_core/tables/credential_status_list/__init__.py +3 -0
- tba_storage_core/tables/credential_status_publication/__init__.py +3 -0
- tba_storage_core/tables/credential_webauthn_passkey/__init__.py +9 -0
- tba_storage_core/tables/credential_webauthn_passkey/_table.py +42 -0
- tba_storage_core/tables/crypto_key/__init__.py +13 -0
- tba_storage_core/tables/crypto_key/_table.py +52 -0
- tba_storage_core/tables/crypto_key_version/__init__.py +13 -0
- tba_storage_core/tables/crypto_key_version/_table.py +53 -0
- tba_storage_core/tables/delegated_admin_scope/__init__.py +9 -0
- tba_storage_core/tables/delegated_admin_scope/_table.py +34 -0
- tba_storage_core/tables/delegation_grant/__init__.py +13 -0
- tba_storage_core/tables/delegation_grant/_table.py +134 -0
- tba_storage_core/tables/device_code/__init__.py +13 -0
- tba_storage_core/tables/device_code/_table.py +54 -0
- tba_storage_core/tables/did_document/__init__.py +3 -0
- tba_storage_core/tables/did_document_version/__init__.py +3 -0
- tba_storage_core/tables/did_gnap_state.py +169 -0
- tba_storage_core/tables/did_resolution_cache/__init__.py +3 -0
- tba_storage_core/tables/did_service/__init__.py +3 -0
- tba_storage_core/tables/did_verification_method/__init__.py +3 -0
- tba_storage_core/tables/dpop_nonce/__init__.py +5 -0
- tba_storage_core/tables/dpop_nonce/_table.py +77 -0
- tba_storage_core/tables/dpop_replay/__init__.py +5 -0
- tba_storage_core/tables/dpop_replay/_table.py +97 -0
- tba_storage_core/tables/entitlement/__init__.py +9 -0
- tba_storage_core/tables/entitlement/_table.py +22 -0
- tba_storage_core/tables/entitlement_assignment/__init__.py +9 -0
- tba_storage_core/tables/entitlement_assignment/_table.py +26 -0
- tba_storage_core/tables/federated_session/__init__.py +5 -0
- tba_storage_core/tables/federated_session/_table.py +32 -0
- tba_storage_core/tables/federation/__init__.py +5 -0
- tba_storage_core/tables/federation/_table.py +37 -0
- tba_storage_core/tables/gnap_client_instance/__init__.py +3 -0
- tba_storage_core/tables/gnap_continuation/__init__.py +3 -0
- tba_storage_core/tables/gnap_grant/__init__.py +3 -0
- tba_storage_core/tables/gnap_interaction/__init__.py +3 -0
- tba_storage_core/tables/identity_provider/__init__.py +5 -0
- tba_storage_core/tables/identity_provider/_table.py +37 -0
- tba_storage_core/tables/invariant_evaluation/__init__.py +5 -0
- tba_storage_core/tables/invariant_evaluation/_table.py +29 -0
- tba_storage_core/tables/invariant_violation/__init__.py +5 -0
- tba_storage_core/tables/invariant_violation/_table.py +27 -0
- tba_storage_core/tables/key_attestation_evidence/__init__.py +13 -0
- tba_storage_core/tables/key_attestation_evidence/_table.py +99 -0
- tba_storage_core/tables/key_envelope/__init__.py +13 -0
- tba_storage_core/tables/key_envelope/_table.py +54 -0
- tba_storage_core/tables/key_rotation_event/__init__.py +9 -0
- tba_storage_core/tables/key_rotation_event/_table.py +44 -0
- tba_storage_core/tables/key_rotation_policy/__init__.py +9 -0
- tba_storage_core/tables/key_rotation_policy/_table.py +38 -0
- tba_storage_core/tables/logout_state/__init__.py +10 -0
- tba_storage_core/tables/logout_state/_table.py +67 -0
- tba_storage_core/tables/machine_identity/__init__.py +9 -0
- tba_storage_core/tables/machine_identity/_table.py +49 -0
- tba_storage_core/tables/operator_activity/__init__.py +9 -0
- tba_storage_core/tables/operator_activity/_table.py +29 -0
- tba_storage_core/tables/operator_audit_event/__init__.py +9 -0
- tba_storage_core/tables/operator_audit_event/_table.py +29 -0
- tba_storage_core/tables/operator_metadata/__init__.py +9 -0
- tba_storage_core/tables/operator_metadata/_table.py +19 -0
- tba_storage_core/tables/operator_record/__init__.py +9 -0
- tba_storage_core/tables/operator_record/_table.py +44 -0
- tba_storage_core/tables/operator_transaction/__init__.py +9 -0
- tba_storage_core/tables/operator_transaction/_table.py +33 -0
- tba_storage_core/tables/plugin_descriptor/__init__.py +9 -0
- tba_storage_core/tables/plugin_descriptor/_table.py +23 -0
- tba_storage_core/tables/plugin_lifecycle_event/__init__.py +9 -0
- tba_storage_core/tables/plugin_lifecycle_event/_table.py +22 -0
- tba_storage_core/tables/policy/__init__.py +5 -0
- tba_storage_core/tables/policy/_table.py +30 -0
- tba_storage_core/tables/policy_condition/__init__.py +9 -0
- tba_storage_core/tables/policy_condition/_table.py +21 -0
- tba_storage_core/tables/policy_set/__init__.py +5 -0
- tba_storage_core/tables/policy_set/_table.py +33 -0
- tba_storage_core/tables/policy_set_member/__init__.py +5 -0
- tba_storage_core/tables/policy_set_member/_table.py +32 -0
- tba_storage_core/tables/policy_target/__init__.py +5 -0
- tba_storage_core/tables/policy_target/_table.py +36 -0
- tba_storage_core/tables/policy_version/__init__.py +5 -0
- tba_storage_core/tables/policy_version/_table.py +35 -0
- tba_storage_core/tables/presentation_consent/__init__.py +3 -0
- tba_storage_core/tables/presentation_replay/__init__.py +3 -0
- tba_storage_core/tables/presentation_state.py +98 -0
- tba_storage_core/tables/presentation_transaction/__init__.py +3 -0
- tba_storage_core/tables/principal/__init__.py +9 -0
- tba_storage_core/tables/principal/_table.py +49 -0
- tba_storage_core/tables/principal_key_binding/__init__.py +13 -0
- tba_storage_core/tables/principal_key_binding/_table.py +48 -0
- tba_storage_core/tables/provider_artifact/__init__.py +9 -0
- tba_storage_core/tables/provider_artifact/_table.py +22 -0
- tba_storage_core/tables/pushed_authorization_request/__init__.py +13 -0
- tba_storage_core/tables/pushed_authorization_request/_table.py +59 -0
- tba_storage_core/tables/realm/__init__.py +13 -0
- tba_storage_core/tables/realm/_table.py +87 -0
- tba_storage_core/tables/release_attestation_event/__init__.py +9 -0
- tba_storage_core/tables/release_attestation_event/_table.py +21 -0
- tba_storage_core/tables/release_authorization_state/__init__.py +9 -0
- tba_storage_core/tables/release_authorization_state/_table.py +21 -0
- tba_storage_core/tables/release_capability_record/__init__.py +9 -0
- tba_storage_core/tables/release_capability_record/_table.py +21 -0
- tba_storage_core/tables/release_posture/__init__.py +9 -0
- tba_storage_core/tables/release_posture/_table.py +21 -0
- tba_storage_core/tables/release_security_posture/__init__.py +9 -0
- tba_storage_core/tables/release_security_posture/_table.py +22 -0
- tba_storage_core/tables/replay_reservation.py +34 -0
- tba_storage_core/tables/residency_zone/__init__.py +9 -0
- tba_storage_core/tables/residency_zone/_table.py +20 -0
- tba_storage_core/tables/resource_server_contract/__init__.py +9 -0
- tba_storage_core/tables/resource_server_contract/_table.py +21 -0
- tba_storage_core/tables/revoked_token/__init__.py +13 -0
- tba_storage_core/tables/revoked_token/_table.py +39 -0
- tba_storage_core/tables/role/__init__.py +9 -0
- tba_storage_core/tables/role/_table.py +22 -0
- tba_storage_core/tables/runtime_qualification/__init__.py +9 -0
- tba_storage_core/tables/runtime_qualification/_table.py +21 -0
- tba_storage_core/tables/scim_group/__init__.py +9 -0
- tba_storage_core/tables/scim_group/_table.py +21 -0
- tba_storage_core/tables/scim_patch_event/__init__.py +9 -0
- tba_storage_core/tables/scim_patch_event/_table.py +22 -0
- tba_storage_core/tables/scim_schema/__init__.py +9 -0
- tba_storage_core/tables/scim_schema/_table.py +21 -0
- tba_storage_core/tables/scim_user/__init__.py +9 -0
- tba_storage_core/tables/scim_user/_table.py +21 -0
- tba_storage_core/tables/sdk_package/__init__.py +9 -0
- tba_storage_core/tables/sdk_package/_table.py +23 -0
- tba_storage_core/tables/security_event/__init__.py +3 -0
- tba_storage_core/tables/security_event_delivery/__init__.py +3 -0
- tba_storage_core/tables/security_event_replay/__init__.py +3 -0
- tba_storage_core/tables/security_event_state.py +100 -0
- tba_storage_core/tables/security_event_subscription/__init__.py +3 -0
- tba_storage_core/tables/service_identity/__init__.py +9 -0
- tba_storage_core/tables/service_identity/_table.py +47 -0
- tba_storage_core/tables/spiffe_state.py +83 -0
- tba_storage_core/tables/spiffe_trust_bundle/__init__.py +3 -0
- tba_storage_core/tables/subject_alias/__init__.py +9 -0
- tba_storage_core/tables/subject_alias/_table.py +21 -0
- tba_storage_core/tables/svid_record/__init__.py +3 -0
- tba_storage_core/tables/tenant/__init__.py +13 -0
- tba_storage_core/tables/tenant/_table.py +83 -0
- tba_storage_core/tables/tenant_membership/__init__.py +9 -0
- tba_storage_core/tables/tenant_membership/_table.py +28 -0
- tba_storage_core/tables/tenant_residency/__init__.py +9 -0
- tba_storage_core/tables/tenant_residency/_table.py +23 -0
- tba_storage_core/tables/token_record/__init__.py +10 -0
- tba_storage_core/tables/token_record/_table.py +123 -0
- tba_storage_core/tables/trust_anchor/__init__.py +3 -0
- tba_storage_core/tables/trust_domain_federation/__init__.py +3 -0
- tba_storage_core/tables/trust_federation_graph/__init__.py +15 -0
- tba_storage_core/tables/trust_federation_graph/_table.py +94 -0
- tba_storage_core/tables/user/__init__.py +13 -0
- tba_storage_core/tables/user/_table.py +127 -0
- tba_storage_core/tables/verifier_registration/__init__.py +3 -0
- tba_storage_core/tables/wallet_attestation/__init__.py +3 -0
- tba_storage_core/tables/wallet_instance/__init__.py +3 -0
- tba_storage_core/tables/wallet_key_binding/__init__.py +3 -0
- tba_storage_core/tables/wallet_registration/__init__.py +3 -0
- tba_storage_core/tables/webauthn_attestation_record/__init__.py +3 -0
- tba_storage_core/tables/webauthn_attestation_record/_table.py +28 -0
- tba_storage_core/tables/webauthn_ceremony/__init__.py +3 -0
- tba_storage_core/tables/webauthn_ceremony/_table.py +43 -0
- tba_storage_core/tables/webauthn_relying_party/__init__.py +3 -0
- tba_storage_core/tables/webauthn_relying_party/_table.py +24 -0
- tba_storage_core/tables/workload_credential_state.py +57 -0
- tba_storage_core/tables/workload_identity/__init__.py +9 -0
- tba_storage_core/tables/workload_identity/_table.py +89 -0
- tba_storage_core-0.4.0.dev2.dist-info/METADATA +126 -0
- tba_storage_core-0.4.0.dev2.dist-info/RECORD +294 -0
- tba_storage_core-0.4.0.dev2.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Durable key rotation policy versions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import datetime as dt
|
|
6
|
+
|
|
7
|
+
from tba_storage_core.framework import RestOltpTable, GUIDPk, Boolean, Integer, Mapped, S, String, TZDateTime, Timestamped, acol
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class KeyRotationPolicy(RestOltpTable, GUIDPk, Timestamped):
|
|
12
|
+
__tablename__ = "key_rotation_policies"
|
|
13
|
+
__table_args__ = ({"schema": "authn"},)
|
|
14
|
+
|
|
15
|
+
policy_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
16
|
+
version_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
|
|
17
|
+
tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
18
|
+
issuer: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
19
|
+
profile: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
20
|
+
key_class: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
21
|
+
key_use: Mapped[str] = acol(storage=S(String(32), nullable=False, index=True))
|
|
22
|
+
algorithm: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
23
|
+
cadence_days: Mapped[int] = acol(storage=S(Integer, nullable=False))
|
|
24
|
+
max_key_age_days: Mapped[int] = acol(storage=S(Integer, nullable=False))
|
|
25
|
+
overlap_seconds: Mapped[int] = acol(storage=S(Integer, nullable=False))
|
|
26
|
+
retirement_seconds: Mapped[int] = acol(storage=S(Integer, nullable=False))
|
|
27
|
+
approval_required: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=False))
|
|
28
|
+
jwks_publish_required: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=True))
|
|
29
|
+
created_by: Mapped[str] = acol(storage=S(String(255), nullable=False))
|
|
30
|
+
reason: Mapped[str] = acol(storage=S(String(1000), nullable=False))
|
|
31
|
+
status: Mapped[str] = acol(storage=S(String(32), nullable=False, default="draft", index=True))
|
|
32
|
+
approved_by: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
33
|
+
approved_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True))
|
|
34
|
+
published_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True))
|
|
35
|
+
supersedes: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
__all__ = ["KeyRotationPolicy"]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Durable logout-propagation state schema."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import datetime as dt
|
|
6
|
+
import uuid
|
|
7
|
+
|
|
8
|
+
from tba_storage_core.framework import (
|
|
9
|
+
Boolean,
|
|
10
|
+
ForeignKeySpec,
|
|
11
|
+
GUIDPk,
|
|
12
|
+
JSON,
|
|
13
|
+
Mapped,
|
|
14
|
+
PgUUID,
|
|
15
|
+
RestOltpTable,
|
|
16
|
+
S,
|
|
17
|
+
String,
|
|
18
|
+
TZDateTime,
|
|
19
|
+
Timestamped,
|
|
20
|
+
acol,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class LogoutState(RestOltpTable, GUIDPk, Timestamped):
|
|
25
|
+
__tablename__ = "logout_state"
|
|
26
|
+
__table_args__ = ({"schema": "authn"},)
|
|
27
|
+
|
|
28
|
+
session_id: Mapped[uuid.UUID | None] = acol(
|
|
29
|
+
storage=S(
|
|
30
|
+
PgUUID(as_uuid=True),
|
|
31
|
+
fk=ForeignKeySpec(target="authn.sessions.id"),
|
|
32
|
+
nullable=True,
|
|
33
|
+
index=True,
|
|
34
|
+
)
|
|
35
|
+
)
|
|
36
|
+
sid: Mapped[str | None] = acol(
|
|
37
|
+
storage=S(String(128), nullable=True, index=True)
|
|
38
|
+
)
|
|
39
|
+
status: Mapped[str] = acol(
|
|
40
|
+
storage=S(String(32), nullable=False, default="pending")
|
|
41
|
+
)
|
|
42
|
+
initiated_by: Mapped[str | None] = acol(
|
|
43
|
+
storage=S(String(64), nullable=True)
|
|
44
|
+
)
|
|
45
|
+
reason: Mapped[str | None] = acol(storage=S(String(128), nullable=True))
|
|
46
|
+
frontchannel_required: Mapped[bool] = acol(
|
|
47
|
+
storage=S(Boolean, nullable=False, default=False)
|
|
48
|
+
)
|
|
49
|
+
backchannel_required: Mapped[bool] = acol(
|
|
50
|
+
storage=S(Boolean, nullable=False, default=False)
|
|
51
|
+
)
|
|
52
|
+
frontchannel_completed_at: Mapped[dt.datetime | None] = acol(
|
|
53
|
+
storage=S(TZDateTime, nullable=True)
|
|
54
|
+
)
|
|
55
|
+
backchannel_completed_at: Mapped[dt.datetime | None] = acol(
|
|
56
|
+
storage=S(TZDateTime, nullable=True)
|
|
57
|
+
)
|
|
58
|
+
propagated_at: Mapped[dt.datetime | None] = acol(
|
|
59
|
+
storage=S(TZDateTime, nullable=True)
|
|
60
|
+
)
|
|
61
|
+
expires_at: Mapped[dt.datetime | None] = acol(
|
|
62
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
63
|
+
)
|
|
64
|
+
logout_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
__all__ = ["LogoutState"]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""Durable machine identity records."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from tba_storage_core.framework import (
|
|
7
|
+
ColumnSpec,
|
|
8
|
+
F,
|
|
9
|
+
GUIDPk,
|
|
10
|
+
IO,
|
|
11
|
+
JSON,
|
|
12
|
+
Mapped,
|
|
13
|
+
RestOltpTable,
|
|
14
|
+
S,
|
|
15
|
+
String,
|
|
16
|
+
Timestamped,
|
|
17
|
+
acol,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class MachineIdentity(RestOltpTable, GUIDPk, Timestamped):
|
|
23
|
+
__tablename__ = "machine_identities"
|
|
24
|
+
__table_args__ = {"extend_existing": True, "schema": "authn"}
|
|
25
|
+
|
|
26
|
+
principal_id: Mapped[str] = acol(
|
|
27
|
+
spec=ColumnSpec(
|
|
28
|
+
storage=S(String(255), nullable=False, unique=True, index=True),
|
|
29
|
+
field=F(constraints={"max_length": 255}, required_in=("create",)),
|
|
30
|
+
io=IO(in_verbs=("create", "update", "replace"), out_verbs=("read", "list"), filter_ops=("eq",)),
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
machine_subject: Mapped[str] = acol(
|
|
34
|
+
spec=ColumnSpec(
|
|
35
|
+
storage=S(String(1000), nullable=False, unique=True, index=True),
|
|
36
|
+
field=F(constraints={"max_length": 1000}, required_in=("create",)),
|
|
37
|
+
io=IO(in_verbs=("create", "update", "replace"), out_verbs=("read", "list"), filter_ops=("eq", "ilike")),
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
tenant_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
41
|
+
realm_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
42
|
+
hardware_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
43
|
+
attestation_type: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
44
|
+
trust_anchor: Mapped[str | None] = acol(storage=S(String(1000), nullable=True))
|
|
45
|
+
status: Mapped[str] = acol(storage=S(String(32), nullable=False, default="active", index=True))
|
|
46
|
+
machine_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
__all__ = ["MachineIdentity"]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Table-owned operator activity log."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import (
|
|
6
|
+
RestOltpTable,
|
|
7
|
+
Integer,
|
|
8
|
+
Mapped,
|
|
9
|
+
S,
|
|
10
|
+
String,
|
|
11
|
+
acol,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class OperatorActivity(RestOltpTable):
|
|
16
|
+
__tablename__ = "operator_activity"
|
|
17
|
+
|
|
18
|
+
id: Mapped[int] = acol(
|
|
19
|
+
storage=S(Integer, primary_key=True, autoincrement=True, nullable=False)
|
|
20
|
+
)
|
|
21
|
+
ts: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
22
|
+
kind: Mapped[str] = acol(storage=S(String(255), nullable=False))
|
|
23
|
+
resource: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
|
|
24
|
+
record_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
25
|
+
status: Mapped[str | None] = acol(storage=S(String(64), nullable=True))
|
|
26
|
+
transaction_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
__all__ = ["OperatorActivity"]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Table-owned operator audit log."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import RestOltpTable, Mapped, S, String, acol
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class OperatorAuditEvent(RestOltpTable):
|
|
9
|
+
__tablename__ = "operator_audit_events"
|
|
10
|
+
|
|
11
|
+
id: Mapped[str] = acol(storage=S(String(255), primary_key=True, nullable=False))
|
|
12
|
+
tenant_id: Mapped[str | None] = acol(
|
|
13
|
+
storage=S(String(255), nullable=True, index=True)
|
|
14
|
+
)
|
|
15
|
+
actor_user_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
16
|
+
actor_client_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
17
|
+
session_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
18
|
+
event_type: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
19
|
+
target_type: Mapped[str] = acol(storage=S(String(128), nullable=False))
|
|
20
|
+
target_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
21
|
+
outcome: Mapped[str] = acol(storage=S(String(64), nullable=False))
|
|
22
|
+
request_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
23
|
+
occurred_at: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
24
|
+
details_json: Mapped[str] = acol(
|
|
25
|
+
storage=S(String(20000), nullable=False, default="{}")
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
__all__ = ["OperatorAuditEvent"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Table-owned operator store metadata."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from tba_storage_core.framework import RestOltpTable, Mapped, S, String, TZDateTime, acol
|
|
8
|
+
from tba_primitives_identity.clock import utc_now
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class OperatorMetadata(RestOltpTable):
|
|
12
|
+
__tablename__ = "operator_metadata"
|
|
13
|
+
|
|
14
|
+
key: Mapped[str] = acol(storage=S(String(255), primary_key=True, nullable=False))
|
|
15
|
+
value_json: Mapped[str] = acol(storage=S(String(8000), nullable=False, default="null"))
|
|
16
|
+
updated_at: Mapped[Any] = acol(storage=S(TZDateTime, nullable=False, default=utc_now))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
__all__ = ["OperatorMetadata"]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Table-owned operator resource records."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import copy
|
|
6
|
+
from typing import Any, Mapping
|
|
7
|
+
|
|
8
|
+
from tba_storage_core.framework import RestOltpTable, Boolean, Mapped, S, String, acol
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _default_status(resource: str) -> str:
|
|
13
|
+
return "staged" if resource in {"keys"} else "active"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class OperatorRecord(RestOltpTable):
|
|
17
|
+
__tablename__ = "operator_records"
|
|
18
|
+
|
|
19
|
+
id: Mapped[str] = acol(storage=S(String(512), primary_key=True, nullable=False))
|
|
20
|
+
resource: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
|
|
21
|
+
record_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
22
|
+
status: Mapped[str] = acol(storage=S(String(64), nullable=False, default="active", index=True))
|
|
23
|
+
enabled: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=True))
|
|
24
|
+
created_at: Mapped[str] = acol(storage=S(String(64), nullable=False))
|
|
25
|
+
updated_at: Mapped[str] = acol(storage=S(String(64), nullable=False))
|
|
26
|
+
actor: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
27
|
+
profile: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
28
|
+
tenant: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
29
|
+
issuer: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
30
|
+
revision: Mapped[int] = acol(storage=S(nullable=False, default=1))
|
|
31
|
+
data_json: Mapped[str] = acol(storage=S(String(20000), nullable=False, default="{}"))
|
|
32
|
+
|
|
33
|
+
@staticmethod
|
|
34
|
+
def store_id(resource: str, record_id: str) -> str:
|
|
35
|
+
return f"{resource}:{record_id}"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _without_revision(record: Mapping[str, Any]) -> dict[str, Any]:
|
|
39
|
+
cleaned = copy.deepcopy(dict(record))
|
|
40
|
+
cleaned.pop("revision", None)
|
|
41
|
+
return cleaned
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
__all__ = ["OperatorRecord"]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Table-owned operator transaction log."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import RestOltpTable, Mapped, S, String, acol
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class OperatorTransaction(RestOltpTable):
|
|
9
|
+
__tablename__ = "operator_transactions"
|
|
10
|
+
|
|
11
|
+
transaction_id: Mapped[str] = acol(
|
|
12
|
+
storage=S(String(255), primary_key=True, nullable=False)
|
|
13
|
+
)
|
|
14
|
+
ts: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
15
|
+
command: Mapped[str] = acol(storage=S(String(255), nullable=False))
|
|
16
|
+
resource: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
|
|
17
|
+
status: Mapped[str] = acol(storage=S(String(64), nullable=False))
|
|
18
|
+
record_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
19
|
+
changed_ids_json: Mapped[str] = acol(
|
|
20
|
+
storage=S(String(8000), nullable=False, default="[]")
|
|
21
|
+
)
|
|
22
|
+
summary_json: Mapped[str] = acol(
|
|
23
|
+
storage=S(String(20000), nullable=False, default="{}")
|
|
24
|
+
)
|
|
25
|
+
actor: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
26
|
+
profile: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
27
|
+
tenant: Mapped[str | None] = acol(storage=S(String(255), nullable=True))
|
|
28
|
+
issuer: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
29
|
+
before_checksum: Mapped[str | None] = acol(storage=S(String(128), nullable=True))
|
|
30
|
+
after_checksum: Mapped[str | None] = acol(storage=S(String(128), nullable=True))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
__all__ = ["OperatorTransaction"]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Durable plugin descriptor registry."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from tba_storage_core.framework import RestOltpTable, GUIDPk, JSON, Mapped, S, String, Timestamped, acol
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PluginDescriptorRecord(RestOltpTable, GUIDPk, Timestamped):
|
|
11
|
+
__tablename__ = "plugin_descriptors"
|
|
12
|
+
__table_args__ = ({"schema": "authn"},)
|
|
13
|
+
|
|
14
|
+
plugin_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
|
|
15
|
+
name: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
16
|
+
version: Mapped[str] = acol(storage=S(String(128), nullable=False))
|
|
17
|
+
isolation_mode: Mapped[str] = acol(storage=S(String(64), nullable=False))
|
|
18
|
+
fail_behavior: Mapped[str] = acol(storage=S(String(64), nullable=False))
|
|
19
|
+
descriptor_payload: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
|
|
20
|
+
status: Mapped[str] = acol(storage=S(String(32), nullable=False, default="enabled", index=True))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
__all__ = ["PluginDescriptorRecord"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Append-only plugin lifecycle events."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from tba_storage_core.framework import RestOltpTable, GUIDPk, JSON, Mapped, S, String, Timestamped, acol
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PluginLifecycleEventRecord(RestOltpTable, GUIDPk, Timestamped):
|
|
11
|
+
__tablename__ = "plugin_lifecycle_events"
|
|
12
|
+
__table_args__ = ({"schema": "authn"},)
|
|
13
|
+
|
|
14
|
+
event_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
|
|
15
|
+
plugin_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
16
|
+
hook_name: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
17
|
+
outcome: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
18
|
+
message: Mapped[str | None] = acol(storage=S(String(2000), nullable=True))
|
|
19
|
+
event_payload: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
__all__ = ["PluginLifecycleEventRecord"]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Durable policy definition records for PAP and PRP surfaces."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import (
|
|
6
|
+
GUIDPk,
|
|
7
|
+
JSON,
|
|
8
|
+
Mapped,
|
|
9
|
+
RestOltpTable,
|
|
10
|
+
S,
|
|
11
|
+
String,
|
|
12
|
+
Timestamped,
|
|
13
|
+
acol,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Policy(RestOltpTable, GUIDPk, Timestamped):
|
|
18
|
+
__tablename__ = "policies"
|
|
19
|
+
__table_args__ = ({"schema": "authn"},)
|
|
20
|
+
|
|
21
|
+
tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
22
|
+
name: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
23
|
+
language: Mapped[str] = acol(storage=S(String(128), nullable=False, default="tba-conditions/v1", index=True))
|
|
24
|
+
description: Mapped[str | None] = acol(storage=S(String(1000), nullable=True))
|
|
25
|
+
status: Mapped[str] = acol(storage=S(String(32), nullable=False, default="draft", index=True))
|
|
26
|
+
active_version_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
27
|
+
policy_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = ["Policy"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Durable dynamic policy conditions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from tba_storage_core.framework import RestOltpTable, GUIDPk, JSON, Mapped, S, String, Timestamped, acol
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PolicyCondition(RestOltpTable, GUIDPk, Timestamped):
|
|
11
|
+
__tablename__ = "policy_conditions"
|
|
12
|
+
__table_args__ = ({"schema": "authn"},)
|
|
13
|
+
|
|
14
|
+
policy_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
15
|
+
field_name: Mapped[str] = acol(storage=S(String(255), nullable=False))
|
|
16
|
+
operator: Mapped[str] = acol(storage=S(String(64), nullable=False))
|
|
17
|
+
expected: Mapped[dict | list | str | int | float | bool | None] = acol(storage=S(JSON, nullable=True))
|
|
18
|
+
condition_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
__all__ = ["PolicyCondition"]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Durable policy set records for XACML-style policy grouping."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import (
|
|
6
|
+
GUIDPk,
|
|
7
|
+
Integer,
|
|
8
|
+
JSON,
|
|
9
|
+
Mapped,
|
|
10
|
+
RestOltpTable,
|
|
11
|
+
S,
|
|
12
|
+
String,
|
|
13
|
+
Timestamped,
|
|
14
|
+
acol,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PolicySet(RestOltpTable, GUIDPk, Timestamped):
|
|
19
|
+
__tablename__ = "policy_sets"
|
|
20
|
+
__table_args__ = ({"schema": "authn"},)
|
|
21
|
+
|
|
22
|
+
tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
23
|
+
name: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
24
|
+
description: Mapped[str | None] = acol(storage=S(String(1000), nullable=True))
|
|
25
|
+
combining_algorithm: Mapped[str] = acol(
|
|
26
|
+
storage=S(String(128), nullable=False, default="deny_overrides", index=True)
|
|
27
|
+
)
|
|
28
|
+
priority: Mapped[int] = acol(storage=S(Integer, nullable=False, default=0, index=True))
|
|
29
|
+
status: Mapped[str] = acol(storage=S(String(32), nullable=False, default="active", index=True))
|
|
30
|
+
policy_set_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
__all__ = ["PolicySet"]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Durable policy set member records."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import (
|
|
6
|
+
GUIDPk,
|
|
7
|
+
Integer,
|
|
8
|
+
JSON,
|
|
9
|
+
Mapped,
|
|
10
|
+
RestOltpTable,
|
|
11
|
+
S,
|
|
12
|
+
String,
|
|
13
|
+
Timestamped,
|
|
14
|
+
acol,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PolicySetMember(RestOltpTable, GUIDPk, Timestamped):
|
|
19
|
+
__tablename__ = "policy_set_members"
|
|
20
|
+
__table_args__ = ({"schema": "authn"},)
|
|
21
|
+
|
|
22
|
+
tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
23
|
+
policy_set_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
24
|
+
member_kind: Mapped[str] = acol(storage=S(String(32), nullable=False, index=True))
|
|
25
|
+
member_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
26
|
+
priority: Mapped[int] = acol(storage=S(Integer, nullable=False, default=0, index=True))
|
|
27
|
+
condition_expression: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
28
|
+
status: Mapped[str] = acol(storage=S(String(32), nullable=False, default="active", index=True))
|
|
29
|
+
member_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
__all__ = ["PolicySetMember"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Durable policy target records."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import (
|
|
6
|
+
GUIDPk,
|
|
7
|
+
Integer,
|
|
8
|
+
JSON,
|
|
9
|
+
Mapped,
|
|
10
|
+
RestOltpTable,
|
|
11
|
+
S,
|
|
12
|
+
String,
|
|
13
|
+
Timestamped,
|
|
14
|
+
acol,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PolicyTarget(RestOltpTable, GUIDPk, Timestamped):
|
|
19
|
+
__tablename__ = "policy_targets"
|
|
20
|
+
__table_args__ = ({"schema": "authn"},)
|
|
21
|
+
|
|
22
|
+
tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
23
|
+
owner_kind: Mapped[str] = acol(storage=S(String(32), nullable=False, index=True))
|
|
24
|
+
owner_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
25
|
+
subject_selector: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
26
|
+
resource_selector: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
27
|
+
action_selector: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
28
|
+
environment_selector: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
29
|
+
scope_selector: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
30
|
+
condition_expression: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
31
|
+
priority: Mapped[int] = acol(storage=S(Integer, nullable=False, default=0, index=True))
|
|
32
|
+
status: Mapped[str] = acol(storage=S(String(32), nullable=False, default="active", index=True))
|
|
33
|
+
target_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
__all__ = ["PolicyTarget"]
|