directoryrolebinding

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventRoleBindingCreated = "Created"
	EventError              = "Error"
	EventSubjectAdd         = "SubjectAdd"
	EventSubjectRemove      = "SubjectRemove"
	EventSubjectsModified   = "SubjectsModified"
)
View Source
const (
	// GooglePerPage states how many members we retrive in each pagination call when talking
	// to the Google directory service
	GooglePerPage = 200
	// GoogleMaxPages limits the number of pages we iterate through when talking to the
	// Google directory service. In combination with the GooglePerPage constant, this
	// effectively limits the size of the group we can process.
	GoogleMaxPages = 10
)

Variables

This section is empty.

Functions

func NewCachedDirectory

func NewCachedDirectory(logger logr.Logger, directory Directory, ttl time.Duration) *cachedDirectory

NewCachedDirectory wraps the given directory so that we cache member lists for the given TTL. This is useful when we want to reason about the maximum number of calls to a directory API our controllers might make, which helps us avoid API rate limits.

func NewFakeDirectory

func NewFakeDirectory(groups map[string][]string) *fakeDirectory

NewFakeDirectory provides the directory service from a map of members

func NewGoogleDirectory

func NewGoogleDirectory(service *directoryv1.MembersService) *googleDirectory

NewGoogleDirectory wraps a Google admin directory service to match our interface

Types

type Directory

type Directory interface {
	MembersOf(ctx context.Context, group string) ([]string, error)
}

Directory is the interface we expect to be exposed by a directory system.

type DirectoryProvider

type DirectoryProvider map[string]Directory

DirectoryProvider understands what directory service to use for different subject kinds

func (DirectoryProvider) Get

func (p DirectoryProvider) Get(kind string) Directory

func (DirectoryProvider) Register

func (p DirectoryProvider) Register(kind string, directory Directory)

type DirectoryRoleBindingReconciler

type DirectoryRoleBindingReconciler struct {
	client.Client
	Ctx             context.Context
	Log             logr.Logger
	Provider        DirectoryProvider
	RefreshInterval time.Duration
	Scheme          *runtime.Scheme
}

DirectoryRoleBindingReconciler reconciles a DirectoryRoleBinding object

func (*DirectoryRoleBindingReconciler) ReconcileObject

func (*DirectoryRoleBindingReconciler) SetupWithManager

func (r *DirectoryRoleBindingReconciler) SetupWithManager(mgr manager.Manager) error

Jump to

Keyboard shortcuts

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