mirror of
https://github.com/hanzokms/python-sdk.git
synced 2026-10-30 20:30:11 +00:00
- Rename package: infisical_sdk -> hanzo_kms (pip: hanzokms) - Rename classes: InfisicalSDKClient -> KMSClient, InfisicalRequests -> KMSRequests, InfisicalError -> KMSError - Default API host: https://kms.hanzo.ai - Update all imports, docstrings, and user-facing strings - Copyright: Hanzo AI Inc. - Backward-compatible aliases: InfisicalSDKClient, InfisicalError - Env var: INFISICAL_AWS_IAM_AUTH_IDENTITY_ID -> HANZO_KMS_AWS_IAM_AUTH_IDENTITY_ID - Remove obsolete OpenAPI generator files (.travis.yml, .gitlab-ci.yml, etc.)
22 lines
662 B
Python
22 lines
662 B
Python
from typing import Callable
|
|
|
|
class TokenAuth:
|
|
def __init__(self, setToken: Callable[[str], None]):
|
|
self.setToken = setToken
|
|
|
|
def login(self, token: str) -> str:
|
|
"""
|
|
Authenticate using a token. This can be either a machine identity token or a user JWT token.
|
|
|
|
Machine Identity Token: Generated from Token Auth method in Hanzo KMS.
|
|
User JWT Token: A valid JWT token for user authentication.
|
|
|
|
Args:
|
|
token (str): Your authentication token (machine identity token or user JWT).
|
|
|
|
Returns:
|
|
str: The token that was set.
|
|
"""
|
|
self.setToken(token)
|
|
return token
|