exchange

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 15 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 exchange serves this plugin's credential exchange. The node plugin presents the worker-for-actor JWT atelet gave it and gets back a GCS access token scoped to that actor's snapshot prefixes. The handler verifies the JWT with oidcjwt, looks the actor up with actorlookup, derives the grants with actorscope, and hands them to an Issuer. Those three packages are provider-neutral and are what another provider's plugin reuses. This package and its proto are not: they are shaped for this binary's credential, and the Issuer interface is the seam between its backends.

Index

Constants

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

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

View Source
const DefaultPort = 8445

DefaultPort is the port the control sidecar serves the exchange on and the node plugin dials by default, through the ate-api-server Service.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issuer

type Issuer interface {
	Issue(ctx context.Context, actorUID string, grants []actorscope.Grant, force bool) (credential.Token, error)
}

Issuer mints a credential limited to grants for the actor. force skips any cache the issuer keeps. An error carrying a gRPC status code other than Unavailable is passed to the caller unchanged, for failures the same request would hit again, and one wrapping the context's error keeps the caller's code. Any other error is reported as Unavailable. The GCS issuer is gcsissuer.

type Lookup

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

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

type Server

type Server struct {
	exchangepb.UnimplementedCredentialExchangeServer
	// contains filtered or unexported fields
}

Server implements CredentialExchange.

func New

func New(verifier Verifier, lookup Lookup, issuer Issuer) *Server

New returns a Server. The verifier must accept ActorJWTAudience.

func (*Server) ExchangeActorJwt

ExchangeActorJwt is the exchange. Only a worker-for-actor token is accepted: an actor's own token has the same shape and can be minted with this audience, and actor code must not obtain credentials for its own snapshots.

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