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,124 @@
|
|
|
1
|
+
"""Durable attestation evidence, results, reference material, and policies."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
import datetime as dt
|
|
5
|
+
from tba_storage_core.framework 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 AttestationEvidence(RestOltpTable, GUIDPk, Timestamped):
|
|
20
|
+
__tablename__ = "attestation_evidence"
|
|
21
|
+
__table_args__ = ({"schema": "authn"},)
|
|
22
|
+
evidence_id: Mapped[str] = acol(
|
|
23
|
+
storage=S(String(255), nullable=False, unique=True, index=True)
|
|
24
|
+
)
|
|
25
|
+
profile: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
26
|
+
format: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
27
|
+
issuer: Mapped[str | None] = acol(
|
|
28
|
+
storage=S(String(1000), nullable=True, index=True)
|
|
29
|
+
)
|
|
30
|
+
artifact_locator: Mapped[str] = acol(storage=S(String(1000), nullable=False))
|
|
31
|
+
evidence_digest: Mapped[str] = acol(
|
|
32
|
+
storage=S(String(128), nullable=False, index=True)
|
|
33
|
+
)
|
|
34
|
+
expires_at: Mapped[dt.datetime | None] = acol(
|
|
35
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class AttestationResult(RestOltpTable, GUIDPk, Timestamped):
|
|
40
|
+
__tablename__ = "attestation_results"
|
|
41
|
+
__table_args__ = ({"schema": "authn"},)
|
|
42
|
+
evidence_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
43
|
+
policy_id: Mapped[str | None] = acol(
|
|
44
|
+
storage=S(String(255), nullable=True, index=True)
|
|
45
|
+
)
|
|
46
|
+
trusted: Mapped[bool] = acol(storage=S(Boolean, nullable=False, index=True))
|
|
47
|
+
reason: Mapped[str] = acol(storage=S(String(1000), nullable=False))
|
|
48
|
+
result_claims: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
49
|
+
appraised_at: Mapped[dt.datetime | None] = acol(
|
|
50
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class AttestationReferenceManifest(RestOltpTable, GUIDPk, Timestamped):
|
|
55
|
+
__tablename__ = "attestation_reference_manifests"
|
|
56
|
+
__table_args__ = ({"schema": "authn"},)
|
|
57
|
+
manifest_id: Mapped[str] = acol(
|
|
58
|
+
storage=S(String(255), nullable=False, unique=True, index=True)
|
|
59
|
+
)
|
|
60
|
+
profile: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
61
|
+
format: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
62
|
+
artifact_locator: Mapped[str] = acol(storage=S(String(1000), nullable=False))
|
|
63
|
+
artifact_digest: Mapped[str] = acol(
|
|
64
|
+
storage=S(String(128), nullable=False, index=True)
|
|
65
|
+
)
|
|
66
|
+
signer: Mapped[str | None] = acol(
|
|
67
|
+
storage=S(String(1000), nullable=True, index=True)
|
|
68
|
+
)
|
|
69
|
+
valid_until: Mapped[dt.datetime | None] = acol(
|
|
70
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class AttestationReferenceValue(RestOltpTable, GUIDPk, Timestamped):
|
|
75
|
+
__tablename__ = "attestation_reference_values"
|
|
76
|
+
__table_args__ = ({"schema": "authn"},)
|
|
77
|
+
manifest_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
78
|
+
environment: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
79
|
+
measurement_id: Mapped[str] = acol(
|
|
80
|
+
storage=S(String(255), nullable=False, index=True)
|
|
81
|
+
)
|
|
82
|
+
algorithm: Mapped[str] = acol(storage=S(String(64), nullable=False))
|
|
83
|
+
digest: Mapped[str] = acol(storage=S(String(256), nullable=False, index=True))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class AttestationEndorsement(RestOltpTable, GUIDPk, Timestamped):
|
|
87
|
+
__tablename__ = "attestation_endorsements"
|
|
88
|
+
__table_args__ = ({"schema": "authn"},)
|
|
89
|
+
endorsement_id: Mapped[str] = acol(
|
|
90
|
+
storage=S(String(255), nullable=False, unique=True, index=True)
|
|
91
|
+
)
|
|
92
|
+
profile: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
93
|
+
issuer: Mapped[str] = acol(storage=S(String(1000), nullable=False, index=True))
|
|
94
|
+
artifact_locator: Mapped[str] = acol(storage=S(String(1000), nullable=False))
|
|
95
|
+
artifact_digest: Mapped[str] = acol(
|
|
96
|
+
storage=S(String(128), nullable=False, index=True)
|
|
97
|
+
)
|
|
98
|
+
valid_until: Mapped[dt.datetime | None] = acol(
|
|
99
|
+
storage=S(TZDateTime, nullable=True, index=True)
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class AttestationAppraisalPolicy(RestOltpTable, GUIDPk, Timestamped):
|
|
104
|
+
__tablename__ = "attestation_appraisal_policies"
|
|
105
|
+
__table_args__ = ({"schema": "authn"},)
|
|
106
|
+
policy_id: Mapped[str] = acol(
|
|
107
|
+
storage=S(String(255), nullable=False, unique=True, index=True)
|
|
108
|
+
)
|
|
109
|
+
profile: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
110
|
+
version: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
111
|
+
policy: Mapped[dict] = acol(storage=S(JSON, nullable=False))
|
|
112
|
+
enabled: Mapped[bool] = acol(
|
|
113
|
+
storage=S(Boolean, nullable=False, default=True, index=True)
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
__all__ = [
|
|
118
|
+
"AttestationEvidence",
|
|
119
|
+
"AttestationResult",
|
|
120
|
+
"AttestationReferenceManifest",
|
|
121
|
+
"AttestationReferenceValue",
|
|
122
|
+
"AttestationEndorsement",
|
|
123
|
+
"AttestationAppraisalPolicy",
|
|
124
|
+
]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Durable ABAC policy definitions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from tba_storage_core.framework import (
|
|
7
|
+
RestOltpTable,
|
|
8
|
+
GUIDPk,
|
|
9
|
+
JSON,
|
|
10
|
+
Mapped,
|
|
11
|
+
S,
|
|
12
|
+
String,
|
|
13
|
+
Timestamped,
|
|
14
|
+
acol,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class AttributePolicy(RestOltpTable, GUIDPk, Timestamped):
|
|
19
|
+
__tablename__ = "attribute_policies"
|
|
20
|
+
__table_args__ = ({"schema": "authn"},)
|
|
21
|
+
|
|
22
|
+
name: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
23
|
+
tenant_id: Mapped[str | None] = acol(
|
|
24
|
+
storage=S(String(255), nullable=True, index=True)
|
|
25
|
+
)
|
|
26
|
+
client_id: Mapped[str | None] = acol(
|
|
27
|
+
storage=S(String(255), nullable=True, index=True)
|
|
28
|
+
)
|
|
29
|
+
permission: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
30
|
+
effect: Mapped[str] = acol(
|
|
31
|
+
storage=S(String(32), nullable=False, default="allow", index=True)
|
|
32
|
+
)
|
|
33
|
+
required_attributes: Mapped[dict] = acol(
|
|
34
|
+
storage=S(JSON, nullable=False, default=dict)
|
|
35
|
+
)
|
|
36
|
+
status: Mapped[str] = acol(
|
|
37
|
+
storage=S(String(32), nullable=False, default="active", index=True)
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
__all__ = ["AttributePolicy"]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Durable audit events for operator and protocol actions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import datetime as dt
|
|
6
|
+
import uuid
|
|
7
|
+
|
|
8
|
+
from tba_storage_core.framework import (
|
|
9
|
+
RestOltpTable,
|
|
10
|
+
TenantColumn,
|
|
11
|
+
Timestamped,
|
|
12
|
+
S,
|
|
13
|
+
acol,
|
|
14
|
+
JSON,
|
|
15
|
+
Mapped,
|
|
16
|
+
String,
|
|
17
|
+
TZDateTime,
|
|
18
|
+
GUIDPk,
|
|
19
|
+
ForeignKeySpec,
|
|
20
|
+
PgUUID,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class AuditEvent(RestOltpTable, GUIDPk, Timestamped, TenantColumn):
|
|
25
|
+
__tablename__ = "audit_events"
|
|
26
|
+
__table_args__ = ({"schema": "authn"},)
|
|
27
|
+
|
|
28
|
+
actor_user_id: Mapped[uuid.UUID | None] = acol(
|
|
29
|
+
storage=S(PgUUID(as_uuid=True), fk=ForeignKeySpec(target="authn.users.id"), nullable=True, index=True)
|
|
30
|
+
)
|
|
31
|
+
actor_client_id: Mapped[uuid.UUID | None] = acol(
|
|
32
|
+
storage=S(PgUUID(as_uuid=True), fk=ForeignKeySpec(target="authn.clients.id"), nullable=True, index=True)
|
|
33
|
+
)
|
|
34
|
+
session_id: Mapped[uuid.UUID | None] = acol(
|
|
35
|
+
storage=S(PgUUID(as_uuid=True), fk=ForeignKeySpec(target="authn.sessions.id"), nullable=True, index=True)
|
|
36
|
+
)
|
|
37
|
+
event_type: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
|
|
38
|
+
target_type: Mapped[str | None] = acol(storage=S(String(64), nullable=True))
|
|
39
|
+
target_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
40
|
+
outcome: Mapped[str] = acol(storage=S(String(32), nullable=False, default="success"))
|
|
41
|
+
request_id: Mapped[str | None] = acol(storage=S(String(128), nullable=True, index=True))
|
|
42
|
+
details: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
43
|
+
occurred_at: Mapped[dt.datetime] = acol(
|
|
44
|
+
storage=S(TZDateTime, nullable=False, default=lambda: dt.datetime.now(dt.timezone.utc))
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
__all__ = ["AuditEvent"]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from . import _table as _table
|
|
4
|
+
from ._table import *
|
|
5
|
+
|
|
6
|
+
for _name in dir(_table):
|
|
7
|
+
if not _name.startswith("__"):
|
|
8
|
+
globals().setdefault(_name, getattr(_table, _name))
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
__all__ = list(_table.__all__)
|
|
12
|
+
except AttributeError:
|
|
13
|
+
__all__ = [name for name in globals() if not name.startswith("_")]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Authorization code durable table."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import datetime as dt
|
|
6
|
+
from tba_storage_core.framework import (
|
|
7
|
+
ForeignKeySpec,
|
|
8
|
+
GUIDPk,
|
|
9
|
+
JSON,
|
|
10
|
+
Mapped,
|
|
11
|
+
PgUUID,
|
|
12
|
+
RestOltpTable,
|
|
13
|
+
S,
|
|
14
|
+
String,
|
|
15
|
+
TZDateTime,
|
|
16
|
+
TenantColumn,
|
|
17
|
+
Timestamped,
|
|
18
|
+
UUID,
|
|
19
|
+
UserColumn,
|
|
20
|
+
acol,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class AuthCode(RestOltpTable, GUIDPk, Timestamped, UserColumn, TenantColumn):
|
|
25
|
+
__tablename__ = "auth_codes"
|
|
26
|
+
__table_args__ = ({"schema": "authn"},)
|
|
27
|
+
|
|
28
|
+
client_id: Mapped[UUID] = acol(
|
|
29
|
+
storage=S(PgUUID(as_uuid=True), fk=ForeignKeySpec(target="authn.clients.id"), nullable=False)
|
|
30
|
+
)
|
|
31
|
+
session_id: Mapped[UUID | None] = acol(
|
|
32
|
+
storage=S(PgUUID(as_uuid=True), fk=ForeignKeySpec(target="authn.sessions.id"), nullable=True, index=True)
|
|
33
|
+
)
|
|
34
|
+
redirect_uri: Mapped[str] = acol(storage=S(String(1000), nullable=False))
|
|
35
|
+
code_challenge: Mapped[str | None] = acol(storage=S(String, nullable=True))
|
|
36
|
+
nonce: Mapped[str | None] = acol(storage=S(String, nullable=True))
|
|
37
|
+
scope: Mapped[str | None] = acol(storage=S(String, nullable=True))
|
|
38
|
+
expires_at: Mapped[dt.datetime] = acol(storage=S(TZDateTime, nullable=False))
|
|
39
|
+
claims: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
40
|
+
|
|
41
|
+
__all__ = ["AuthCode"]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from . import _table as _table
|
|
4
|
+
from ._table import *
|
|
5
|
+
|
|
6
|
+
for _name in dir(_table):
|
|
7
|
+
if not _name.startswith("__"):
|
|
8
|
+
globals().setdefault(_name, getattr(_table, _name))
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
__all__ = list(_table.__all__)
|
|
12
|
+
except AttributeError:
|
|
13
|
+
__all__ = [name for name in globals() if not name.startswith("_")]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Authentication session model with durable browser-session cookie state."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import datetime as dt
|
|
6
|
+
|
|
7
|
+
from tba_storage_core.framework import (
|
|
8
|
+
RestOltpTable,
|
|
9
|
+
TenantColumn,
|
|
10
|
+
Timestamped,
|
|
11
|
+
UserColumn,
|
|
12
|
+
S,
|
|
13
|
+
acol,
|
|
14
|
+
Mapped,
|
|
15
|
+
String,
|
|
16
|
+
TZDateTime,
|
|
17
|
+
GUIDPk,
|
|
18
|
+
ForeignKeySpec,
|
|
19
|
+
PgUUID,
|
|
20
|
+
UUID,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class AuthSession(RestOltpTable, GUIDPk, Timestamped, UserColumn, TenantColumn):
|
|
25
|
+
__tablename__ = "sessions"
|
|
26
|
+
__table_args__ = ({"schema": "authn"},)
|
|
27
|
+
|
|
28
|
+
username: Mapped[str] = acol(storage=S(String(120), nullable=False))
|
|
29
|
+
client_id: Mapped[UUID | None] = acol(
|
|
30
|
+
storage=S(PgUUID(as_uuid=True), fk=ForeignKeySpec(target="authn.clients.id"), nullable=True, index=True)
|
|
31
|
+
)
|
|
32
|
+
auth_time: Mapped[dt.datetime] = acol(
|
|
33
|
+
storage=S(TZDateTime, nullable=False, default=lambda: dt.datetime.now(dt.timezone.utc))
|
|
34
|
+
)
|
|
35
|
+
session_state: Mapped[str] = acol(storage=S(String(64), nullable=False, default="active"))
|
|
36
|
+
session_state_salt: Mapped[str | None] = acol(storage=S(String(128), nullable=True))
|
|
37
|
+
cookie_secret_hash: Mapped[str | None] = acol(storage=S(String(128), nullable=True, index=True))
|
|
38
|
+
cookie_issued_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True))
|
|
39
|
+
cookie_rotated_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True))
|
|
40
|
+
expires_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True, index=True))
|
|
41
|
+
last_seen_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True))
|
|
42
|
+
ended_at: Mapped[dt.datetime | None] = acol(storage=S(TZDateTime, nullable=True, index=True))
|
|
43
|
+
logout_reason: Mapped[str | None] = acol(storage=S(String(128), nullable=True))
|
|
44
|
+
|
|
45
|
+
__all__ = ["AuthSession"]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Durable advanced-authentication challenge records."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import datetime as dt
|
|
6
|
+
|
|
7
|
+
from tba_storage_core.framework import (
|
|
8
|
+
Boolean,
|
|
9
|
+
GUIDPk,
|
|
10
|
+
JSON,
|
|
11
|
+
Mapped,
|
|
12
|
+
RestOltpTable,
|
|
13
|
+
S,
|
|
14
|
+
String,
|
|
15
|
+
TZDateTime,
|
|
16
|
+
Timestamped,
|
|
17
|
+
acol,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AuthenticationChallenge(RestOltpTable, GUIDPk, Timestamped):
|
|
22
|
+
__tablename__ = "authentication_challenges"
|
|
23
|
+
__table_args__ = {"extend_existing": True, "schema": "authn"}
|
|
24
|
+
|
|
25
|
+
challenge_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
|
|
26
|
+
subject_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
27
|
+
tenant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, index=True))
|
|
28
|
+
challenge_kind: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
29
|
+
expected_nonce: Mapped[str] = acol(storage=S(String(255), nullable=False))
|
|
30
|
+
issued_at: Mapped[dt.datetime] = acol(storage=S(TZDateTime, nullable=False, index=True))
|
|
31
|
+
expires_at: Mapped[dt.datetime] = acol(storage=S(TZDateTime, nullable=False, index=True))
|
|
32
|
+
allowed_methods: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
33
|
+
step_up_required: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=False, index=True))
|
|
34
|
+
bound_credential_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
35
|
+
consumed: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=False, index=True))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
__all__ = ["AuthenticationChallenge"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Authority derivation graph table exports."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from ._table import (
|
|
6
|
+
AuthorityDerivationGraph,
|
|
7
|
+
AuthorityDerivationGraphEdge,
|
|
8
|
+
AuthorityDerivationGraphNode,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"AuthorityDerivationGraph",
|
|
13
|
+
"AuthorityDerivationGraphNode",
|
|
14
|
+
"AuthorityDerivationGraphEdge",
|
|
15
|
+
]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""Durable authority derivation graph tables."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from sqlalchemy import Index, UniqueConstraint
|
|
6
|
+
|
|
7
|
+
from tba_storage_core.framework import (
|
|
8
|
+
ForeignKeySpec,
|
|
9
|
+
GUIDPk,
|
|
10
|
+
JSON,
|
|
11
|
+
Mapped,
|
|
12
|
+
PgUUID,
|
|
13
|
+
S,
|
|
14
|
+
String,
|
|
15
|
+
UUID,
|
|
16
|
+
acol,
|
|
17
|
+
)
|
|
18
|
+
from tba_storage_core.tables._graph_base import GraphBase, GraphEdgeBase, GraphNodeBase
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AuthorityDerivationGraph(GraphBase, GUIDPk):
|
|
22
|
+
__tablename__ = "authority_derivation_graphs"
|
|
23
|
+
__table_args__ = (
|
|
24
|
+
UniqueConstraint("graph_key", name="uq_authority_derivation_graph_key"),
|
|
25
|
+
{"extend_existing": True, "schema": "authn"},
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class AuthorityDerivationGraphNode(GraphNodeBase, GUIDPk):
|
|
30
|
+
__tablename__ = "authority_derivation_graph_nodes"
|
|
31
|
+
__table_args__ = (
|
|
32
|
+
UniqueConstraint("graph_id", "node_key", name="uq_authority_derivation_graph_node_key"),
|
|
33
|
+
Index("ix_authority_derivation_graph_node_graph_kind", "graph_id", "kind"),
|
|
34
|
+
Index("ix_authority_derivation_graph_node_tenant_kind", "tenant_id", "kind"),
|
|
35
|
+
{"extend_existing": True, "schema": "authn"},
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
graph_id: Mapped[UUID] = acol(
|
|
39
|
+
storage=S(
|
|
40
|
+
PgUUID(as_uuid=True),
|
|
41
|
+
fk=ForeignKeySpec(target="authn.authority_derivation_graphs.id"),
|
|
42
|
+
nullable=False,
|
|
43
|
+
index=True,
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class AuthorityDerivationGraphEdge(GraphEdgeBase, GUIDPk):
|
|
49
|
+
__tablename__ = "authority_derivation_graph_edges"
|
|
50
|
+
__table_args__ = (
|
|
51
|
+
UniqueConstraint("graph_id", "edge_key", name="uq_authority_derivation_graph_edge_key"),
|
|
52
|
+
Index("ix_authority_derivation_graph_edge_src_kind", "graph_id", "src_id", "kind"),
|
|
53
|
+
Index("ix_authority_derivation_graph_edge_dst_kind", "graph_id", "dst_id", "kind"),
|
|
54
|
+
Index("ix_authority_derivation_graph_edge_tenant_kind", "tenant_id", "kind"),
|
|
55
|
+
{"extend_existing": True, "schema": "authn"},
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
graph_id: Mapped[UUID] = acol(
|
|
59
|
+
storage=S(
|
|
60
|
+
PgUUID(as_uuid=True),
|
|
61
|
+
fk=ForeignKeySpec(target="authn.authority_derivation_graphs.id"),
|
|
62
|
+
nullable=False,
|
|
63
|
+
index=True,
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
src_id: Mapped[UUID] = acol(
|
|
67
|
+
storage=S(
|
|
68
|
+
PgUUID(as_uuid=True),
|
|
69
|
+
fk=ForeignKeySpec(target="authn.authority_derivation_graph_nodes.id"),
|
|
70
|
+
nullable=False,
|
|
71
|
+
index=True,
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
dst_id: Mapped[UUID] = acol(
|
|
75
|
+
storage=S(
|
|
76
|
+
PgUUID(as_uuid=True),
|
|
77
|
+
fk=ForeignKeySpec(target="authn.authority_derivation_graph_nodes.id"),
|
|
78
|
+
nullable=False,
|
|
79
|
+
index=True,
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
policy_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
83
|
+
policy_version_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
84
|
+
policy_version: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
85
|
+
provenance_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
86
|
+
scopes: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
87
|
+
constraints: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
__all__ = [
|
|
91
|
+
"AuthorityDerivationGraph",
|
|
92
|
+
"AuthorityDerivationGraphNode",
|
|
93
|
+
"AuthorityDerivationGraphEdge",
|
|
94
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Durable authorization invariant definitions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import (
|
|
6
|
+
Boolean,
|
|
7
|
+
GUIDPk,
|
|
8
|
+
JSON,
|
|
9
|
+
Mapped,
|
|
10
|
+
RestOltpTable,
|
|
11
|
+
S,
|
|
12
|
+
String,
|
|
13
|
+
Timestamped,
|
|
14
|
+
acol,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class AuthorizationInvariant(RestOltpTable, GUIDPk, Timestamped):
|
|
19
|
+
__tablename__ = "authorization_invariants"
|
|
20
|
+
__table_args__ = ({"schema": "authn"},)
|
|
21
|
+
|
|
22
|
+
invariant_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
|
|
23
|
+
title: Mapped[str] = acol(storage=S(String(255), nullable=False))
|
|
24
|
+
property_family: Mapped[str] = acol(storage=S(String(128), nullable=False, index=True))
|
|
25
|
+
statement: Mapped[str] = acol(storage=S(String(2000), nullable=False))
|
|
26
|
+
verification_method: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
27
|
+
severity: Mapped[str] = acol(storage=S(String(64), nullable=False, default="error", index=True))
|
|
28
|
+
enabled: Mapped[bool] = acol(storage=S(Boolean, nullable=False, default=True, index=True))
|
|
29
|
+
feature_ids: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
|
|
30
|
+
spec_ids: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
|
|
31
|
+
tags: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
__all__ = ["AuthorizationInvariant"]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Durable authorization-server configuration and metadata state."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import uuid
|
|
6
|
+
|
|
7
|
+
from tba_storage_core.framework import (
|
|
8
|
+
ForeignKeySpec,
|
|
9
|
+
GUIDPk,
|
|
10
|
+
JSON,
|
|
11
|
+
Mapped,
|
|
12
|
+
PgUUID,
|
|
13
|
+
RestOltpTable,
|
|
14
|
+
S,
|
|
15
|
+
String,
|
|
16
|
+
Timestamped,
|
|
17
|
+
acol,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AuthorizationServer(RestOltpTable, GUIDPk, Timestamped):
|
|
22
|
+
__tablename__ = "authorization_servers"
|
|
23
|
+
__table_args__ = ({"schema": "authn"},)
|
|
24
|
+
|
|
25
|
+
issuer: Mapped[str] = acol(storage=S(String(512), nullable=False, unique=True, index=True))
|
|
26
|
+
tenant_id: Mapped[uuid.UUID | None] = acol(
|
|
27
|
+
storage=S(
|
|
28
|
+
PgUUID(as_uuid=True),
|
|
29
|
+
fk=ForeignKeySpec(target="authn.tenants.id"),
|
|
30
|
+
nullable=True,
|
|
31
|
+
index=True,
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
realm_id: Mapped[uuid.UUID | None] = acol(
|
|
35
|
+
storage=S(
|
|
36
|
+
PgUUID(as_uuid=True),
|
|
37
|
+
fk=ForeignKeySpec(target="authn.realms.id"),
|
|
38
|
+
nullable=True,
|
|
39
|
+
index=True,
|
|
40
|
+
)
|
|
41
|
+
)
|
|
42
|
+
status: Mapped[str] = acol(storage=S(String(64), nullable=False, default="active", index=True))
|
|
43
|
+
authorization_endpoint: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
44
|
+
token_endpoint: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
45
|
+
jwks_uri: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
46
|
+
introspection_endpoint: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
47
|
+
revocation_endpoint: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
48
|
+
registration_endpoint: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
49
|
+
userinfo_endpoint: Mapped[str | None] = acol(storage=S(String(512), nullable=True))
|
|
50
|
+
server_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
51
|
+
oauth_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
52
|
+
oidc_metadata: Mapped[dict | None] = acol(storage=S(JSON, nullable=True))
|
|
53
|
+
scopes_supported: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
54
|
+
response_types_supported: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
55
|
+
grant_types_supported: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
56
|
+
token_endpoint_auth_methods_supported: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
57
|
+
subject_types_supported: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
58
|
+
signing_alg_values_supported: Mapped[list | None] = acol(storage=S(JSON, nullable=True))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
__all__ = ["AuthorizationServer"]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Durable authorization verification report artifacts."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from tba_storage_core.framework import (
|
|
6
|
+
RestOltpTable,
|
|
7
|
+
Boolean,
|
|
8
|
+
GUIDPk,
|
|
9
|
+
JSON,
|
|
10
|
+
Mapped,
|
|
11
|
+
S,
|
|
12
|
+
String,
|
|
13
|
+
Timestamped,
|
|
14
|
+
acol,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class AuthzVerificationReport(RestOltpTable, GUIDPk, Timestamped):
|
|
19
|
+
__tablename__ = "authz_verification_reports"
|
|
20
|
+
__table_args__ = ({"schema": "authn"},)
|
|
21
|
+
|
|
22
|
+
report_id: Mapped[str] = acol(storage=S(String(255), nullable=False, unique=True, index=True))
|
|
23
|
+
report_kind: Mapped[str] = acol(storage=S(String(64), nullable=False, index=True))
|
|
24
|
+
tenant_id: Mapped[str | None] = acol(storage=S(String(255), nullable=True, index=True))
|
|
25
|
+
passed: Mapped[bool | None] = acol(storage=S(Boolean, nullable=True, index=True))
|
|
26
|
+
report_payload: Mapped[dict] = acol(storage=S(JSON, nullable=False, default=dict))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
__all__ = ["AuthzVerificationReport"]
|