Skip to main content

Python SDK for kafka-admin-agent OIDC proxy service

Project description

oidc-proxy-python-sdk

Python SDK для сервиса oidc-proxy.

SDK реализует модели API и клиент, повторяющий интерфейс Go-клиента:

  • Healthy / Ready
  • Authorize / AuthorizeCallback
  • FindSession / 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/callback
  • UserInfo — данные пользователя (включая roles и permissions)
  • HealthCheck — элемент ответа /api/v1/health/readiness
  • ErrorResponse — тело ошибки, возвращаемое API

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oidc_proxy_python_sdk-0.0.0.dev2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oidc_proxy_python_sdk-0.0.0.dev2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file oidc_proxy_python_sdk-0.0.0.dev2.tar.gz.

File metadata

  • Download URL: oidc_proxy_python_sdk-0.0.0.dev2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.14.3 Darwin/25.3.0

File hashes

Hashes for oidc_proxy_python_sdk-0.0.0.dev2.tar.gz
Algorithm Hash digest
SHA256 339342a16ba83bf2cd3eab4cac63618556aa1b34578f195df7c6aee4ad1ded14
MD5 32621c9958f7c85026e99a107a8206ff
BLAKE2b-256 465575bfe54997e466128e13b671a561a4a4505e903c2573b7e3a210265b4ed3

See more details on using hashes here.

File details

Details for the file oidc_proxy_python_sdk-0.0.0.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for oidc_proxy_python_sdk-0.0.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 144c7745760f37b9c7c4203e75a2340012416d804673fe88e0a45b09e603cfcb
MD5 4b48e2c49d4aa524d3eefd0e36aa232a
BLAKE2b-256 d536cdf6bedcdc07028b627526a2c4db9add1968a5b7b78a70a9e644e3c350f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page