cadrumo.application.auth.operator_probe_ports module

Application-owned capabilities for local operator authentication probes.

The operator probe use case only needs three small observations from the outer runtime: whether an active profile session exists, the health facts of a local certificate bundle, and the kind of a configured Cl@ve identity. Concrete adapter records, enums, and exceptions stay outside this contract; adapters translate them into the closed results declared here.

class CertificateHealthBand(*values)[source]

Bases: StrEnum

Application vocabulary for a certificate’s expiry health.

OK
WARN
CRITICAL
EXPIRED
class CertificateHealthObservation(severity, days_until_expiry)[source]

Bases: object

Translated health facts required by the application probe.

Parameters:
severity: CertificateHealthBand
days_until_expiry: int
class CertificateHealthFailure(detail)[source]

Bases: object

Translated certificate-load failure safe for application projection.

Parameters:

detail (str)

detail: str
class CertificateHealthProbeRequest(path, password, warn_days, critical_days, friendly_name)[source]

Bases: object

Application-owned input for one certificate health observation.

Parameters:
  • path (Path)

  • password (SecretStr)

  • warn_days (int)

  • critical_days (int)

  • friendly_name (str | None)

path: Path
password: SecretStr
warn_days: int
critical_days: int
friendly_name: str | None
class ActiveProfileSessionPresencePort(*args, **kwargs)[source]

Bases: Protocol

Observe whether the storage runtime has an active profile session.

is_bound()[source]

Return whether a profile session is currently bound.

Return type:

bool

class CertificateHealthProbePort(*args, **kwargs)[source]

Bases: Protocol

Obtain translated health or failure facts for one certificate bundle.

evaluate(request)[source]

Evaluate the requested bundle without leaking adapter types.

Return type:

CertificateHealthObservation | CertificateHealthFailure

Parameters:

request (CertificateHealthProbeRequest)

class ClaveIdentityObservation(kind)[source]

Bases: object

Translated accepted Cl@ve identity kind (for example, DNI or NIE).

Parameters:

kind (str)

kind: str
class ClaveIdentityFailure(detail)[source]

Bases: object

Translated Cl@ve identity configuration refusal.

Parameters:

detail (str)

detail: str
class ClaveIdentityProbePort(*args, **kwargs)[source]

Bases: Protocol

Classify a configured Cl@ve identity at the outbound boundary.

classify(raw)[source]

Return an accepted identity kind or a translated configuration fault.

Return type:

ClaveIdentityObservation | ClaveIdentityFailure

Parameters:

raw (str)

class OperatorProbePorts(active_profile_session, certificate_health, clave_identity)[source]

Bases: object

Required outbound capabilities for all operator authentication probes.

Parameters:
active_profile_session: ActiveProfileSessionPresencePort
certificate_health: CertificateHealthProbePort
clave_identity: ClaveIdentityProbePort