Skip to main content

Lightweight, zero-dependency auth client for Outerbounds platform APIs.

Project description

ob-auth

Lightweight, zero-dependency Python client for authenticating with the Outerbounds platform.

Use ob-auth when you need to call Outerbounds deployment APIs programmatically without pulling in the full metaflow or outerbounds packages.

Installation

pip install ob-auth

If you use IAM-based authentication (AWS Secrets Manager config), install the optional AWS extra:

pip install ob-auth[aws]

Usage

From local Metaflow config (laptop or inside a deployment)

from ob_auth import OuterboundsAuth

auth = OuterboundsAuth()
auth.init_from_config()  # reads ~/.metaflowconfig/config.json

# If the config contains OBP_METAFLOW_CONFIG_URL, the full config
# is fetched remotely using the auth key from the same file.

import urllib.request, json

req = urllib.request.Request(
    "https://api-c-xxxxx.your-domain.outerbounds.xyz/predict",
    headers=auth.api_headers(),
)
resp = urllib.request.urlopen(req)
print(json.loads(resp.read()))

From an encoded config string (e.g. from Outerbounds UI)

from ob_auth import OuterboundsAuth

auth = OuterboundsAuth()
auth.init(config_string="awssm-arn:BASE64...")
headers = auth.api_headers()  # {"x-api-key": "..."}

From a service principal (CI/CD, GitHub Actions)

from ob_auth import OuterboundsAuth

auth = OuterboundsAuth()
auth.init_from_service_principal(
    service_principal_name="my-cicd-bot",
    deployment_domain="my-company.outerbounds.xyz",
    github_actions=True,  # or jwt_token="..." for static tokens
)
headers = auth.api_headers()

With ob-events

If you also use ob-events, you can share a single auth instance:

from ob_auth import OuterboundsAuth
from ob_events import EventTrigger

auth = OuterboundsAuth()
auth.init_from_config()

# Use auth for direct API calls
headers = auth.api_headers()

# And pass it to EventTrigger
et = EventTrigger(auth=auth)
et.trigger("my_event", {"key": "value"})

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

ob_auth-0.2.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

ob_auth-0.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ob_auth-0.2.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ob_auth-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eb0953ec21241102e8dd2e4f67fc56e327be67616cf64b7b51b83b54d50a8e65
MD5 4c7d67f7081782e1d5ab69ac966a4978
BLAKE2b-256 728f100bba2f792a0b796c80b186854c578f1fc7e015140519dbef10629a0b54

See more details on using hashes here.

Provenance

The following attestation bundles were made for ob_auth-0.2.0.tar.gz:

Publisher: publish_ob_auth.yml on outerbounds/obp-foundation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: ob_auth-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ob_auth-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de5ee4d445d73e96e5d28cdf2a43571fa28853dddb6d5cd0d20dd2f6b38616d0
MD5 ababd9e1356708afacb0cc2d86af1780
BLAKE2b-256 900938452d7474f6d257634ae567e6229b1382061a233d080d048c004a8a377d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ob_auth-0.2.0-py3-none-any.whl:

Publisher: publish_ob_auth.yml on outerbounds/obp-foundation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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