Documentation ¶
Index ¶
Constants ¶
const AuthContextKey = authContextKeyType("token")
AuthContextKey is a key used in RPC context to retrieve the token info with using context.Value.
const DefaultJWKSURL = "http://localhost:8080/.well-known/jwks.json"
DefaultJWKSURL is the default JWKS url pointing to a local authentication server.
Variables ¶
This section is empty.
Functions ¶
func StartGRPCServer ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct { // Jwks contains a JSON Web Key Set, that is used if JWKS support is enabled. Otherwise a // stored public key will be used Jwks *keyfunc.JWKS AuthFunc grpc_auth.AuthFunc // contains filtered or unexported fields }
func ConfigureAuth ¶
func ConfigureAuth(opts ...AuthOption) *AuthConfig
ConfigureAuth creates a new AuthConfig, which can be used in gRPC middleware to provide an authentication layer.
type AuthOption ¶
type AuthOption func(*AuthConfig)
AuthOption is a function-style option type to fine-tune authentication
func WithJWKSURL ¶
func WithJWKSURL(url string) AuthOption
WithJWKSURL is an option to provide a URL that contains a JSON Web Key Set (JWKS). The JWKS will be used to validate tokens coming from RPC clients against public keys contains in the JWKS.
func WithPublicKey ¶
func WithPublicKey(publicKey *ecdsa.PublicKey) AuthOption
WithPublicKey is an option to directly provide a ECDSA public key which is used to verify tokens coming from RPC clients.
type StartGRPCServerOption ¶
func WithDiscovery ¶
func WithDiscovery(svc discovery.DiscoveryServer) StartGRPCServerOption
func WithEvidenceStore ¶
func WithEvidenceStore(svc evidence.EvidenceStoreServer) StartGRPCServerOption
func WithOrchestrator ¶
func WithOrchestrator(svc orchestrator.OrchestratorServer) StartGRPCServerOption