gRPC

package
v0.0.0-...-4a3359c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

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

Stream returns a client interceptor to authenticate stream RPC

func (*AuthClientInterceptor) Unary

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

Stream returns a server interceptor function to authenticate and authorize stream RPC

func (*AuthServerInterceptor) Unary

Unary returns a server interceptor function to authenticate and authorize unary RPC

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL