auth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DisableAuthEnvKey is the environment variable key used to disable auth when developing.
	DisableAuthEnvKey = "FLIGHTCTL_DISABLE_AUTH"
)

Variables

This section is empty.

Functions

func CreateAuthMiddleware

func CreateAuthMiddleware(cfg *config.Config, log logrus.FieldLogger) (func(http.Handler) http.Handler, error)

func ParseAuthHeader

func ParseAuthHeader(authHeader string) (string, bool)

Types

type AuthNMiddleware

type AuthNMiddleware interface {
	ValidateToken(ctx context.Context, token string) (bool, error)
	GetIdentity(ctx context.Context, token string) (*common.Identity, error)
	GetAuthConfig() common.AuthConfig
}

func GetAuthN

func GetAuthN() AuthNMiddleware

type AuthZMiddleware

type AuthZMiddleware interface {
	CheckPermission(ctx context.Context, resource string, op string) (bool, error)
}

func GetAuthZ

func GetAuthZ() AuthZMiddleware

type K8sToK8sAuth

type K8sToK8sAuth struct {
	authz.K8sAuthZ
}

func (K8sToK8sAuth) CheckPermission

func (o K8sToK8sAuth) CheckPermission(ctx context.Context, resource string, op string) (bool, error)

type NilAuth

type NilAuth struct{}

func (NilAuth) CheckPermission

func (NilAuth) CheckPermission(ctx context.Context, resource string, op string) (bool, error)

func (NilAuth) GetAuthConfig

func (a NilAuth) GetAuthConfig() common.AuthConfig

func (NilAuth) GetIdentity added in v0.4.0

func (a NilAuth) GetIdentity(ctx context.Context, token string) (*common.Identity, error)

func (NilAuth) ValidateToken

func (a NilAuth) ValidateToken(ctx context.Context, token string) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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