auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package auth is a generated GoMock package.

Index

Constants

View Source
const (
	AuthTypeK8s       = "k8s"
	AuthTypeOIDC      = "oidc"
	AuthTypeAAP       = "aap"
	AuthTypeOpenShift = "openshift"
	AuthTypeOauth2    = "oauth2"
)

Supported auth types

Variables

This section is empty.

Functions

func CreateAuthNMiddleware added in v0.6.0

func CreateAuthNMiddleware(multiAuth common.MultiAuthNMiddleware, log logrus.FieldLogger) func(http.Handler) http.Handler

func CreateAuthZMiddleware added in v0.6.0

func CreateAuthZMiddleware(authZ AuthZMiddleware, log logrus.FieldLogger) func(http.Handler) http.Handler

func GetConfiguredAuthType added in v0.7.0

func GetConfiguredAuthType() string

GetConfiguredAuthType returns the configured auth type

func InitMultiAuth added in v1.0.0

func InitMultiAuth(cfg *config.Config, log logrus.FieldLogger,
	authProviderService authn.AuthProviderService) (*authn.MultiAuth, error)

InitMultiAuth initializes authentication with support for multiple methods

Types

type AuthNMiddleware

type AuthNMiddleware = common.AuthNMiddleware

AuthNMiddleware is the interface for authentication middleware

type AuthZMiddleware

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

AuthZMiddleware is the interface for authorization middleware

func InitMultiAuthZ added in v1.0.0

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

InitMultiAuthZ initializes authorization with support for multiple methods

type Identity added in v1.0.0

type Identity = common.Identity

Identity is the interface for user identity

type K8sToK8sAuth

type K8sToK8sAuth struct {
	authz.K8sAuthZ
}

func (K8sToK8sAuth) CheckPermission

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

func (K8sToK8sAuth) GetUserPermissions added in v1.0.0

func (o K8sToK8sAuth) GetUserPermissions(ctx context.Context) (*api.PermissionList, error)

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.

func (*MockAuthZMiddleware) GetUserPermissions added in v1.0.0

func (m *MockAuthZMiddleware) GetUserPermissions(ctx context.Context) (*api.PermissionList, error)

GetUserPermissions mocks base method.

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.

func (*MockAuthZMiddlewareMockRecorder) GetUserPermissions added in v1.0.0

func (mr *MockAuthZMiddlewareMockRecorder) GetUserPermissions(ctx any) *gomock.Call

GetUserPermissions indicates an expected call of GetUserPermissions.

type MultiAuthZ added in v1.0.0

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

MultiAuthZ routes authorization requests based on the identity's issuer type

func (*MultiAuthZ) CheckPermission added in v1.0.0

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

CheckPermission checks permission based on the identity's issuer type

func (*MultiAuthZ) GetUserPermissions added in v1.0.0

func (m *MultiAuthZ) GetUserPermissions(ctx context.Context) (*api.PermissionList, error)

GetUserPermissions gets all permissions for the user based on the identity's issuer type

func (*MultiAuthZ) Start added in v1.0.0

func (m *MultiAuthZ) Start(ctx context.Context)

Start initializes the MultiAuthZ with the given context for cache lifecycle management

Directories

Path Synopsis
Package common is a generated GoMock package.
Package common is a generated GoMock package.
oidc
pam

Jump to

Keyboard shortcuts

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