cadrumo.application.auth.operator_scope_ports module¶
Application-owned ports for operator auth storage scoping.
Operator auth policy needs only a narrow bucket-path/lock surface and a read-only observation of the currently bound custody session. The concrete filesystem paths, lock records, and live session objects remain owned by the outward persistence adapters; this module carries the translated records and the capability bundle that application callers require.
- class OperatorScopeBucketPaths(bucket_id, bucket_dir)[source]¶
Bases:
objectThe path facts required to lock one operator-auth bucket.
-
bucket_dir:
Path¶
-
bucket_dir:
- class OperatorScopeSession(bucket_id, storage_root)[source]¶
Bases:
objectThe non-secret identity facts of the currently bound custody session.
- class OperatorScopeStoragePort(*args, **kwargs)[source]¶
Bases:
ProtocolResolve and lock a bucket without exposing persistence DTOs.
- resolve(root, bucket_id)[source]¶
Resolve the bucket directory used by the auth mutation lock.
- Return type:
- Parameters:
- acquire_lock(paths, *, wait_seconds)[source]¶
Acquire the bucket lock or raise an application storage error.
- Return type:
- Parameters:
paths (OperatorScopeBucketPaths)
wait_seconds (float)
- release_lock(paths)[source]¶
Release the bucket lock owned by the current auth mutation.
- Return type:
- Parameters:
paths (OperatorScopeBucketPaths)
- class OperatorScopeSessionPort(*args, **kwargs)[source]¶
Bases:
ProtocolObserve and compare the live custody session for one auth operation.
- serves_bucket(session, bucket_id)[source]¶
Return whether the supplied session serves the exact bucket.
- Return type:
- Parameters:
session (OperatorScopeSession | None)
bucket_id (str)
- class OperatorScopePorts(storage, session)[source]¶
Bases:
objectRequired outward capabilities for operator auth storage scope policy.
- Parameters:
storage (OperatorScopeStoragePort)
session (OperatorScopeSessionPort)
-
storage:
OperatorScopeStoragePort¶
-
session:
OperatorScopeSessionPort¶
- exception OperatorScopeStorageError(*, operation, bucket_id, failure_kind)[source]¶
Bases:
CadrumoErrorTranslated failure from bucket path or lock persistence.
- code¶
- exception OperatorScopeSessionError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
CadrumoErrorTranslated failure while observing the active custody session.
- Parameters:
- Return type:
None
- code¶