OCDocker.Workbench.Auth module¶
Bearer-token resolution for execute-capable Workbench API endpoints
(/api/jobs*). The token is read from OCDOCKER_WORKBENCH_TOKEN or
~/.config/ocdocker/workbench_token, generating the latter on first use.
Bearer-token authentication for execute-capable Workbench API endpoints.
- OCDocker.Workbench.Auth.resolve_workbench_job_token(*, create=True)[source]¶
Resolve the bearer token that gates Workbench job-execute endpoints.
Resolution order: the
OCDOCKER_WORKBENCH_TOKENenvironment variable, then the token file, then (whencreateis True) a freshly generated token persisted to the token file.- Parameters:
create (bool) – Generate and persist a new token when none is configured yet.
- Returns:
Resolved bearer token.
- Return type:
str
- Raises:
FileNotFoundError – If no token is configured and
createis False.