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 ¶
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 ¶
func (s *Server) ExchangeActorJwt(ctx context.Context, req *exchangepb.ExchangeActorJwtRequest) (*exchangepb.ExchangeActorJwtResponse, error)
ExchangeActorJwt is the exchange. It issues a credential only for a token the Authorizer accepts.