Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationStore ¶
type AuthenticationStore interface {
ClientID() string
ClientSecret() string
SkipSSLValidation() bool
AccessToken() string
RefreshToken() string
SetAccessToken(token string)
}
AuthenticationStore represents the storage and configuration for the UAA client
type Client ¶
type Client struct {
URL string
// contains filtered or unexported fields
}
Client is the UAA client
func NewClient ¶
func NewClient(URL string, store AuthenticationStore) *Client
NewClient returns a new UAA client
func (*Client) AccessToken ¶
AccessToken returns the implicit grant access token
func (*Client) RefreshToken ¶
RefreshToken refreshes the current access token
type Connection ¶
Connection creates and executes http requests
type RefreshTokenResponse ¶
type RefreshTokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
}
RefreshTokenResponse represents the UAA refresh token response
func (RefreshTokenResponse) AuthorizationToken ¶
func (refreshTokenResponse RefreshTokenResponse) AuthorizationToken() string
AuthorizationToken returns formatted authorization header
type Request ¶
type Request struct {
// Header is the set of request headers
Header http.Header
// Params are the list URI route parameters
Params rata.Params
// Query is a list of HTTP query parameters
Query url.Values
// RequestName is the name of the request (see routes)
RequestName string
// Body is the request body
Body io.Reader
}
Request contains all the elements of a UAA request
type RequestError ¶
type RequestError struct {
Err error
}
RequestError represents a connection level request error
func (RequestError) Error ¶
func (e RequestError) Error() string
type Response ¶
type Response struct {
// Result is the unserialized response of the UAA request
Result interface{}
// RawResponse is the raw bytes of the HTTP Response
RawResponse []byte
}
Response contains the result of a UAA request
type UAAConnection ¶
type UAAConnection struct {
HTTPClient *http.Client
URL string
// contains filtered or unexported fields
}
UAAConnection represents the connection to UAA
func NewConnection ¶
func NewConnection(APIURL string, routes rata.Routes, skipSSLValidation bool) *UAAConnection
NewConnection returns a pointer to a new UAA Connection
type UnverifiedServerError ¶
type UnverifiedServerError struct {
URL string
}
UnverifiedServerError replaces x509.UnknownAuthorityError when the server has SSL but the client is unable to verify it's certificate
func (UnverifiedServerError) Error ¶
func (e UnverifiedServerError) Error() string