auth

package
v3.2.3-jfd Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanI

func CanI(ctx context.Context, verb, resource, namespace, name string) (bool, error)

func DefaultClientForAuthorization

func DefaultClientForAuthorization(authorization string) (*rest.Config, *servertypes.Clients, error)

func GetClaims

func GetClaims(ctx context.Context) *types.Claims

func GetDynamicClient

func GetDynamicClient(ctx context.Context) dynamic.Interface

func GetEventSourceClient

func GetEventSourceClient(ctx context.Context) eventsource.Interface

func GetKubeClient

func GetKubeClient(ctx context.Context) kubernetes.Interface

func GetSensorClient

func GetSensorClient(ctx context.Context) sensor.Interface

func GetWfClient

func GetWfClient(ctx context.Context) workflow.Interface

func NewAuthorizingServerStream

func NewAuthorizingServerStream(ss grpc.ServerStream, gk Gatekeeper) *authorizingServerStream

Types

type ClientForAuthorization

type ClientForAuthorization func(authorization string) (*rest.Config, *servertypes.Clients, error)

type ContextKey

type ContextKey string
const (
	DynamicKey     ContextKey = "dynamic.Interface"
	WfKey          ContextKey = "workflow.Interface"
	SensorKey      ContextKey = "sensor.Interface"
	EventSourceKey ContextKey = "eventsource.Interface"
	KubeKey        ContextKey = "kubernetes.Interface"
	ClaimsKey      ContextKey = "types.Claims"
)

type Gatekeeper

type Gatekeeper interface {
	ContextWithRequest(ctx context.Context, req interface{}) (context.Context, error)
	Context(ctx context.Context) (context.Context, error)
	UnaryServerInterceptor() grpc.UnaryServerInterceptor
	StreamServerInterceptor() grpc.StreamServerInterceptor
}

func NewGatekeeper

func NewGatekeeper(modes Modes, clients *servertypes.Clients, restConfig *rest.Config, ssoIf sso.Interface, clientForAuthorization ClientForAuthorization, namespace string, ssoNamespace string, namespaced bool, cache *cache.ResourceCache) (Gatekeeper, error)

type Mode

type Mode string
const (
	Client Mode = "client"
	Server Mode = "server"
	SSO    Mode = "sso"
)

type Modes

type Modes map[Mode]bool

func (Modes) Add

func (m Modes) Add(value string) error

func (Modes) GetMode

func (m Modes) GetMode(authorisation string) (Mode, bool)

Directories

Path Synopsis
sso

Jump to

Keyboard shortcuts

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