directoryrolebinding

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 23 Imported by: 3

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 Add

func Add(ctx context.Context, logger kitlog.Logger, mgr manager.Manager, provider DirectoryProvider, refreshInterval time.Duration, opts ...func(*controller.Options)) (controller.Controller, error)

Add instantiates a DirectoryRoleBinding controller and adds it to the manager. To ensure we respond to changes in the directory source, we provide a refreshInterval duration that tells the controller to re-enqueue a reconcile after each successful process. Setting this to 0 will disable the re-enqueue.

func NewCachedDirectory

func NewCachedDirectory(logger kitlog.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 Reconciler

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

func (*Reconciler) ReconcileObject

func (r *Reconciler) ReconcileObject(logger kitlog.Logger, request reconcile.Request, drb *rbacv1alpha1.DirectoryRoleBinding) (res reconcile.Result, err error)

Jump to

Keyboard shortcuts

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