Files
zeekay 23138100de refactor: rebrand Infisical Python SDK -> Hanzo KMS Python SDK
- 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.)
2026-02-24 02:00:18 -08:00

39 lines
1.1 KiB
Python

from hanzo_kms.api_types import MachineIdentityLoginResponse
from typing import Callable
from hanzo_kms.kms_requests import KMSRequests
class LdapAuth:
def __init__(self, requests: KMSRequests, setToken: Callable[[str], None]):
self.requests = requests
self.setToken = setToken
def login(self, identity_id: str, username: str, password: str) -> MachineIdentityLoginResponse:
"""
Login with LDAP Auth.
Args:
identity_id (str): Your Machine Identity ID.
username (str): Your LDAP username.
password (str): Your LDAP password.
Returns:
MachineIdentityLoginResponse: A response containing the access token and related information.
"""
requestBody = {
"identityId": identity_id,
"username": username,
"password": password
}
result = self.requests.post(
path="/api/v1/auth/ldap-auth/login",
json=requestBody,
model=MachineIdentityLoginResponse
)
self.setToken(result.data.accessToken)
return result.data