useridentitymapping

package
v3.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Strategy = userIdentityMappingStrategy{kapi.Scheme}

Strategy is the default logic that applies when creating UserIdentityMapping objects via the REST API.

Functions

This section is empty.

Types

type REST

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

REST implements the RESTStorage interface in terms of an image registry and image repository registry. It only supports the Create method and is used to simplify adding a new Image and tag to an ImageRepository.

func NewREST

func NewREST(userRegistry user.Registry, identityRegistry identity.Registry) *REST

NewREST returns a new REST.

func (*REST) Create

func (s *REST) Create(ctx apirequest.Context, obj runtime.Object) (runtime.Object, error)

Create associates a user and identity if they both exist, and the identity is not already mapped to a user

func (*REST) Delete

func (s *REST) Delete(ctx apirequest.Context, name string) (runtime.Object, error)

Delete deletes the user association for the named identity

func (*REST) Get

func (s *REST) Get(ctx apirequest.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get returns the mapping for the named identity

func (*REST) New

func (r *REST) New() runtime.Object

New returns a new UserIdentityMapping for use with Create.

func (*REST) Update

func (s *REST) Update(ctx apirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error)

Update associates an identity with a user. Both the identity and user must already exist. If the identity is associated with another user already, it is disassociated.

type Registry

type Registry interface {
	// GetUserIdentityMapping returns a UserIdentityMapping for the named identity
	GetUserIdentityMapping(ctx apirequest.Context, name string, options *metav1.GetOptions) (*userapi.UserIdentityMapping, error)
	// CreateUserIdentityMapping associates a user and an identity
	CreateUserIdentityMapping(ctx apirequest.Context, mapping *userapi.UserIdentityMapping) (*userapi.UserIdentityMapping, error)
	// UpdateUserIdentityMapping updates an associated user and identity
	UpdateUserIdentityMapping(ctx apirequest.Context, mapping *userapi.UserIdentityMapping) (*userapi.UserIdentityMapping, error)
	// DeleteUserIdentityMapping removes the user association for the named identity
	DeleteUserIdentityMapping(ctx apirequest.Context, name string) error
}

Registry is an interface implemented by things that know how to store UserIdentityMapping objects.

func NewRegistry added in v0.4.2

func NewRegistry(s Storage) Registry

NewRegistry returns a new Registry interface for the given Storage. Any mismatched types will panic.

type Storage added in v0.4.2

type Storage interface {
	rest.Getter
	rest.Deleter

	Create(ctx apirequest.Context, obj runtime.Object) (runtime.Object, error)
	Update(ctx apirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error)
}

Storage is an interface for a standard REST Storage backend TODO: move me somewhere common

Jump to

Keyboard shortcuts

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