service.auth¶
Identities of the callers of the service and the priorities of their runs.
Identity
¶
Bases: BaseModel
Who calls the service: a person or an agent acting for a person.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of the person or the agent. |
kind |
Literal['person', 'agent']
|
|
owner |
str
|
The person responsible; a person's owner is the person. |
load_tokens
¶
Read the tokens of the service from a YAML mapping of token to identity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The YAML file, e.g. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Identity]
|
The identities by token. |
Raises:
| Type | Description |
|---|---|
ValueError
|
The file is no mapping, or a token is empty. |
authenticate
¶
The identity of a token, compared in constant time; None if unknown.
priority_of
¶
The priority of the runs of an identity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identity
|
Identity
|
The submitting identity. |
required |
owner
|
str
|
The owner of the cluster. |
required |
Returns:
| Type | Description |
|---|---|
Priority
|
|
Priority
|
|