Documentation ¶
Index ¶
- func CheckAllScopesPresenceUnaryInterceptor(scopes ...string) ...
- func CheckAnyScopePresenceUnaryInterceptor(scopes ...string) ...
- func FoundationErrorToStatusUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, ...) (interface{}, error)
- func GetMetadataValue(ctx context.Context, key string) (s string)
- func LoggingUnaryInterceptor(log *logrus.Entry) ...
- func MetadataUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func NewTLSConfig(tlsDir string) (credentials.TransportCredentials, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAllScopesPresenceUnaryInterceptor ¶
func CheckAllScopesPresenceUnaryInterceptor(scopes ...string) func(context.Context, interface{}, *grpc.UnaryServerInfo, grpc.UnaryHandler) (interface{}, error)
CheckAllScopesPresenceUnaryInterceptor checks if the context contains all specified scopes.
func CheckAnyScopePresenceUnaryInterceptor ¶
func CheckAnyScopePresenceUnaryInterceptor(scopes ...string) func(context.Context, interface{}, *grpc.UnaryServerInfo, grpc.UnaryHandler) (interface{}, error)
CheckAnyScopePresenceUnaryInterceptor checks if the context contains at least one of the specified scopes.
func FoundationErrorToStatusUnaryInterceptor ¶
func FoundationErrorToStatusUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
func GetMetadataValue ¶
GetMetadataValue retrieves the value of a specified key from the metadata of a gRPC context.
func LoggingUnaryInterceptor ¶
func LoggingUnaryInterceptor(log *logrus.Entry) func(context.Context, interface{}, *grpc.UnaryServerInfo, grpc.UnaryHandler) (interface{}, error)
LoggingUnaryInterceptor returns a gRPC unary interceptor that logs all incoming gRPC calls. It logs the method details, request, response, and any potential errors.
func MetadataUnaryInterceptor ¶
func MetadataUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
MetadataUnaryInterceptor sets values passed by the gateway from the gRPC metadata into the context.
This is implemented to standardize the retrieval of common values from the context, regardless of whether we are writing gRPC or Event Bus handlers.
func NewTLSConfig ¶
func NewTLSConfig(tlsDir string) (credentials.TransportCredentials, error)
NewTLSConfig initializes a new TransportCredentials instance based on the files located in the provided tlsDir directory. It expects three specific files to be present:
server.crt: This is the server's public certificate file. It's used to authenticate the server to the client.
server.key: This is the server's private key file. This should be kept secret and secure, as it's used in the encryption/decryption process.
ca.crt: This is the certificate authority (CA) certificate. This file is used to validate client certificates for mutual TLS authentication.
Types ¶
This section is empty.