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.1.tar.gz (18.1 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.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for issue_creds-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1ab713eba07073cfe0ee180417cf40f8940594369c9646abf9d901f786bd3cde
MD5 f2b82cb805d45ac68c39ced5fc9ae44c
BLAKE2b-256 05c6a93a80577830b138c52deca21507a86d9a57a03a165915a017913aed4eac

See more details on using hashes here.

Provenance

The following attestation bundles were made for issue_creds-0.1.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for issue_creds-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58e9f08feefc7aaf048b96576f79921059c91727150cafd3f9b8b799c6be4d80
MD5 d2a1674c1fd2c132e255aab7e10a8506
BLAKE2b-256 8e4aaf7a0eb9847b4e5d4eb6ce1c6c97174e8563fe209ee9922f19965b74dc85

See more details on using hashes here.

Provenance

The following attestation bundles were made for issue_creds-0.1.1-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

This release

0.1.1 This release

2 files

0.1.0

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