{"modulePath":"github.com/2lambda123/openshift-origin","version":"v4.1.0+incompatible","isLatest":true,"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```\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 OAuthClientGetter interface {\n\tGet(name string, options metav1.GetOptions) (*oauthapi.OAuthClient, error)\n}\n```\nOAuthClientGetter exposes a way to get a specific client.  This is useful for other registries to get scope limitations on particular clients.   This interface will make its easier to write a future cache on it\n\n```go\ntype ProviderInfo struct {\n\t// Name is unique and corresponds to the name of the identity provider in the oauth configuration\n\tName string\n\t// URL to login using this identity provider\n\tURL string\n}\n```\nProviderInfo represents display information for an oauth identity provider.  This is used by the selection provider template to render links to login using different identity providers.\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.com/2lambda123/openshift-origin/pkg/oauthserver/api","name":"api","synopsis":"","isRedistributable":true}
