Documentation
¶
Overview ¶
Package actorlookup fetches the actor an exchange request names from ate-api-server. The control plugin is a sidecar in the ate-api-server pod, so it dials the loopback address and presents the pod identity certificate, which ate-api-server accepts as an mTLS client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStale = errors.New("actor UID does not match the JWT")
ErrStale is returned when the actor at the name a JWT carries has a different UID: the actor was deleted and recreated since the JWT was minted.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Address is the gRPC target, 127.0.0.1:443 in the pod.
Address string
// CAFile verifies the serving certificate.
CAFile string
// ServerName is the DNS name expected on the serving certificate, since
// Address is not a name the certificate carries.
ServerName string
// ClientCredBundle is the PEM bundle with the pod identity certificate
// and key.
ClientCredBundle string
}
Config says how to reach ate-api-server. Every file is re-read on each handshake, so certificate rotation needs no restart.
type Lookup ¶
type Lookup struct {
// contains filtered or unexported fields
}
Lookup resolves actors over one connection to ate-api-server.
func New ¶
New dials ate-api-server. The connection is lazy, so a server that is not up yet fails the first lookup rather than New.
func (*Lookup) Actor ¶
func (l *Lookup) Actor(ctx context.Context, claims *actoridjwt.WireSubstrateClaims) (*ateapipb.Actor, error)
Actor returns the actor the claims name. The claims come from a verified JWT, so the atespace and name are trusted, but the actor may have been recreated since, which the UID detects. A gRPC status error from ate-api-server, such as NotFound, is returned unchanged.