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.1.0.tar.gz (9.7 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.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ob_auth-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 ea3cdc496a45c44ecc12d6fe53575fcbf0d24b5c0fda8732b04746676bc92384
MD5 8cea3cdbfed7b30544ef28dac2a1b29a
BLAKE2b-256 20bde6f91e2657c7334e7d0b6e71107099912cbdb1e8f27ad84f78f9eb9ab2d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ob_auth-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: ob_auth-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 947ebec6ed8819e1a8ac50fc18bbbb7020644df21a4d2a5517fdb3172f8a5ce9
MD5 d9fbd54175cd7f062a59bd83babdf12f
BLAKE2b-256 b063cbb71182574103404cbfc3b603ff82d5aa51424625f53db9bc2879df713c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ob_auth-0.1.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