cadrumo.application.auth.operator_cleanup module

Canonical durable auth cleanup planning and application helpers.

provider_kind(provider_id)[source]

Resolve a provider id without accepting unknown values.

Return type:

AuthProviderKind | None

Parameters:

provider_id (str)

delete_scoped_sessions(settings, provider_ids, *, bucket_id)[source]

Delete sessions for the requested providers within one profile bucket.

Return type:

tuple[int, tuple[str, ...]]

Parameters:
clear_scoped_locks(settings, provider_ids, *, bucket_id, allow_held=False)[source]

Clear acquisition locks for the requested providers and bucket.

Return type:

tuple[int, tuple[str, ...]]

Parameters:
clear_operator_auth_acquisition_locks(settings, *, bucket_id, allow_held=False)[source]

Clear every provider’s acquisition lock for bucket_id without its key.

The lock is a plaintext file under the token directory, outside the profile capsule, so clearing it needs no custody session – and destroying the capsule does not reap it, which is why a caller erasing a profile clears it explicitly rather than leaving it to the deletion.

Every provider kind is swept because the workflow state naming the configured provider lives INSIDE the capsule and is unreadable while the profile is locked. Clearing an absent lock is a no-op, so the sweep costs a stat per kind and reports only the locks that were actually there.

Return type:

tuple[str, ...]

Returns:

The provider ids whose lock was present and has been cleared.

Parameters:
delete_certificate_source_secrets(*, certificate_secret_backend_factory, settings, bucket_id, names)[source]

Delete the named certificate secrets from one bucket’s secure backend.

Return type:

int

Parameters:
assert_logout_request_matches(intent, *, provider, all_providers)[source]

Refuse when a durable logout intent differs from the current request.

Return type:

None

Parameters:
auth_cleanup_intent_has_effects(intent)[source]

Return whether a durable cleanup intent still names removable state.

Return type:

bool

Parameters:

intent (AuthCleanupIntent)

assert_reset_request_matches(intent, *, provider, all_providers)[source]

Refuse when a durable reset intent differs from the current request.

Return type:

None

Parameters:
build_auth_cleanup_intent(*, certificate_secret_backend_factory, settings, bucket_id, auth, provider_ids, all_providers, operation_kind, started_at)[source]
Return type:

AuthCleanupIntent

Parameters:
apply_auth_cleanup_intent(auth, intent)[source]

Apply one validated cleanup intent to the encrypted auth state.

Return type:

tuple[AuthState, tuple[str, ...], tuple[str, ...]]

Parameters:
auth_cleanup_bucket_events(*, intent, provider_ids, certificate_names)[source]

Project durable bucket events for one completed auth cleanup intent.

Return type:

tuple[AuthBucketEventSpec, ...]

Parameters: