cadrumo.adapters.outbound.google.records module¶
Pydantic records for the Google OAuth and Drive configuration boundary.
The per-profile Google session persists
adapters.outbound.google.records.OAuthClient,
adapters.outbound.google.records.OAuthToken, and
adapters.outbound.google.records.OAuthMetadata through
adapters.outbound.google.session_store.
adapters.outbound.google.records.DriveConfig stores the Drive root
folder selected for the profile and is read by
adapters.outbound.storage.factory.get_storage_provider() when building the
Drive backend. adapters.outbound.google.records.DriveAppProperties
captures the typed appProperties commit-log schema at the storage boundary.
See adapters.outbound.google.impersonation for
adapters.outbound.google.impersonation.GoogleCredentialSourceSelection, the
per-profile persisted choice of core.google_credential_source.GoogleCredentialSourceKind.
The OAuth scope constants come from core.config.Settings and are
bundled as adapters.outbound.google.records.REQUIRED_SCOPES for login,
refresh, and validation flows. Every record is frozen, strict, and forbids
extra fields.
- class OAuthClient(**data)[source]¶
Bases:
BaseModelOperator-imported Cloud Console Desktop OAuth client metadata.
Carries the JSON the operator downloaded from the Cloud Console after creating a Desktop application OAuth client.
adapters.outbound.google.session_store.save_client()stores this record under the SECRET classification becauseclient_secretis a long-lived credential.client_idandproject_idcan surface in status output for operator orientation.- Parameters:
data (Any)
- client_id: str¶
- client_secret: str¶
- project_id: str¶
- auth_uri: str¶
- token_uri: str¶
- auth_provider_x509_cert_url: str¶
- redirect_uris: tuple[str, ...]¶
- class OAuthToken(**data)[source]¶
Bases:
BaseModelThe refresh credential issued by Google for a per-profile login.
adapters.outbound.google.oauth_flow.run_login_flow()returns this record withadapters.outbound.google.records.OAuthMetadata.adapters.outbound.google.session_store.save_token()persists it under the SECRET classification. The refresh token is re-persisted on every successful refresh because Google may rotate it. Access tokens are held in memory only and rebuilt from the refresh token on process start.- Parameters:
data (Any)
- refresh_token: str¶
- token_uri: str¶
- class OAuthMetadata(**data)[source]¶
Bases:
BaseModelAudit fields surfaced by aeat config google status and refresh policy.
This is the non-secret companion record to
adapters.outbound.google.records.OAuthToken.adapters.outbound.google.session_store.save_metadata()persists which Google account the operator linked, whichadapters.outbound.google.records.REQUIRED_SCOPESthe consent screen granted, when the credential was issued, when it was last refreshed, and whether the most recent refresh hit a hardinvalid_grantrequiring re-consent.- Parameters:
data (Any)
- account_email: str¶
- granted_scopes: tuple[str, ...]¶
- issued_at: UtcInstant¶
- last_refresh_at: UtcInstant¶
- reauth_required: bool¶
- class DriveConfig(**data)[source]¶
Bases:
BaseModelPer-profile Drive backend configuration persisted alongside OAuth records.
adapters.outbound.google.session_store.save_drive_config()persists the operator’s chosencadrumo-vault/parent folder id.adapters.outbound.storage.factory.get_storage_provider()reads it aftercore.config.Settings; theCADRUMO_GOOGLE_DRIVE_ROOT_FOLDER_IDsetting remains an override for one-off and CI runs.- Parameters:
data (Any)
- root_folder_id: str¶