auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 27 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// TODO valid the external request to the listener
	ListPath       = "/networks"
	RegisterPath   = "/network/register"
	DeregisterPath = "/network/deregister/"
	CommonPath     = "/networks/"
)

Variables

View Source
var (
	ErrNoPermission = errors.New("no permission")
)

Functions

func New

func New(ctx context.Context, config Config) fiber.Handler

New creates a new middleware handler

Types

type Config

type Config struct {
	// AuthMethod defines auth method. Now support None and Kubernetes.
	//
	// Required. Default: None
	AuthMethod string
	// SkipAuthorize defines whether skip authorization.
	//
	// Optional. Default: false
	SkipAuthorize bool
}

Config defines the config for middleware.

type KubernetesAuthor

type KubernetesAuthor struct {
	NetworkLister v1beta1.NetworkLister
	ChannelLister v1beta1.ChannelLister
	SkipAuthorize bool
	// contains filtered or unexported fields
}

func (*KubernetesAuthor) Authentication

func (k *KubernetesAuthor) Authentication(next http.Handler) http.Handler

func (*KubernetesAuthor) Authorizer

func (k *KubernetesAuthor) Authorizer(next http.Handler) http.Handler

func (*KubernetesAuthor) GetReqName

func (k *KubernetesAuthor) GetReqName(rawURL string) (network, channelName string, err error)

func (*KubernetesAuthor) New

func (k *KubernetesAuthor) New(ctx context.Context) (err error)

func (*KubernetesAuthor) Run

func (k *KubernetesAuthor) Run() fiber.Handler

type NoneAuthor

type NoneAuthor struct{}

func (NoneAuthor) New

func (_ NoneAuthor) New(_ context.Context) error

func (NoneAuthor) Run

func (_ NoneAuthor) Run() fiber.Handler

type OIDCAuthor

type OIDCAuthor struct {
	*KubernetesAuthor
	// contains filtered or unexported fields
}

func (*OIDCAuthor) Authentication

func (o *OIDCAuthor) Authentication(next http.Handler) http.Handler

func (*OIDCAuthor) New

func (o *OIDCAuthor) New(ctx context.Context) (err error)

func (*OIDCAuthor) Run

func (o *OIDCAuthor) Run() fiber.Handler

Jump to

Keyboard shortcuts

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