identitymapper

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MaxGenerateAttempts limits how many times we try to find an available username for a new identity
	MaxGenerateAttempts = 100

	// DefaultGenerator attempts to use the base name first, then "base2", "base3", ...
	DefaultGenerator = UserNameGenerator(func(base string, sequence int) string {
		if sequence == 0 {
			return base
		}
		return fmt.Sprintf("%s%d", base, sequence+1)
	})
)

Functions

func NewAlwaysCreateUserIdentityToUserMapper

func NewAlwaysCreateUserIdentityToUserMapper(identityRegistry identityregistry.Registry, userRegistry userregistry.Registry) authapi.UserIdentityMapper

NewAlwaysCreateUserIdentityToUserMapper returns an IdentityMapper that does the following: 1. Returns an existing user if the identity exists and is associated with an existing user 2. Returns an error if the identity exists and is not associated with a user 3. Creates the identity and creates and returns a new user with a unique username if the identity does not yet exist

func NewLookupIdentityMapper added in v0.4.2

func NewLookupIdentityMapper(registry useridentitymapping.Registry) authapi.UserIdentityMapper

NewLookupIdentityMapper returns a mapper that will look up existing mappings for identities

Types

type UserNameGenerator added in v0.4.2

type UserNameGenerator func(base string, sequence int) string

UserNameGenerator returns a username

Jump to

Keyboard shortcuts

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