Documentation ¶
Overview ¶
Package credentials loads certificates and validates user credentials.
Package credentials loads certificates and validates user credentials.
Index ¶
- func AuthorizeUser(ctx context.Context) (string, bool)
- func ClientCredentials(server string) []grpc.DialOption
- func LoadCertificates(cafile, certfile, keyfile *string) ([]tls.Certificate, *x509.CertPool)
- func ServerCredentials(cafile, certfile, keyfile *string, insecureSkipVerify, noTLS *bool) []grpc.ServerOption
- func StreamInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizeUser ¶
AuthorizeUser checks for valid credentials in the context Metadata.
func ClientCredentials ¶
func ClientCredentials(server string) []grpc.DialOption
ClientCredentials generates gRPC DialOptions for existing credentials.
func LoadCertificates ¶
func LoadCertificates(cafile, certfile, keyfile *string) ([]tls.Certificate, *x509.CertPool)
LoadCertificates loads certificates from file.
func ServerCredentials ¶
func ServerCredentials(cafile, certfile, keyfile *string, insecureSkipVerify, noTLS *bool) []grpc.ServerOption
ServerCredentials generates gRPC ServerOptions for existing credentials.
func StreamInterceptor ¶
func StreamInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamInterceptor - used to validate authentication
func UnaryInterceptor ¶
func UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryInterceptor - used to validate authentication
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.