Documentation ¶
Overview ¶
Package to interact with Cloudfoundry UAA server. Constructors are generally provided for objects a client needs to use
This link is helpful for understanding UAA OAUTH handshakes: http://blog.cloudfoundry.org/2012/07/23/uaa-intro/
Index ¶
- Constants
- Variables
- func GetClient(client Client) *http.Client
- func GetTokenKey(u UAA) (string, error)
- func ThereAreMorePages(users []User, totalResults int) bool
- func UsersEmailsQueryURIFromParts(host string, filters []string) string
- func UsersGUIDsByScope(u UAA, scope string) ([]string, error)
- func UsersQueryURIFromParts(host string, filters []string) string
- func UsersQueryURIFromStartIndex(host string, startIndex int) string
- type AllUsersInterface
- type AuthorizeURLInterface
- type Client
- type ExchangeInterface
- type Failure
- type GetClientTokenInterface
- type GetTokenKeyInterface
- type LoginURLInterface
- type Name
- type RefreshInterface
- type SetTokenInterface
- type Token
- type UAA
- func (u UAA) AllUsers() ([]User, error)
- func (u UAA) AuthorizeURL() string
- func (u UAA) Exchange(authCode string) (Token, error)
- func (u UAA) GetClientToken() (Token, error)
- func (u UAA) GetTokenKey() (string, error)
- func (u UAA) LoginURL() string
- func (u UAA) Refresh(refreshToken string) (Token, error)
- func (u *UAA) SetToken(token string)
- func (u UAA) UserByID(id string) (User, error)
- func (u UAA) UsersByIDs(ids ...string) ([]User, error)
- func (u UAA) UsersEmailsByIDs(ids ...string) ([]User, error)
- func (u UAA) UsersGUIDsByScope(scope string) ([]string, error)
- type UAAInterface
- type User
- func AllUsers(u UAA) ([]User, error)
- func PaginatedUsersFromQuery(u UAA, uriString string) ([]User, int, error)
- func UserByID(u UAA, id string) (User, error)
- func UserFromJSON(jsonBytes []byte) (User, error)
- func UserFromResource(resource map[string]interface{}) (User, error)
- func UsersByIDs(u UAA, ids ...string) ([]User, error)
- func UsersByIDsWithMaxLength(u UAA, length int, ids ...string) ([]User, error)
- func UsersEmailsByIDs(uaa UAA, ids ...string) ([]User, error)
- func UsersEmailsByIDsWithMaxLength(u UAA, length int, ids ...string) ([]User, error)
- func UsersFromQuery(u UAA, uriString string) ([]User, error)
- type UserByIDInterface
- type UsersByIDsInterface
- type UsersEmailsByIDsInterface
- type UsersGUIDsByScopeInterface
Constants ¶
View Source
const MaxQueryLength = 8000
Variables ¶
View Source
var ( TokenDecodeError = errors.New("Failed to decode token") JSONParseError = errors.New("Failed to parse JSON") )
View Source
var InvalidRefreshToken = errors.New("UAA Invalid Refresh Token")
Functions ¶
func GetTokenKey ¶
func ThereAreMorePages ¶
func UsersQueryURIFromParts ¶
Types ¶
type AllUsersInterface ¶
type AuthorizeURLInterface ¶
type AuthorizeURLInterface interface {
AuthorizeURL() string
}
type Client ¶
type Client struct { Host string BasicAuthUsername string BasicAuthPassword string AccessToken string VerifySSL bool }
Http Client, wraps go's http.Client for our usecase
func (Client) MakeRequest ¶
Make request with the given basic auth and ssl settings, returns reponse code and body as a byte array
func (Client) WithAuthorizationToken ¶
func (Client) WithBasicAuthCredentials ¶
type ExchangeInterface ¶
type Failure ¶
type Failure struct {
// contains filtered or unexported fields
}
used to encapuslate info about errors
type GetClientTokenInterface ¶
type GetTokenKeyInterface ¶
type LoginURLInterface ¶
type LoginURLInterface interface {
LoginURL() string
}
type RefreshInterface ¶
type SetTokenInterface ¶
type SetTokenInterface interface {
SetToken(string)
}
type Token ¶
Encapsulates the access and refresh tokens from UAA
func GetClientToken ¶
Retrieves ClientToken from UAA server
func (Token) ExpiresBefore ¶
Determines if the token expires by the current time plus the time buffer
type UAA ¶
type UAA struct { ClientID string ClientSecret string RedirectURL string Scope string State string AccessType string ApprovalPrompt string AccessToken string VerifySSL bool ExchangeCommand func(UAA, string) (Token, error) RefreshCommand func(UAA, string) (Token, error) GetClientTokenCommand func(UAA) (Token, error) UserByIDCommand func(UAA, string) (User, error) GetTokenKeyCommand func(UAA) (string, error) UsersByIDsCommand func(UAA, ...string) ([]User, error) UsersEmailsByIDsCommand func(UAA, ...string) ([]User, error) UsersGUIDsByScopeCommand func(UAA, string) ([]string, error) AllUsersCommand func(UAA) ([]User, error) // contains filtered or unexported fields }
Contains necessary info to communicate with Cloudfoundry UAA server, use the NewUAA constructor to create one.
func (UAA) AuthorizeURL ¶
func (UAA) GetClientToken ¶
Retrieves ClientToken from UAA server
func (UAA) GetTokenKey ¶
type UAAInterface ¶
type UAAInterface interface { AuthorizeURLInterface LoginURLInterface SetTokenInterface ExchangeInterface GetClientTokenInterface GetTokenKeyInterface RefreshInterface UserByIDInterface UsersByIDsInterface UsersEmailsByIDsInterface UsersGUIDsByScopeInterface AllUsersInterface }
Defines methods needed for clients to use UAA
type User ¶
func PaginatedUsersFromQuery ¶
func UserFromJSON ¶
func UserFromResource ¶
func UsersByIDsWithMaxLength ¶
type UserByIDInterface ¶
type UsersByIDsInterface ¶
Click to show internal directories.
Click to hide internal directories.