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 ¶
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 ¶
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.