Skip to main content

Server-only Intflow Auth Admin API SDK.

Project description

Intflow Auth Admin SDK

Server-only Python SDK for trusted backends that call the Intflow Auth Admin API.

This package is for backend automation and integrated management services that already have an operator Admin API token from their own secure runtime configuration. It does not store local operator credentials, does not perform browser login handoff, and must not be used from browser code.

base_url must be an origin-only HTTPS URL. Plain HTTP is accepted only for exact localhost, 127.0.0.1, or ::1 development origins. Userinfo, query, fragment, path-prefix, ambiguous port/host forms, and redirects are rejected before the SDK can forward an operator token.

Install

python -m pip install intflow-auth-admin-sdk

Current Status

Use a trusted runtime secret source to supply the operator Admin API token. Public request and response mappings are exported as TypedDict models, list filters and factory options have explicit signatures, and misspelled options are rejected by static type checkers. Audit event payload is the one intentionally extensible JSON field and contains redacted metadata only.

from intflow_auth_admin_sdk import create_admin_client

with create_admin_client(token="operator-admin-token") as client:
    actor = client.whoami()
    audit_events = client.search_audit_events(
        client_id="<oauth-client-id>",
        limit=25,
    )

print(actor["user"]["email"])
print(audit_events["next_cursor"])

Errors And Retries

HTTP failures raise IntflowAuthAdminHttpError. Use its bounded metadata for control flow instead of parsing exception text or raw upstream responses:

from intflow_auth_admin_sdk import IntflowAuthAdminHttpError

try:
    client.whoami()
except IntflowAuthAdminHttpError as error:
    print(error.status_code, error.service_error_code or "http_error")
    if error.status_code == 429 and error.retry_after_seconds is not None:
        # Schedule a caller-controlled retry after this bounded delay.
        retry_delay = error.retry_after_seconds
    raise

response_body is size-bounded and recursively redacts sensitive fields and known bearer values, but it remains untrusted upstream data and should not be logged wholesale. Timeout and transport errors use stable SDK error codes and do not retain a raw secret-bearing transport cause. The async client exposes the same error contract.

Role grant/revoke, user session/refresh-token revoke-all, and app-admin revoke return None only after an exact empty 204 No Content response. They do not return a user, count, or empty mapping.

Create only a finite child operator token from this bearer-authenticated SDK:

created = client.create_operator_admin_token(
    {
        "name": "integrated-console-backend",
        "scopes": ["admin:audit:read"],
        "ttl_seconds": 3600,
    }
)

Operator-token response mappings include parent_token_id, lineage_root_token_id, and delegation_depth. Revoking a token also revokes its active descendants.

Requested scopes must be a non-empty subset of the SDK credential scopes, and the child expiry cannot exceed the SDK credential expiry. No-expiry root credentials require the separate privileged browser-session control path and are rejected locally by this SDK.

Long-running trusted backends should create one IntflowAuthAdminClient or AsyncIntflowAuthAdminClient during startup, reuse it for Admin API calls, and call close() or aclose() during shutdown. Caller-injected httpx clients remain caller-owned.

For mocked Admin API examples, see examples/python-sdk-consumer.

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

intflow_auth_admin_sdk-0.2.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

intflow_auth_admin_sdk-0.2.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file intflow_auth_admin_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: intflow_auth_admin_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for intflow_auth_admin_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 54cfafc1417891623d2d664c512c1faf8a10c45d858e9e6d2094913a27431c0a
MD5 337c369b1e04184bf413281ae83dfb38
BLAKE2b-256 6f998f06abbf6f7198d500593090f8880b2a7ab8cecdb09b7febe7c7f5210844

See more details on using hashes here.

File details

Details for the file intflow_auth_admin_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for intflow_auth_admin_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b009a385b4982f2b0852b2deb609297aa2eb30cd0063dac562563f6aea7a7407
MD5 35f2a42643157987b202f111a1474f51
BLAKE2b-256 ec638249f9cc390410b9815ea2415e0dc7246b70bc44bf27de5076eef65243dd

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