Python SDK for kafka-admin-agent OIDC proxy service
Project description
oidc-proxy-python-sdk
Python SDK для сервиса oidc-proxy.
SDK реализует модели API и клиент, повторяющий интерфейс Go-клиента:
Healthy/ReadyAuthorize/AuthorizeCallbackFindSession/DeleteSession
Установка
Из корня репозитория:
cd oidc-proxy/oidc-proxy-python-sdk
poetry install
Использование
from oidc_proxy_sdk import (
OIDCProxyClient,
AuthorizeInput,
AuthorizeCallbackInput,
OIDCProxyError,
)
client = OIDCProxyClient(base_url="http://localhost:8080")
# Health
client.healthy() # -> True или OIDCProxyError
client.ready() # -> True (200) или False (503)
# Авторизация
location = client.authorize(AuthorizeInput(redirect_uri="https://example.com/callback"))
print("Redirect user to:", location)
# Callback
session = client.authorize_callback(
AuthorizeCallbackInput(
code="code-from-provider",
state="state-from-cookie",
)
)
print(session.user_id, session.user_info.email)
# Сессии
session = client.find_session("user-id-123")
if session:
print("Session expiry:", session.expiry_time)
client.delete_session("user-id-123")
Модели
Модели соответствуют OpenAPI-схеме oidc-proxy:
Session— структура ответа/api/v1/sessions/{userID}и/api/v1/oidc/authorize/callbackUserInfo— данные пользователя (включаяrolesиpermissions)HealthCheck— элемент ответа/api/v1/health/readinessErrorResponse— тело ошибки, возвращаемое API
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oidc_proxy_python_sdk-0.0.0.dev6.tar.gz.
File metadata
- Download URL: oidc_proxy_python_sdk-0.0.0.dev6.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.5 Linux/5.15.0-164-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ba625f26ee573383da41b3ddc589538e5146d525ec3423cb1c043e3d89cc391
|
|
| MD5 |
7e118b444c216f8b97603e16d29f147f
|
|
| BLAKE2b-256 |
1bed135b0f0ab79ef56d4e91046bcf3f0aa4a837d91489466edbfb1d36691dea
|
File details
Details for the file oidc_proxy_python_sdk-0.0.0.dev6-py3-none-any.whl.
File metadata
- Download URL: oidc_proxy_python_sdk-0.0.0.dev6-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.5 Linux/5.15.0-164-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f052330213bf1af7a335ea6de2360c294d934854b18ea37426e5b5a8603b7bff
|
|
| MD5 |
1157f4da0412ed17628f22b2539dea57
|
|
| BLAKE2b-256 |
a6d9fbbe140c25e3539380eff694b8b8b5d9abca3424fa740fce3dd96daf1d17
|