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 ¶
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.
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 (*Server) ExchangeActorJwt ¶
func (s *Server) ExchangeActorJwt(ctx context.Context, req *exchangepb.ExchangeActorJwtRequest) (*exchangepb.ExchangeActorJwtResponse, error)
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.