{"modulePath":"github.com/cloudfoundry/cli","version":"v7.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package uaa\n\nPackage uaa is a GoLang library that interacts with CloudFoundry User Account and Authentication (UAA) Server.\n\nIt is currently designed to support UAA API X.X.X. However, it may include features and endpoints of later API versions.\n\n## Functions\n\n```go\nfunc NewErrorWrapper() *errorWrapper\n```\nNewErrorWrapper returns a new error wrapper.\n\n## Types\n\n```go\ntype AccountLockedError struct {\n\tMessage string\n}\n```\n\n```go\nfunc (e AccountLockedError) Error() string\n```\n\n```go\ntype AuthResponse struct {\n\tAccessToken  string `json:\"access_token\"`\n\tRefreshToken string `json:\"refresh_token\"`\n}\n```\nAuthResponse contains the access token and refresh token which are granted after UAA has authorized a user.\n\n```go\ntype Client struct {\n\tInfo\n\t// contains filtered or unexported fields\n}\n```\nClient is the UAA client\n\n```go\nfunc NewClient(config Config) *Client\n```\nNewClient returns a new UAA Client with the provided configuration\n\n```go\nfunc (client Client) Authenticate(creds map[string]string, origin string, grantType constant.GrantType) (string, string, error)\n```\nAuthenticate sends a username and password to UAA then returns an access token and a refresh token.\n\n```go\nfunc (client *Client) CreateUser(user string, password string, origin string) (User, error)\n```\nCreateUser creates a new UAA user account with the provided password.\n\n```go\nfunc (client *Client) DeleteUser(userGuid string) (User, error)\n```\n\n```go\nfunc (client *Client) GetSSHPasscode(accessToken string, sshOAuthClient string) (string, error)\n```\n\n```go\nfunc (client Client) ListUsers(userName, origin string) ([]User, error)\n```\nListUsers gets a list of users from UAA with the given username and (if provided) origin. NOTE: that this is a paginated response and we are only currently returning the first page of users. This will mean, if no origin is passed and there are more than 100 users with the given username, only the first 100 will be returned. For our current purposes, this is more than enough, but it would be a problem if we ever need to get all users with a username.\n\n```go\nfunc (client *Client) RefreshAccessToken(refreshToken string) (RefreshedTokens, error)\n```\nRefreshAccessToken refreshes the current access token.\n\n```go\nfunc (client Client) Revoke(token string) error\n```\n\n```go\nfunc (client *Client) SetupResources(bootstrapURL string) error\n```\nSetupResources configures the client to use the specified settings and diescopers the UAA and Authentication resources\n\n```go\nfunc (client *Client) UpdatePassword(userGUID string, oldPassword string, newPassword string) error\n```\n\n```go\nfunc (client Client) ValidateClientUser(clientID string) error\n```\n\n```go\nfunc (client *Client) WrapConnection(wrapper ConnectionWrapper)\n```\nWrapConnection wraps the current Client connection in the wrapper.\n\n```go\ntype Config interface {\n\t// BinaryName is the name of the application/process using the client.\n\tBinaryName() string\n\n\t// BinaryVersion is the version of the application/process using the client.\n\tBinaryVersion() string\n\n\t// DialTimeout is the DNS lookup timeout for the client. If not set, it is\n\t// infinite.\n\tDialTimeout() time.Duration\n\n\t// SetUAAEndpoint sets the UAA endpoint that is obtained from hitting\n\t// \u003cAuthorizationEndpoint\u003e/login.\n\tSetUAAEndpoint(uaaEndpoint string)\n\n\t// SkipSSLValidation controls whether a client verifies the server's\n\t// certificate chain and host name. If SkipSSLValidation is true, TLS accepts\n\t// any certificate presented by the server and any host name in that\n\t// certificate for *all* client requests going forward.\n\t//\n\t// In this mode, TLS is susceptible to man-in-the-middle attacks. This should\n\t// be used only for testing.\n\tSkipSSLValidation() bool\n\n\t// UAADisableKeepAlives controls whether the UAA client will reuse TCP connections\n\t// for multiple requests. If true, the client will always use a new TCP request\n\t// and set Connection: close in the request header. If false, the client\n\t// will reuse the TCP connection.\n\tUAADisableKeepAlives() bool\n\n\t// UAAGrantType returns the grant type of the supplied UAA credentials.\n\tUAAGrantType() string\n\n\t// UAAOAuthClient is the UAA client ID the client will use.\n\tUAAOAuthClient() string\n\n\t// UAAOAuthClientSecret is the UAA client secret the client will use.\n\tUAAOAuthClientSecret() string\n}\n```\nConfig allows the Client to be configured\n\n```go\ntype ConflictError struct {\n\tMessage string\n}\n```\nConflictError is returned when the response status code is 409. It represents when there is a conflict in the state of the requested resource.\n\n```go\nfunc (e ConflictError) Error() string\n```\n\n```go\ntype Connection interface {\n\tMake(request *http.Request, passedResponse *Response) error\n}\n```\nConnection creates and executes http requests\n\n```go\ntype ConnectionWrapper interface {\n\tConnection\n\tWrap(innerconnection Connection) Connection\n}\n```\nConnectionWrapper can wrap a given connection allowing the wrapper to modify all requests going in and out of the given connection.\n\n```go\ntype Info struct {\n\tApp struct {\n\t\tVersion string `json:\"version\"`\n\t} `json:\"app\"`\n\tLinks struct {\n\t\tUAA   string `json:\"uaa\"`\n\t\tLogin string `json:\"login\"`\n\t} `json:\"links\"`\n\tPrompts map[string][]string `json:\"prompts\"`\n}\n```\nInfo represents a GET response from a login server\n\n```go\nfunc NewInfo(link string) Info\n```\nNewInfo returns back a new\n\n```go\nfunc (info Info) APIVersion() string\n```\nAPIVersion is the version of the server.\n\n```go\nfunc (info Info) LoginLink() string\n```\nLoginLink is the URL to the login server.\n\n```go\nfunc (info Info) LoginPrompts() map[string][]string\n```\n\n```go\nfunc (info Info) UAALink() string\n```\nUAALink is the URL to the UAA server.\n\n```go\ntype InsufficientScopeError struct {\n\tMessage string\n}\n```\nInsufficientScopeError is returned when the client has insufficient scope\n\n```go\nfunc (e InsufficientScopeError) Error() string\n```\n\n```go\ntype InvalidAuthTokenError struct {\n\tMessage string\n}\n```\nInvalidAuthTokenError is returned when the client has an invalid authorization header.\n\n```go\nfunc (e InvalidAuthTokenError) Error() string\n```\n\n```go\ntype InvalidPasswordError struct {\n\tMessage string\n}\n```\n\n```go\nfunc (e InvalidPasswordError) Error() string\n```\n\n```go\ntype InvalidSCIMResourceError struct {\n\tMessage string\n}\n```\nInvalidSCIMResourceError is returned usually when the client tries to create an inproperly formatted username\n\n```go\nfunc (e InvalidSCIMResourceError) Error() string\n```\n\n```go\ntype RawHTTPStatusError struct {\n\tStatusCode  int\n\tRawResponse []byte\n}\n```\nRawHTTPStatusError represents any response with a 4xx or 5xx status code.\n\n```go\nfunc (r RawHTTPStatusError) Error() string\n```\n\n```go\ntype RefreshedTokens struct {\n\tAccessToken  string `json:\"access_token\"`\n\tRefreshToken string `json:\"refresh_token\"`\n\tType         string `json:\"token_type\"`\n}\n```\nRefreshedTokens represents the UAA refresh token response.\n\n```go\nfunc (refreshTokenResponse RefreshedTokens) AuthorizationToken() string\n```\nAuthorizationToken returns formatted authorization header.\n\n```go\ntype RequestError struct {\n\tErr error\n}\n```\nRequestError represents a generic error encountered while performing the HTTP request. This generic error occurs before a HTTP response is obtained.\n\n```go\nfunc (e RequestError) Error() string\n```\n\n```go\ntype Response struct {\n\t// Result represents the resource entity type that is expected in the\n\t// response JSON.\n\tResult interface{}\n\n\t// RawResponse represents the response body.\n\tRawResponse []byte\n\n\t// HTTPResponse represents the HTTP response object.\n\tHTTPResponse *http.Response\n}\n```\nResponse represents an UAA response object.\n\n```go\ntype UAAConnection struct {\n\tHTTPClient *http.Client\n}\n```\nUAAConnection represents the connection to UAA\n\n```go\nfunc NewConnection(skipSSLValidation bool, disableKeepAlives bool, dialTimeout time.Duration) *UAAConnection\n```\nNewConnection returns a pointer to a new UAA Connection\n\n```go\nfunc (connection *UAAConnection) Make(request *http.Request, passedResponse *Response) error\n```\nMake takes a passedRequest, converts it into an HTTP request and then executes it. The response is then injected into passedResponse.\n\n```go\ntype UAAErrorResponse struct {\n\tType        string `json:\"error\"`\n\tDescription string `json:\"error_description\"`\n}\n```\nUAAErrorResponse represents a generic UAA error response.\n\n```go\nfunc (e UAAErrorResponse) Error() string\n```\n\n```go\ntype UnauthorizedError struct {\n\tMessage string\n}\n```\nUnauthorizedError is returned when the authentication informatin is invalid.\n\n```go\nfunc (e UnauthorizedError) Error() string\n```\n\n```go\ntype UnverifiedServerError struct {\n\tURL string\n}\n```\nUnverifiedServerError replaces x509.UnknownAuthorityError when the server has SSL but the client is unable to verify it's certificate\n\n```go\nfunc (e UnverifiedServerError) Error() string\n```\n\n```go\ntype User struct {\n\tID     string\n\tOrigin string\n}\n```\nUser represents an UAA user account.\n\n","path":"github.com/cloudfoundry/cli/api/uaa","name":"uaa","synopsis":"Package uaa is a GoLang library that interacts with CloudFoundry User Account and Authentication (UAA) Server.","isRedistributable":true}
