nsc cache sccache create-token

Create a revocable token for accessing the sccache cache.

nsc cache sccache create-token generates a revocable token scoped to accessing Namespace's remote cache for sccache. It's useful for provisioning access outside of the interactive nsc cache sccache setup flow — for example, distributing a scoped credential to a CI/CD pipeline or another environment that shouldn't share your personal login session.

The generated token can be written to a file and used wherever a bearer token is accepted for sccache authentication, or revoked at any time with nsc token revoke.

Usage

nsc cache sccache create-token [--cache_name <name>] \
    [--expires_in <duration>] \
    [--scope <tenant|user>] \
    [--token <path>]

Example

Create a token scoped to a specific cache with a 10-day expiration:

$ nsc cache sccache create-token \
  --cache_name my-cache \
  --expires_in 10d \
  --token sccache-token.json

Options

--cache_name

Select a sccache cache to grant access to. By default, all sccache caches can be accessed.

--expires_in

Duration until the token expires. Defaults to 2160h (90 days). Available time units are: h (hours), d (days), w (weeks), and y (years).

--scope

Set the scope of the generated access token. Valid options: tenant, user. Defaults to user. Tokens with user scope are bound to the tenant membership of the current user.

--token

Write the token to this file in JSON format. Defaults to token.json.