exchange

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: 9 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 gets the actor's grants from an Authorizer, which actorauthz implements, and hands them to an Issuer. actorauthz is provider-neutral and is what another provider's exchange 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 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 Authorizer added in v1.0.0

type Authorizer interface {
	Authorize(ctx context.Context, jwt string) (*actorauthz.Decision, error)
}

Authorizer decides which actor a JWT may get a credential for, and with which grants. actorauthz.Authorizer implements it. Its errors are gRPC status errors the exchange returns as is.

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 Server

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

Server implements CredentialExchange.

func New

func New(authorizer Authorizer, issuer Issuer) *Server

New returns a Server that issues credentials for what authorizer allows.

func (*Server) ExchangeActorJwt

ExchangeActorJwt is the exchange. It issues a credential only for a token the Authorizer accepts.

Jump to

Keyboard shortcuts

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