auth

package
v0.5.0-rc3 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 CreatePermissionsMiddleware added in v0.5.0

func CreatePermissionsMiddleware(log logrus.FieldLogger) func(http.Handler) http.Handler

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