uaa

package
v6.22.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

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

func (client *Client) AccessToken() string

AccessToken returns the implicit grant access token

func (*Client) RefreshToken

func (client *Client) RefreshToken() error

RefreshToken refreshes the current access token

type Connection

type Connection interface {
	Make(passedRequest Request, passedResponse *Response) error
}

Connection creates and executes http requests

type Error

type Error struct {
	Type        string `json:"error"`
	Description string `json:"error_description"`
}

Error is an error returned by the UAA

func (Error) Error

func (r Error) Error() string

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

func NewRequest

func NewRequest(requestName string, params rata.Params, header http.Header, query url.Values, body ...io.Reader) Request

NewRequest contains a constructed UAA request with some defaults. There is an optional body that can be passed, however only the first body is used.

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

func (*UAAConnection) Make

func (connection *UAAConnection) Make(passedRequest Request, passedResponse *Response) error

Make takes a passedRequest, converts it into an HTTP request and then executes it. The response is then injected into passedResponse.

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

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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