auth

package
v0.0.0-...-7a62f64 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

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

func (*AuthHandler) Authenticate

func (a *AuthHandler) Authenticate(ctx context.Context, operationName string, k string) (context.Context, error)

func (*AuthHandler) Authorize

func (a *AuthHandler) Authorize(ctx context.Context, operationName string, k string) (context.Context, error)

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context, key string) (context.Context, error)
}

type Authorizer

type Authorizer interface {
	Authorize(ctx context.Context, operation string, key string, resource string) (context.Context, error)
}

type CasbinAuthorizer

type CasbinAuthorizer struct{}

func (CasbinAuthorizer) Authorize

func (c CasbinAuthorizer) Authorize(ctx context.Context, operation string, key string, resource string) (context.Context, error)

type Handler

type Handler interface {
	Authorize(ctx context.Context, operationName string, k string) (context.Context, error)
	Authenticate(ctx context.Context, operationName string, k string) (context.Context, error)
}

func NewAuthHandler

func NewAuthHandler(n Authenticator, z Authorizer) Handler

type KeyAuthenticator

type KeyAuthenticator struct{}

func (KeyAuthenticator) Authenticate

func (k KeyAuthenticator) Authenticate(ctx context.Context, key string) (context.Context, error)

Jump to

Keyboard shortcuts

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