Documentation ¶
Index ¶
- func GetAuthenticationFrom(ctx context.Context) *authrpc.Authentication
- func UnaryInterceptor(logger *zap.Logger, authenticator Authenticator) grpc.UnaryServerInterceptor
- type Authenticator
- type Server
- func (s *Server) DeleteAuthentication(ctx context.Context, req *auth.DeleteAuthenticationRequest) (*emptypb.Empty, error)
- func (s *Server) GetAuthentication(ctx context.Context, r *auth.GetAuthenticationRequest) (*auth.Authentication, error)
- func (s *Server) GetAuthenticationSelf(ctx context.Context, _ *emptypb.Empty) (*auth.Authentication, error)
- func (s *Server) ListAuthentications(ctx context.Context, r *auth.ListAuthenticationsRequest) (*auth.ListAuthenticationsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthenticationFrom ¶
func GetAuthenticationFrom(ctx context.Context) *authrpc.Authentication
GetAuthenticationFrom is a utility for extracting an Authentication stored on a context.Context instance
func UnaryInterceptor ¶
func UnaryInterceptor(logger *zap.Logger, authenticator Authenticator) grpc.UnaryServerInterceptor
UnaryInterceptor is a grpc.UnaryServerInterceptor which extracts a clientToken found within the authorization field on the incoming requests metadata. The fields value is expected to be in the form "Bearer <clientToken>".
Types ¶
type Authenticator ¶
type Authenticator interface {
GetAuthenticationByClientToken(ctx context.Context, clientToken string) (*authrpc.Authentication, error)
}
Authenticator is the minimum subset of an authentication provider required by the middleware to perform lookups for Authentication instances using a obtained clientToken.
type Server ¶
type Server struct { auth.UnimplementedAuthenticationServiceServer // contains filtered or unexported fields }
Server is the core AuthenticationServiceServer implementations.
It is the service which presents all Authentications created in the backing auth store.
func (*Server) DeleteAuthentication ¶
func (s *Server) DeleteAuthentication(ctx context.Context, req *auth.DeleteAuthenticationRequest) (*emptypb.Empty, error)
DeleteAuthentication deletes the authentication with the supplied ID.
func (*Server) GetAuthentication ¶
func (s *Server) GetAuthentication(ctx context.Context, r *auth.GetAuthenticationRequest) (*auth.Authentication, error)
GetAuthentication returns the Authentication identified by the supplied id.
func (*Server) GetAuthenticationSelf ¶
func (s *Server) GetAuthenticationSelf(ctx context.Context, _ *emptypb.Empty) (*auth.Authentication, error)
GetAuthenticationSelf returns the Authentication which was derived from the request context.
func (*Server) ListAuthentications ¶
func (s *Server) ListAuthentications(ctx context.Context, r *auth.ListAuthenticationsRequest) (*auth.ListAuthenticationsResponse, error)
ListAuthentications produces a set of authentications for the provided method filter and pagination parameters.