judgevet.adapters.inbound.credentials
Status: draft.
judgevet.adapters.inbound.credentials
Select credential sources without putting resolved secrets in diagnostics.
Settings construction performs no IO. Composition roots call the resolver once and unwrap the result only in the adapter constructor expression.
Examples:
from pydantic import SecretStr
from judgevet.adapters.inbound.credentials import resolve_key
assert resolve_key(SecretStr("literal"), None, 5.0) == SecretStr("literal")
See Also
- judgevet.adapters.inbound.settings: Credential source configuration.
- judgevet.adapters.inbound.credential_command: Bounded command execution.
resolve_key(key, key_file, timeout, explicit=None)
Resolve explicit, literal, file and command sources in that order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
SecretStr | None
|
Wrapped literal key or exclamation-prefixed command. |
required |
key_file
|
str | None
|
Optional mounted credential file. |
required |
timeout
|
float
|
Validated command deadline in seconds. |
required |
explicit
|
str | None
|
Optional literal override; None leaves settings in control. |
None
|
Returns:
| Type | Description |
|---|---|
SecretStr | None
|
Wrapped credential, or None when no source is configured. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the selected file or command source fails. |