auth

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package auth is a generated GoMock package.

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 CreateAuthNMiddleware added in v0.6.0

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

func CreateAuthZMiddleware added in v0.6.0

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

func InitAuth added in v0.6.0

func InitAuth(cfg *config.Config, log logrus.FieldLogger) error

Types

type AuthNMiddleware

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

func GetAuthN

func GetAuthN() AuthNMiddleware

type AuthType added in v0.7.0

type AuthType string
const (
	AuthTypeNil  AuthType = "nil"
	AuthTypeK8s  AuthType = "k8s"
	AuthTypeOIDC AuthType = "oidc"
	AuthTypeAAP  AuthType = "aap"
)

func GetConfiguredAuthType added in v0.7.0

func GetConfiguredAuthType() AuthType

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 MockAuthNMiddleware added in v0.6.0

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

MockAuthNMiddleware is a mock of AuthNMiddleware interface.

func NewMockAuthNMiddleware added in v0.6.0

func NewMockAuthNMiddleware(ctrl *gomock.Controller) *MockAuthNMiddleware

NewMockAuthNMiddleware creates a new mock instance.

func (*MockAuthNMiddleware) EXPECT added in v0.6.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAuthNMiddleware) GetAuthConfig added in v0.6.0

func (m *MockAuthNMiddleware) GetAuthConfig() common.AuthConfig

GetAuthConfig mocks base method.

func (*MockAuthNMiddleware) GetAuthToken added in v0.6.0

func (m *MockAuthNMiddleware) GetAuthToken(r *http.Request) (string, error)

GetAuthToken mocks base method.

func (*MockAuthNMiddleware) GetIdentity added in v0.6.0

func (m *MockAuthNMiddleware) GetIdentity(ctx context.Context, token string) (*common.Identity, error)

GetIdentity mocks base method.

func (*MockAuthNMiddleware) ValidateToken added in v0.6.0

func (m *MockAuthNMiddleware) ValidateToken(ctx context.Context, token string) error

ValidateToken mocks base method.

type MockAuthNMiddlewareMockRecorder added in v0.6.0

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

MockAuthNMiddlewareMockRecorder is the mock recorder for MockAuthNMiddleware.

func (*MockAuthNMiddlewareMockRecorder) GetAuthConfig added in v0.6.0

func (mr *MockAuthNMiddlewareMockRecorder) GetAuthConfig() *gomock.Call

GetAuthConfig indicates an expected call of GetAuthConfig.

func (*MockAuthNMiddlewareMockRecorder) GetAuthToken added in v0.6.0

func (mr *MockAuthNMiddlewareMockRecorder) GetAuthToken(r any) *gomock.Call

GetAuthToken indicates an expected call of GetAuthToken.

func (*MockAuthNMiddlewareMockRecorder) GetIdentity added in v0.6.0

func (mr *MockAuthNMiddlewareMockRecorder) GetIdentity(ctx, token any) *gomock.Call

GetIdentity indicates an expected call of GetIdentity.

func (*MockAuthNMiddlewareMockRecorder) ValidateToken added in v0.6.0

func (mr *MockAuthNMiddlewareMockRecorder) ValidateToken(ctx, token any) *gomock.Call

ValidateToken indicates an expected call of ValidateToken.

type MockAuthZMiddleware added in v0.6.0

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

MockAuthZMiddleware is a mock of AuthZMiddleware interface.

func NewMockAuthZMiddleware added in v0.6.0

func NewMockAuthZMiddleware(ctrl *gomock.Controller) *MockAuthZMiddleware

NewMockAuthZMiddleware creates a new mock instance.

func (*MockAuthZMiddleware) CheckPermission added in v0.6.0

func (m *MockAuthZMiddleware) CheckPermission(ctx context.Context, resource, op string) (bool, error)

CheckPermission mocks base method.

func (*MockAuthZMiddleware) EXPECT added in v0.6.0

EXPECT returns an object that allows the caller to indicate expected use.

type MockAuthZMiddlewareMockRecorder added in v0.6.0

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

MockAuthZMiddlewareMockRecorder is the mock recorder for MockAuthZMiddleware.

func (*MockAuthZMiddlewareMockRecorder) CheckPermission added in v0.6.0

func (mr *MockAuthZMiddlewareMockRecorder) CheckPermission(ctx, resource, op any) *gomock.Call

CheckPermission indicates an expected call of CheckPermission.

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) GetAuthToken added in v0.6.0

func (NilAuth) GetAuthToken(r *http.Request) (string, error)

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) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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