Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProviderOIDC = "oidc" ProviderParamTypeToken = "token" )
View Source
const ( MetadataAuthorizationKey = "authorization" TokenPrefix = "Bearer " )
View Source
const ( DefaultUserNameCalm = "sub" AllowedAudienceDefaultValue = "" )
Variables ¶
View Source
var ( ErrUnsupportedProvider = errors.New("unsupported authentication provider") ErrUnMatchedAuthenticationParamType = errors.New("unmatched authentication parameter type") ErrEmptyToken = errors.New("empty token") ErrMalformedToken = errors.New("malformed token") )
View Source
var ( ErrEmptyIssueURL = errors.New("empty issue URL") ErrEmptyAllowedAudiences = errors.New("empty allowed audiences") ErrUnknownIssuer = errors.New("unknown issuer") ErrUserNameNotFound = errors.New("username not found") ErrForbiddenAudience = errors.New("forbidden audience") )
View Source
var Disabled = Options{}
View Source
var (
ErrMetadataFetchFailed = errors.New("metadata fetch failed")
)
Functions ¶
This section is empty.
Types ¶
type AuthenticationProvider ¶
type AuthenticationProvider interface { AcceptParamType() string Authenticate(ctx context.Context, param any) (string, error) }
todo: add metrics
func NewAuthenticationProvider ¶
func NewAuthenticationProvider(ctx context.Context, options Options) (AuthenticationProvider, error)
func NewOIDCProvider ¶
func NewOIDCProvider(ctx context.Context, jsonParam string) (AuthenticationProvider, error)
type GrpcAuthenticationDelegator ¶
type GrpcAuthenticationDelegator struct {
// contains filtered or unexported fields
}
func NewGrpcAuthenticationDelegator ¶
func NewGrpcAuthenticationDelegator(provider AuthenticationProvider) (*GrpcAuthenticationDelegator, error)
func (*GrpcAuthenticationDelegator) GetStreamInterceptor ¶
func (delegator *GrpcAuthenticationDelegator) GetStreamInterceptor() grpc.StreamServerInterceptor
func (*GrpcAuthenticationDelegator) GetUnaryInterceptor ¶
func (delegator *GrpcAuthenticationDelegator) GetUnaryInterceptor() grpc.UnaryServerInterceptor
type OIDCOptions ¶
type OIDCOptions struct { AllowedIssueURLs string `json:"allowedIssueURLs,omitempty"` AllowedAudiences string `json:"allowedAudiences,omitempty"` UserNameClaim string `json:"userNameClaim,omitempty"` }
func (*OIDCOptions) Validate ¶
func (op *OIDCOptions) Validate() error
type OIDCProvider ¶
type OIDCProvider struct {
// contains filtered or unexported fields
}
func (*OIDCProvider) AcceptParamType ¶
func (*OIDCProvider) AcceptParamType() string
func (*OIDCProvider) Authenticate ¶
type ProviderWithVerifier ¶
type ProviderWithVerifier struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.