pyslurmutils.client.rest.api.slurm_auth.SlurmAuthManager#
- class pyslurmutils.client.rest.api.slurm_auth.SlurmAuthManager(user_name=None, token=None, renewal_url=None, renewal_margin_seconds=60, renewal_lifespan=3600, renewal_timeout=6, use_env_credentials=True, export_slurm_env_vars=True)[source]#
Bases:
object- Parameters:
user_name (
Optional[str])token (
Optional[str])renewal_url (
Optional[str])renewal_margin_seconds (
int)renewal_lifespan (
int)renewal_timeout (
int)use_env_credentials (
bool)export_slurm_env_vars (
bool)
- headers()[source]#
Returns authentication headers for a SLURM request.
If the current token is expired, a new token is retrieved automatically.
- Return type:
dict- Returns:
Dictionary containing authentication headers
- Raises:
- retry_headers()[source]#
Returns authentication headers for a retry attempt on a SLURM request.
Triggers token renewal if the token is close to expiring (within the configured margin).
- Return type:
Optional[dict]- Returns:
Dictionary containing authentication headers, or None if the token is not renewed
- Raises:
- property user_name: str#