auth

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Implementor

func Implementor() service.Authenticator

Return the service implementor.

func NewAlgorithmAuth

func NewAlgorithmAuth(client, server TokenParser) service.Authenticator

func RegisterImplementor

func RegisterImplementor(auth service.Authenticator)

Register service implementor.

func StreamServerInterceptor

func StreamServerInterceptor() grpc.StreamServerInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

Types

type AlgorithmAuth

type AlgorithmAuth struct {
	// contains filtered or unexported fields
}

func (*AlgorithmAuth) Authenticate

func (n *AlgorithmAuth) Authenticate(ctx context.Context, serviceMethod string) (*secret.Info, error)

Authenticate a request specified by the full url path of the method.

func (*AlgorithmAuth) IsAnonymousMethod

func (n *AlgorithmAuth) IsAnonymousMethod(serviceMethod string) bool

func (*AlgorithmAuth) IsValidPlatform

func (n *AlgorithmAuth) IsValidPlatform(sub permission.Subject, platform common.Platform) bool

func (*AlgorithmAuth) RegisterServiceSubjects

func (n *AlgorithmAuth) RegisterServiceSubjects(component string, serviceMethodSubjects map[string][]permission.Subject)

RegisterServiceSubjects registers required method subjects of the service. The map key of the parameter is the full url path of the method.

func (*AlgorithmAuth) ServiceComponentName

func (n *AlgorithmAuth) ServiceComponentName(serviceMethod string) string

ServiceComponentName returns the component name implements the service method.

type TokenParser

type TokenParser interface {
	// Parse the token string.
	Parse(md *common.Metadata) (*secret.Info, error)
}

Jump to

Keyboard shortcuts

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