Documentation ¶
Index ¶
Constants ¶
View Source
const ( AuthMetaKey = "authorization" UserContextKey = "user_id" )
Variables ¶
This section is empty.
Functions ¶
func LoadClientTLSCredentials ¶
func LoadClientTLSCredentials(cert *meta.TLSCertificate) (credentials.TransportCredentials, error)
func LoadServerTLSCredentials ¶
func LoadServerTLSCredentials(cert *meta.TLSCertificate) (credentials.TransportCredentials, error)
Types ¶
type AuthClientInterceptor ¶
type AuthClientInterceptor struct {
// contains filtered or unexported fields
}
func NewAuthClientInterceptor ¶
func NewAuthClientInterceptor(authEndpoint string, tls *tlsMeta.TLSCertificate, service core.AuthService) *AuthClientInterceptor
func (*AuthClientInterceptor) Stream ¶
func (i *AuthClientInterceptor) Stream() grpc.StreamClientInterceptor
Stream returns a client interceptor to authenticate stream RPC
func (*AuthClientInterceptor) Unary ¶
func (i *AuthClientInterceptor) Unary() grpc.UnaryClientInterceptor
Unary returns a client interceptor to authenticate unary RPC
type AuthServerInterceptor ¶
type AuthServerInterceptor struct {
// contains filtered or unexported fields
}
func NewAuthServerInterceptor ¶
func NewAuthServerInterceptor(jwt *jwt.TokenManager, accessRoles map[string][]model.UserRole) *AuthServerInterceptor
func (*AuthServerInterceptor) Stream ¶
func (i *AuthServerInterceptor) Stream() grpc.StreamServerInterceptor
Stream returns a server interceptor function to authenticate and authorize stream RPC
func (*AuthServerInterceptor) Unary ¶
func (i *AuthServerInterceptor) Unary() grpc.UnaryServerInterceptor
Unary returns a server interceptor function to authenticate and authorize unary RPC
Click to show internal directories.
Click to hide internal directories.