Categorygithub.com/cloudfoundry-community/go-uaa
modulepackage
0.3.3
Repository: https://github.com/cloudfoundry-community/go-uaa.git
Documentation: pkg.go.dev

# README

go-uaa Travis-CI godoc Report card

Overview

go-uaa is a client library for the UAA API. It is a go module.

Usage

Step 1: Add go-uaa As A Dependency

$ go mod init # optional
$ go get -u github.com/cloudfoundry-community/go-uaa
$ cat go.mod
module github.com/cloudfoundry-community/go-uaa/cmd/test

go 1.13

require github.com/cloudfoundry-community/go-uaa latest

Step 2: Construct and Use uaa.API

Construct a uaa.API by using uaa.New(target string, authOpt AuthenticationOption, opts ...Option):

$ cat main.go
package main

import (
	"log"

	uaa "github.com/cloudfoundry-community/go-uaa"
)

func main() {
	// construct the API
	api, err := uaa.New(
		"https://uaa.example.net",
		uaa.WithClientCredentials("client-id", "client-secret", uaa.JSONWebToken),
	)
	if err != nil {
		log.Fatal(err)
	}

	// use the API to fetch a user
	user, err := api.GetUserByUsername("[email protected]", "uaa", "")
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("Hello, %s\n", user.Name.GivenName)
}

Experimental

  • For the foreseeable future, releases will be in the v0.x.y range
  • You should expect breaking changes until v1.x.y releases occur
  • Notifications of breaking changes will be made via release notes associated with each tag
  • You should use go modules with this package

Contributing

Pull requests welcome.

# Packages

No description provided by the author
Package passwordcredentials implements the OAuth2.0 "password credentials" token flow.

# Functions

BuildSubdomainURL returns a URL that optionally includes the zone ID as a host prefix.
BuildTargetURL returns a URL.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

Valid GrantType values.
Valid GrantType values.
ClientsEndpoint is the path to the clients resource.
GroupsEndpoint is the path to the groups resource.
IdentityZonesEndpoint is the path to the users resource.
Valid GrantType values.
Valid TokenFormat values.
MFAProvidersEndpoint is the path to the MFA providers resource.
Valid TokenFormat values.
Valid GrantType values.
Valid GrantType values.
SortAscending sorts in ascending order.
SortDescending sorts in descending order.
UsersEndpoint is the path to the users resource.

# Structs

API is a client to the UAA API.
Approval is a record of the user's explicit approval or rejection for an application's request for delegated permissions.
Branding is the branding for a UAA identity zone.
Client is a UAA client http://docs.cloudfoundry.org/api/uaa/version/4.19.0/index.html#clients.
ClientSecretPolicy is an identity zone client secret policy.
CORSPolicy is an identity zone CORSPolicy.
Email is an email address.
Group is a container for users and groups.
GroupMapping is a container for external group mapping.
GroupMember is a user or a group.
IdentityZone is a UAA identity zone.
IdentityZoneConfig is the configuration for an identity zone.
IdentityZoneLinks is an identity zone link.
IdentityZoneMFAConfig is the MFA configuration for an identity zone.
IdentityZoneUserConfig is the user configuration for an identity zone.
Info is information about the UAA server.
JWK represents a JSON Web Key (https://tools.ietf.org/html/rfc7517).
Keys is a slice of JSON Web Keys.
Meta describes the version and timestamps for a resource.
MFAProvider is a UAA MFA provider http://docs.cloudfoundry.org/api/uaa/version/4.19.0/index.html#get-2.
MFAProviderConfig is configuration for an MFA provider.
No description provided by the author
Page represents a page of information returned from the UAA API.
PhoneNumber is a phone number for a user.
Prompt is a UAA prompt.
No description provided by the author
SAMLConfig is an identity zone SAMLConfig.
SAMLKey is an identity zone SAML key.
TokenPolicy is an identity zone token policy.
User is a UAA user http://docs.cloudfoundry.org/api/uaa/version/4.14.0/index.html#get-3.
UserGroup is a group that a user belongs to.
UserInfo is a protected resource required for OpenID Connect compatibility.
UserName is a person's name.

# Interfaces

No description provided by the author
No description provided by the author

# Type aliases

GrantType is a type of oauth2 grant.
SortOrder defines the sort order when listing users or groups.
TokenFormat is the format of a token.