mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
kms: use canonical KMS env + client names
This commit is contained in:
@@ -139,13 +139,6 @@ client = KMSClient(ClientSettings(
|
||||
This SDK is compatible with:
|
||||
- Hanzo KMS (https://kms.hanzo.ai)
|
||||
- Lux KMS (https://kms.lux.network)
|
||||
- Infisical (https://infisical.com)
|
||||
|
||||
The `InfisicalClient` alias is provided for drop-in compatibility:
|
||||
|
||||
```python
|
||||
from hanzo_kms import InfisicalClient # Same as KMSClient
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Hanzo KMS - Secret Management SDK for Python
|
||||
|
||||
A pure Python SDK for Hanzo/Lux KMS (compatible with Infisical API).
|
||||
A pure Python SDK for Hanzo/Lux KMS.
|
||||
|
||||
Usage:
|
||||
from hanzo_kms import KMSClient, ClientSettings, UniversalAuthMethod, AuthenticationOptions
|
||||
@@ -54,16 +54,10 @@ from .models import (
|
||||
UserPasswordAuthMethod,
|
||||
)
|
||||
|
||||
# Aliases for compatibility with infisical-python
|
||||
InfisicalClient = KMSClient
|
||||
AsyncInfisicalClient = AsyncKMSClient
|
||||
|
||||
__all__ = [
|
||||
# Main clients
|
||||
"KMSClient",
|
||||
"AsyncKMSClient",
|
||||
"InfisicalClient", # Alias for compatibility
|
||||
"AsyncInfisicalClient", # Async alias
|
||||
# Settings
|
||||
"ClientSettings",
|
||||
"AuthenticationOptions",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Hanzo KMS Async Client - Async Python implementation
|
||||
|
||||
An async-first KMS client compatible with Infisical API.
|
||||
An async-first Hanzo KMS client.
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -48,16 +48,10 @@ class AsyncKMSClient:
|
||||
"""Create settings from environment variables."""
|
||||
from .models import UniversalAuthMethod
|
||||
|
||||
site_url = os.getenv(
|
||||
"HANZO_KMS_URL", os.getenv("INFISICAL_SITE_URL", "https://kms.hanzo.ai")
|
||||
)
|
||||
site_url = os.getenv("HANZO_KMS_URL", "https://kms.hanzo.ai")
|
||||
organization = os.getenv("HANZO_KMS_ORG", "hanzo")
|
||||
client_id = os.getenv(
|
||||
"HANZO_KMS_CLIENT_ID", os.getenv("INFISICAL_CLIENT_ID", "")
|
||||
)
|
||||
client_secret = os.getenv(
|
||||
"HANZO_KMS_CLIENT_SECRET", os.getenv("INFISICAL_CLIENT_SECRET", "")
|
||||
)
|
||||
client_id = os.getenv("HANZO_KMS_CLIENT_ID", "")
|
||||
client_secret = os.getenv("HANZO_KMS_CLIENT_SECRET", "")
|
||||
|
||||
auth = None
|
||||
if client_id and client_secret:
|
||||
@@ -345,7 +339,3 @@ class AsyncKMSClient:
|
||||
|
||||
async def __aexit__(self, *args) -> None:
|
||||
await self.close()
|
||||
|
||||
|
||||
# Alias for compatibility
|
||||
AsyncInfisicalClient = AsyncKMSClient
|
||||
|
||||
@@ -37,7 +37,7 @@ def _build_client(args: argparse.Namespace) -> KMSClient:
|
||||
site_url = args.url or os.getenv("HANZO_KMS_URL", "https://kms.hanzo.ai")
|
||||
|
||||
# Auth priority: token > universal-auth > user/password > env
|
||||
token = args.token or os.getenv("HANZO_KMS_TOKEN", os.getenv("INFISICAL_TOKEN", ""))
|
||||
token = args.token or os.getenv("HANZO_KMS_TOKEN", "")
|
||||
client_id = args.client_id or os.getenv("HANZO_KMS_CLIENT_ID", "")
|
||||
client_secret = args.client_secret or os.getenv("HANZO_KMS_CLIENT_SECRET", "")
|
||||
email = args.email or os.getenv("HANZO_KMS_EMAIL", "")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Hanzo KMS Client - Pure Python implementation
|
||||
|
||||
A full-featured KMS client compatible with Infisical API.
|
||||
A full-featured Hanzo KMS client.
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -70,19 +70,13 @@ class KMSClient:
|
||||
"""Create settings from environment variables."""
|
||||
from .models import TokenAuthMethod, UniversalAuthMethod, UserPasswordAuthMethod
|
||||
|
||||
site_url = os.getenv(
|
||||
"HANZO_KMS_URL", os.getenv("INFISICAL_SITE_URL", "https://kms.hanzo.ai")
|
||||
)
|
||||
site_url = os.getenv("HANZO_KMS_URL", "https://kms.hanzo.ai")
|
||||
organization = os.getenv("HANZO_KMS_ORG", "hanzo")
|
||||
client_id = os.getenv(
|
||||
"HANZO_KMS_CLIENT_ID", os.getenv("INFISICAL_CLIENT_ID", "")
|
||||
)
|
||||
client_secret = os.getenv(
|
||||
"HANZO_KMS_CLIENT_SECRET", os.getenv("INFISICAL_CLIENT_SECRET", "")
|
||||
)
|
||||
client_id = os.getenv("HANZO_KMS_CLIENT_ID", "")
|
||||
client_secret = os.getenv("HANZO_KMS_CLIENT_SECRET", "")
|
||||
email = os.getenv("HANZO_KMS_EMAIL", "")
|
||||
password = os.getenv("HANZO_KMS_PASSWORD", "")
|
||||
token = os.getenv("HANZO_KMS_TOKEN", os.getenv("INFISICAL_TOKEN", ""))
|
||||
token = os.getenv("HANZO_KMS_TOKEN", "")
|
||||
|
||||
auth = None
|
||||
if token:
|
||||
@@ -541,6 +535,3 @@ class KMSClient:
|
||||
def __exit__(self, *args) -> None:
|
||||
self.close()
|
||||
|
||||
|
||||
# Alias for compatibility
|
||||
InfisicalClient = KMSClient
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
Hanzo KMS - Data models for the SDK
|
||||
|
||||
Pydantic models for API requests and responses.
|
||||
Compatible with Infisical API schema.
|
||||
"""
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
Reference in New Issue
Block a user