api

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2015 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetId() string
	GetSecret() string
	GetRedirectUri() string
	GetUserData() interface{}
}

type DefaultUserIdentityInfo added in v0.2.1

type DefaultUserIdentityInfo struct {
	UserName     string
	ProviderName string
	Extra        map[string]string
}

func NewDefaultUserIdentityInfo added in v0.2.1

func NewDefaultUserIdentityInfo(username string) DefaultUserIdentityInfo

NewDefaultUserIdentityInfo returns a DefaultUserIdentity info with a non-nil Extra component

func (*DefaultUserIdentityInfo) GetExtra added in v0.2.1

func (i *DefaultUserIdentityInfo) GetExtra() map[string]string

func (*DefaultUserIdentityInfo) GetProviderName added in v0.2.1

func (i *DefaultUserIdentityInfo) GetProviderName() string

func (*DefaultUserIdentityInfo) GetUserName added in v0.2.1

func (i *DefaultUserIdentityInfo) GetUserName() string

type DefaultUserInfo

type DefaultUserInfo struct {
	Name   string
	UID    string
	Groups []string
	Scope  string
	Extra  map[string]string
}

func (*DefaultUserInfo) GetExtra

func (i *DefaultUserInfo) GetExtra() map[string]string

func (*DefaultUserInfo) GetGroups added in v0.2.1

func (i *DefaultUserInfo) GetGroups() []string

func (*DefaultUserInfo) GetName

func (i *DefaultUserInfo) GetName() string

func (*DefaultUserInfo) GetScope

func (i *DefaultUserInfo) GetScope() string

func (*DefaultUserInfo) GetUID

func (i *DefaultUserInfo) GetUID() string

type Grant

type Grant struct {
	Client      Client
	Scope       string
	Expiration  int64
	RedirectURI string
}

type UserIdentityInfo added in v0.2.1

type UserIdentityInfo interface {
	// GetUserName uniquely identifies this particular identity for this provider.  It is NOT guaranteed to be unique across providers
	GetUserName() string
	// GetProviderName returns the name of the provider of this identity.
	GetProviderName() string
	// GetExtra is a map to allow providers to add additional fields that they understand
	GetExtra() map[string]string
}

UserIdentityInfo 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.

type UserIdentityMapper added in v0.2.1

type UserIdentityMapper interface {
	// UserFor takes an identity, ignores the passed identity.Provider, forces the provider value to some other value and then creates the mapping.
	// It returns the corresponding UserInfo
	UserFor(identityInfo UserIdentityInfo) (UserInfo, error)
}

UserIdentityMapper maps UserIdentities into UserInfo objects to allow different user abstractions within auth code.

type UserInfo

type UserInfo interface {
	GetName() string
	GetUID() string
	GetGroups() []string
	GetScope() string
	GetExtra() map[string]string
}

TODO: Add display name to common meta?

Jump to

Keyboard shortcuts

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