auth

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 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

Implementor returns the authenticator service implementor.

func NewAlgorithmAuth

func NewAlgorithmAuth(client, server TokenParser) service.Authenticator

func RegisterImplementor

func RegisterImplementor(auth service.Authenticator)

RegisterImplementor register the authenticator 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) CheckPolicy added in v1.0.0

func (n *AlgorithmAuth) CheckPolicy(serviceMethod string, secretInfo *secret.Info) (*secret.Info, error)

func (*AlgorithmAuth) GetSecretRoles added in v1.0.0

func (n *AlgorithmAuth) GetSecretRoles(secretInfo *secret.Info) map[string]bool

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,
	serviceMethodRoles map[string][]string)

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