auth

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BearerTokenChecker

type BearerTokenChecker struct {
	Checker
	// contains filtered or unexported fields
}

func (*BearerTokenChecker) CheckAuth

func (c *BearerTokenChecker) CheckAuth(ctx context.Context, header http.Header) error

type CheckType

type CheckType string
const (
	AuthHeader                   = "Authorization"
	CheckAuthenticated CheckType = "authenticated"
	CheckAdmin         CheckType = "admin"
	CheckNone          CheckType = "none"
)

type Checker

type Checker interface {
	CheckAuth(ctx context.Context, header http.Header) error
}

func NewChecker

func NewChecker(typez CheckType, apiProvider client.APIProvider) (Checker, error)

type NoopChecker

type NoopChecker struct {
	Checker
}

func (*NoopChecker) CheckAuth

func (b *NoopChecker) CheckAuth(_ context.Context, _ http.Header) error

Jump to

Keyboard shortcuts

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