{"modulePath":"github.phpd.cn/openshift/origin","version":"v3.8.0+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Constants\n\n```go\nconst (\n\t// IdentityDisplayNameKey is the key for an optional display name in an identity's Extra map\n\tIdentityDisplayNameKey = \"name\"\n\t// IdentityEmailKey is the key for an optional email address in an identity's Extra map\n\tIdentityEmailKey = \"email\"\n\t// IdentityPreferredUsernameKey is the key for an optional preferred username in an identity's Extra map.\n\t// This is useful when the immutable providerUserName is different than the login used to authenticate\n\t// If present, this extra value is used as the preferred username\n\tIdentityPreferredUsernameKey = \"preferred_username\"\n\n\tImpersonateUserHeader      = \"Impersonate-User\"\n\tImpersonateGroupHeader     = \"Impersonate-Group\"\n\tImpersonateUserScopeHeader = \"Impersonate-User-Scope\"\n)\n```\n\n## Types\n\n```go\ntype Client interface {\n\tGetId() string\n\tGetSecret() string\n\tGetRedirectUri() string\n\tGetUserData() interface{}\n}\n```\n\n```go\ntype DefaultUserIdentityInfo struct {\n\tProviderName     string\n\tProviderUserName string\n\tExtra            map[string]string\n}\n```\n\n```go\nfunc NewDefaultUserIdentityInfo(providerName, providerUserName string) *DefaultUserIdentityInfo\n```\nNewDefaultUserIdentityInfo returns a DefaultUserIdentityInfo with a non-nil Extra component\n\n```go\nfunc (i *DefaultUserIdentityInfo) GetExtra() map[string]string\n```\n\n```go\nfunc (i *DefaultUserIdentityInfo) GetIdentityName() string\n```\n\n```go\nfunc (i *DefaultUserIdentityInfo) GetProviderName() string\n```\n\n```go\nfunc (i *DefaultUserIdentityInfo) GetProviderUserName() string\n```\n\n```go\ntype Grant struct {\n\tClient      Client\n\tScope       string\n\tExpiration  int64\n\tRedirectURI string\n}\n```\n\n```go\ntype UserIdentityInfo interface {\n\t// GetIdentityName returns the name of this identity. It must be equal to GetProviderName() + \":\" + GetProviderUserName()\n\tGetIdentityName() string\n\t// GetProviderName returns the name of the provider of this identity.\n\tGetProviderName() string\n\t// GetProviderUserName uniquely identifies this particular identity for this provider.  It is NOT guaranteed to be unique across providers\n\tGetProviderUserName() string\n\t// GetExtra is a map to allow providers to add additional fields that they understand\n\tGetExtra() map[string]string\n}\n```\nUserIdentityInfo contains information about an identity.  Identities are distinct from users.  An authentication server of some kind (like oauth for example) describes an identity.  Our system controls the users mapped to this identity.\n\n```go\ntype UserIdentityMapper interface {\n\t// UserFor takes an identity, ignores the passed identity.Provider, forces the provider value to some other value and then creates the mapping.\n\t// It returns the corresponding user.Info\n\tUserFor(identityInfo UserIdentityInfo) (user.Info, error)\n}\n```\nUserIdentityMapper maps UserIdentities into user.Info objects to allow different user abstractions within auth code.\n\n","path":"github.phpd.cn/openshift/origin/pkg/auth/api","name":"api","synopsis":"","isRedistributable":true}
