Properties
Identifier
Access token IDs must be unique to the account and between 1 and 96 bytes in length.Expiration
An optional RFC 3339 timestamp at which the access token becomes invalid.When one access token issues another, the issuing token’s expiry is both the default and the latest possible expiry for the new token.Dashboard access does not have an expiry, so it can issue permanent access tokens. A token with a limited expiry can issue only tokens bounded by its own expiry.
Scope
Resources
Access to the following resources can be scoped:- Basins
- Streams
- Access tokens
- Prefix Match
- Exact Match
Grant access to all resources with a common prefix:
Empty prefix matches all resources (allow all).
Operations
There are two complementary ways to authorize operations:- Operation Groups
- Individual Operations
Operation groups provide a high-level way to grant read/write access.Group-level permissions will also apply to any new operations added to the group.
Both groups and individual operations may be specified together — the effective permissions are a union.An issued token must have at least one effective operation permission.
Narrowing
When you use an access token to issue another token, the requested scope must be equal to or narrower than the issuing token’s scope. S2 rejects a request withpermission_denied if it would expand resource access or operation permissions;
it does not silently reduce the requested scope.
The request defines the new token’s complete scope. Scope fields are not
inherited, and omitted fields use the least-permissive defaults above.
Expiration behaves differently: the new token inherits the
issuing token’s expiration by default and can never outlive it.
These examples use stream names, but the same matcher rules apply to basin names
and access token IDs. The new token’s ID must also match the issuing token’s
access_tokens matcher, independently of the new token’s own access_tokens
matcher.
Permissions are narrowed across both op_groups and ops. An operation group
on the issuing token can authorize individual operations in that group, but
individual operations cannot authorize a group because groups automatically
include future operations.
auto_prefix_streams also defaults to false; it is not inherited. Matchers in
the issuance request always use names as stored in S2, even when the issuing
token uses auto-prefixing. For example, if the issuing token has
{ "prefix": "foo/" }, request { "prefix": "foo/bar/" } for the new token,
not { "prefix": "bar/" }. Enable auto-prefixing on the new token separately if
its callers should use names relative to foo/bar/.

