actorauthz

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package actorauthz holds the checks every provider's credential exchange must apply to a worker-for-actor JWT before it issues any credential. It verifies the JWT, looks the actor up, checks the actor is still on the token's node, and derives the actor's storage grants. It is provider-neutral and imports no cloud SDK.

Index

Constants

View Source
const Audience = "objectstore-plugin.ate.dev"

Audience is the audience of the objectstore plugin API. atelet requests it on the worker-for-actor JWT it hands to whichever node plugin is installed, and every exchange serving this API requires it. A token minted for another audience is refused.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer struct {
	// contains filtered or unexported fields
}

Authorizer runs the checks.

func New

func New(v Verifier, l Lookup) *Authorizer

New returns an Authorizer. The verifier must accept only Audience.

func (*Authorizer) Authorize

func (a *Authorizer) Authorize(ctx context.Context, jwt string) (*Decision, error)

Authorize checks jwt and returns what a credential may be issued for. Only a worker-for-actor token is accepted: an actor's own token has the same shape and can be minted with the same audience, and actor code must not obtain credentials for its own snapshots. Every error is a gRPC status error the exchange can return as is.

type Decision

type Decision struct {
	ActorUID string
	Grants   []actorscope.Grant
}

Decision is what Authorize allowed: the UID of the actor a credential may be issued for, and the storage grants the credential must be limited to.

type Lookup

type Lookup interface {
	Actor(ctx context.Context, claims *actoridjwt.WireSubstrateClaims) (*ateapi.Actor, error)
}

Lookup resolves the actor a verified JWT names. actorlookup implements it.

type Verifier

type Verifier interface {
	Verify(ctx context.Context, jwt string, now time.Time) (*oidcjwt.Claims, error)
}

Verifier checks a JWT and returns its claims. oidcjwt.Verifier implements it, built with WithSubstrateClaims so the token's kind is known.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL