steps.api.cloud_objects.cloud_token
Classes
Job token class for job-specific authentication. |
|
Login token class for user authentication. |
|
API key class for API authentication. |
Module Contents
- class steps.api.cloud_objects.cloud_token.JobToken(label: str = None, duration: int = 99999, token_id: int = -1, user_id: int = -1, token: str = '', **kwargs)[source]
Bases:
steps.api.cloud_objects.cloud_base.ACloudObjectJob token class for job-specific authentication.
This class handles the creation and management of tokens used for job operations.
- Parameters:
label – Label for the token
duration – Token duration in seconds
token_id – Token ID (defaults to -1 for new tokens)
user_id – ID of the user the token belongs to
token – Token string
kwargs – Additional attributes to set on the token
- classmethod get_api(context: steps.api.utils.CloudContext) steps.api.utils.Api[source]
- create(context: steps.api.utils.CloudContext, user: steps.api.cloud_objects.cloud_user.User) None[source]
Create this job token in the cloud.
- Parameters:
context – Cloud context for API configuration
user – User providing authentication and owning the token
- Raises:
AssertionError – If the user doesn’t have a login token
RuntimeError – If job token creation fails
- read(context: steps.api.utils.CloudContext, user: steps.api.cloud_objects.cloud_user.User) None[source]
Read this job token’s information from the cloud.
- Parameters:
context – Cloud context for API configuration
user – User providing authentication
- Returns:
Dictionary with token data from response
- Raises:
AssertionError – If the user doesn’t have job tokens or the token wasn’t created
RuntimeError – If reading token data fails
- delete(context: steps.api.utils.CloudContext, user: steps.api.cloud_objects.cloud_user.User) None[source]
Delete this job token from the cloud.
- Parameters:
context – Cloud context for API configuration
user – User providing authentication
- Raises:
AssertionError – If the token wasn’t created
RuntimeError – If deleting the token fails
- classmethod list_all(context: steps.api.utils.CloudContext, admin: steps.api.cloud_objects.cloud_user.User) list[JobToken][source]
List all job tokens in the cloud.
- Parameters:
context – Cloud context for API configuration
admin – Admin user providing authentication
- Returns:
List of JobToken objects
- Raises:
AssertionError – If the user is not an admin
RuntimeError – If listing tokens fails
- class steps.api.cloud_objects.cloud_token.LoginToken[source]
Login token class for user authentication.
This class manages the tokens used for user login and general API access.
- class steps.api.cloud_objects.cloud_token.ApiKey(label: str = None, duration: int = 99999, api_key: str = '', api_key_id: int = -1, **_)[source]
Bases:
steps.api.cloud_objects.cloud_base.ACloudObjectAPI key class for API authentication.
This class handles the creation and management of API keys for worker access.
- classmethod get_api(context: steps.api.utils.CloudContext) steps.api.utils.Api[source]
- create(context: steps.api.utils.CloudContext, admin=None) None[source]
Create this API key in the cloud.
- Parameters:
context – Cloud context for API configuration
admin – Admin user providing authentication
- Raises:
AssertionError – If the user is not an admin
RuntimeError – If API key creation fails