Nest Engineering Docs
Partner Credentials

Local development

Run, debug, and test Partner Credentials locally

Prerequisites

  • uv and Python 3.13.
  • GCP credentials with access to Spanner and Secret Manager.
  • Partner credentials present in Secret Manager.

Required environment

export SPANNER_INSTANCE_ID="..."
export SPANNER_DATABASE_ID="..."

Optional environment

export GCP_PROJECT_ID="..."
export DEBUG="true"
export SENTRY_ENVIRONMENT="development"

Google Application Credentials

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"

Install dependencies

# From repo root
uv sync --all-packages

Run locally

# From repo root
uv run --package partnercreds granian --interface asgi services.partnercreds.main:app --host 0.0.0.0 --port 8080 --workers 1 --loop uvloop

Sanity checks

curl http://localhost:8080/api/v1/health

Example request

curl "http://localhost:8080/api/v1/auth/pims/token?oid=ORG_ID"

Tests

# From repo root
uv run --package partnercreds pytest -q

Debugging tips

  • 404 means the organization id is missing or not found in Spanner.
  • 500 often indicates missing Secret Manager entries or partner API failures.

Last updated on