Skip to main content

issue-creds

Vend short-lived, scope-limited AWS S3 credentials from inside the hub. Wraps STS AssumeRoleWithWebIdentity and applies an inline session policy that can only intersect with the role's identity policy — it can shrink permissions, never widen them.

Install

pip install issue-creds            # from a built wheel/sdist or your index
# or, from a checkout:
pip install .

This installs an issue-creds command on $PATH.

Usage

# Read the whole bucket for 30 minutes
issue-creds --role download --lifetime 30m
# Read a single prefix
issue-creds --role download --prefix lagranto/runs
# Upload — defaults to your own JUPYTERHUB_USER prefix; --prefix overrides it
issue-creds --role upload
issue-creds --role upload --prefix shared/inbox
# Full role (the legacy "power user" behaviour)
issue-creds --role power

Inspect what would be requested without calling STS:

issue-creds --role upload --bucket-scope reflective-persistent-prod --dry-run

Other formats: --format env (default), --format profile, --format json.

Roles

role grants prefix scoping
download Get/List (+versions), GetBucketLocation optional --prefix (whole bucket if omitted)
upload Put, multipart, List/ListMultipart, GetBucketLocation (no Get) defaults to JUPYTERHUB_USER/*; --prefix overrides

Configuration (environment)

variable purpose
AWS_ROLE_ARN default role ARN (fallback for all roles)
ISSUE_CREDS_DOWNLOAD_ROLE_ARN dedicated download role ARN (optional; overrides the fallback)
ISSUE_CREDS_UPLOAD_ROLE_ARN dedicated upload role ARN (optional)
ISSUE_CREDS_POWER_ROLE_ARN dedicated power role ARN (optional)
ISSUE_CREDS_MAX_LIFETIME cap on --lifetime (default 1h; upload allows up to 6h); also raise the role's MaxSessionDuration
AWS_WEB_IDENTITY_TOKEN_FILE OIDC token file (set by the hub)
JUPYTERHUB_USER default upload prefix (overridable with --prefix) and CloudTrail session name

Security note

The session policy is defense-in-depth, not a boundary. Any user who can read AWS_WEB_IDENTITY_TOKEN_FILE can call AssumeRoleWithWebIdentity themselves without the restrictive policy and get whatever the underlying role allows. Real enforcement comes from separate, tightly-scoped IAM roles per download / upload / power, gated by the OIDC trust policy. Set the dedicated role ARN env vars above to switch from advisory to enforced — no code change required.

Development

pip install -e .[dev]
pytest

Download files

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

Source Distribution

issue_creds-0.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

issue_creds-0.1.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: issue_creds-0.1.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for issue_creds-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bcd7dcdae762568f9ca3786934289e40ccadd4dc229635db07e53498efccd32a
MD5 4c8d215563c3bccf232bf7a63e4154b0
BLAKE2b-256 2ec1b1dc72bc37f373b3dd265594e30a700d15a6f70725062c36429b3d8742db

See more details on using hashes here.

Provenance

The following attestation bundles were made for issue_creds-0.1.0.tar.gz:

Publisher: ci.yml on ReflectiveCloud/hub-token-vending-machine

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

File details

Details for the file issue_creds-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: issue_creds-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for issue_creds-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcab99af9e27664ef3da43dd015b962893de8458caec30d4ea1f1b1309f71da7
MD5 f5e8fa8da6200cad651dbb9be76a1ff0
BLAKE2b-256 eaa91013e3990a63927fe8eae55d22daddf58c9ef25fb92edc158d6a3125e2e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for issue_creds-0.1.0-py3-none-any.whl:

Publisher: ci.yml on ReflectiveCloud/hub-token-vending-machine

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

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

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