uaa

package
v0.0.0-...-7b51e20 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK    = UaaHealthStatus("ok")
	ERROR = UaaHealthStatus("health_error")
)
View Source
const (
	OPAQUE = TokenFormat("opaque")
	JWT    = TokenFormat("jwt")
)
View Source
const (
	REFRESH_TOKEN      = GrantType("refresh_token")
	AUTHCODE           = GrantType("authorization_code")
	IMPLICIT           = GrantType("implicit")
	PASSWORD           = GrantType("password")
	CLIENT_CREDENTIALS = GrantType("client_credentials")
)
View Source
const (
	SORT_ASCENDING  = ScimSortOrder("ascending")
	SORT_DESCENDING = ScimSortOrder("descending")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Approval

type Approval struct {
	UserId        string `json:"userId,omitempty"`
	ClientId      string `json:"clientId,omitempty"`
	Scope         string `json:"scope,omitempty"`
	Status        string `json:"status,omitempty"`
	LastUpdatedAt string `json:"lastUpdatedAt,omitempty"`
	ExpiresAt     string `json:"expiresAt,omitempty"`
}

type AuthenticatedRequestFactory

type AuthenticatedRequestFactory struct{}

func (AuthenticatedRequestFactory) Delete

func (arf AuthenticatedRequestFactory) Delete(target Target, path string, query string) (*http.Request, error)

func (AuthenticatedRequestFactory) Get

func (arf AuthenticatedRequestFactory) Get(target Target, path string, query string) (*http.Request, error)

func (AuthenticatedRequestFactory) PatchJson

func (arf AuthenticatedRequestFactory) PatchJson(target Target, path string, query string, objToJsonify interface{}) (*http.Request, error)

func (AuthenticatedRequestFactory) PostForm

func (arf AuthenticatedRequestFactory) PostForm(target Target, path string, query string, data *url.Values) (*http.Request, error)

func (AuthenticatedRequestFactory) PostJson

func (arf AuthenticatedRequestFactory) PostJson(target Target, path string, query string, objToJsonify interface{}) (*http.Request, error)

func (AuthenticatedRequestFactory) PutJson

func (arf AuthenticatedRequestFactory) PutJson(target Target, path string, query string, objToJsonify interface{}) (*http.Request, error)

type AuthenticatedRequester

type AuthenticatedRequester struct{}

func (AuthenticatedRequester) Delete

func (ug AuthenticatedRequester) Delete(client *http.Client, config Config, path string, query string) ([]byte, error)

func (AuthenticatedRequester) Get

func (ag AuthenticatedRequester) Get(client *http.Client, config Config, path string, query string) ([]byte, error)

func (AuthenticatedRequester) PatchJson

func (ag AuthenticatedRequester) PatchJson(client *http.Client, config Config, path string, query string, body interface{}, extraHeaders map[string]string) ([]byte, error)

func (AuthenticatedRequester) PostForm

func (ag AuthenticatedRequester) PostForm(client *http.Client, config Config, path string, query string, body map[string]string) ([]byte, error)

func (AuthenticatedRequester) PostJson

func (ag AuthenticatedRequester) PostJson(client *http.Client, config Config, path string, query string, body interface{}) ([]byte, error)

func (AuthenticatedRequester) PutJson

func (ag AuthenticatedRequester) PutJson(client *http.Client, config Config, path string, query string, body interface{}) ([]byte, error)

type AuthorizationCodeClient

type AuthorizationCodeClient struct {
	ClientId     string
	ClientSecret string
}

func (AuthorizationCodeClient) RequestToken

func (acc AuthorizationCodeClient) RequestToken(httpClient *http.Client, config Config, format TokenFormat, code string, redirectUri string) (TokenResponse, error)

type ClientCredentialsClient

type ClientCredentialsClient struct {
	ClientId     string
	ClientSecret string
}

func (ClientCredentialsClient) RequestToken

func (cc ClientCredentialsClient) RequestToken(httpClient *http.Client, config Config, format TokenFormat) (TokenResponse, error)

type ClientManager

type ClientManager struct {
	HttpClient *http.Client
	Config     Config
}

func (*ClientManager) ChangeSecret

func (cm *ClientManager) ChangeSecret(clientId string, newSecret string) error

func (*ClientManager) Create

func (cm *ClientManager) Create(toCreate UaaClient) (UaaClient, error)

func (*ClientManager) Delete

func (cm *ClientManager) Delete(clientId string) (UaaClient, error)

func (*ClientManager) Get

func (cm *ClientManager) Get(clientId string) (UaaClient, error)

func (*ClientManager) List

func (cm *ClientManager) List() ([]UaaClient, error)

func (*ClientManager) Update

func (cm *ClientManager) Update(toUpdate UaaClient) (UaaClient, error)

type Config

type Config struct {
	Verbose          bool
	ZoneSubdomain    string
	Targets          map[string]Target
	ActiveTargetName string
}

func NewConfig

func NewConfig() Config

func NewConfigWithServerURL

func NewConfigWithServerURL(url string) Config

func (*Config) AddContext

func (c *Config) AddContext(newContext UaaContext)

func (*Config) AddTarget

func (c *Config) AddTarget(newTarget Target)

func (Config) GetActiveContext

func (c Config) GetActiveContext() UaaContext

func (Config) GetActiveTarget

func (c Config) GetActiveTarget() Target

type CurlManager

type CurlManager struct {
	HttpClient *http.Client
	Config     Config
}

func (CurlManager) Curl

func (cm CurlManager) Curl(path, method, data string, headers []string) (resHeaders, resBody string, err error)

type GrantType

type GrantType string

type GroupManager

type GroupManager struct {
	HttpClient *http.Client
	Config     Config
}

func (GroupManager) AddMember

func (gm GroupManager) AddMember(groupID, userID string) error

func (GroupManager) Create

func (gm GroupManager) Create(toCreate ScimGroup) (ScimGroup, error)

func (GroupManager) Delete

func (gm GroupManager) Delete(groupID string) (ScimGroup, error)

func (GroupManager) Get

func (gm GroupManager) Get(groupID string) (ScimGroup, error)

func (GroupManager) GetByName

func (gm GroupManager) GetByName(name, attributes string) (ScimGroup, error)

func (GroupManager) List

func (gm GroupManager) List(filter, sortBy, attributes string, sortOrder ScimSortOrder, startIdx, count int) (PaginatedGroupList, error)

func (GroupManager) Update

func (gm GroupManager) Update(toUpdate ScimGroup) (ScimGroup, error)

type GroupMembership

type GroupMembership struct {
	Origin string `json:"origin"`
	Type   string `json:"type"`
	Value  string `json:"value"`
}

type HttpRequestFactory

type HttpRequestFactory interface {
	Get(Target, string, string) (*http.Request, error)
	Delete(Target, string, string) (*http.Request, error)
	PostForm(Target, string, string, *url.Values) (*http.Request, error)
	PostJson(Target, string, string, interface{}) (*http.Request, error)
	PutJson(Target, string, string, interface{}) (*http.Request, error)
}

type JWK

type JWK struct {
	Kty   string `json:"kty"`
	E     string `json:"e,omitempty"`
	Use   string `json:"use"`
	Kid   string `json:"kid"`
	Alg   string `json:"alg"`
	Value string `json:"value"`
	N     string `json:"n,omitempty"`
}

func TokenKey

func TokenKey(client *http.Client, config Config) (JWK, error)

func TokenKeys

func TokenKeys(client *http.Client, config Config) ([]JWK, error)

type Keys

type Keys struct {
	Keys []JWK
}

type PaginatedClientList

type PaginatedClientList struct {
	Resources    []UaaClient `json:"resources"`
	StartIndex   int         `json:"startIndex"`
	ItemsPerPage int         `json:"itemsPerPage"`
	TotalResults int         `json:"totalResults"`
	Schemas      []string    `json:"schemas"`
}

type PaginatedGroupList

type PaginatedGroupList struct {
	Resources    []ScimGroup `json:"resources"`
	StartIndex   int32       `json:"startIndex"`
	ItemsPerPage int32       `json:"itemsPerPage"`
	TotalResults int32       `json:"totalResults"`
	Schemas      []string    `json:"schemas"`
}

type PaginatedUserList

type PaginatedUserList struct {
	Resources    []ScimUser `json:"resources"`
	StartIndex   int32      `json:"startIndex"`
	ItemsPerPage int32      `json:"itemsPerPage"`
	TotalResults int32      `json:"totalResults"`
	Schemas      []string   `json:"schemas"`
}

type PhoneNumber

type PhoneNumber struct {
	Value string `json:"value"`
}

type RefreshTokenClient

type RefreshTokenClient struct {
	ClientId     string
	ClientSecret string
}

func (RefreshTokenClient) RequestToken

func (rc RefreshTokenClient) RequestToken(httpClient *http.Client, config Config, format TokenFormat, refreshToken string) (TokenResponse, error)

type Requester

type Requester interface {
	Get(client *http.Client, config Config, path string, query string) ([]byte, error)
	Delete(client *http.Client, config Config, path string, query string) ([]byte, error)
	PostForm(client *http.Client, config Config, path string, query string, body map[string]string) ([]byte, error)
	PostJson(client *http.Client, config Config, path string, query string, body interface{}) ([]byte, error)
	PutJson(client *http.Client, config Config, path string, query string, body interface{}) ([]byte, error)
}

type ResourceOwnerPasswordClient

type ResourceOwnerPasswordClient struct {
	ClientId     string
	ClientSecret string
	Username     string
	Password     string
}

func (ResourceOwnerPasswordClient) RequestToken

func (rop ResourceOwnerPasswordClient) RequestToken(httpClient *http.Client, config Config, format TokenFormat) (TokenResponse, error)

type ScimGroup

type ScimGroup struct {
	ID          string            `json:"id,omitempty"`
	Meta        *ScimMetaInfo     `json:"meta,omitempty"`
	DisplayName string            `json:"displayName,omitempty"`
	ZoneID      string            `json:"zoneId,omitempty"`
	Description string            `json:"description,omitempty"`
	Members     []ScimGroupMember `json:"members,omitempty"`
	Schemas     []string          `json:"schemas,omitempty"`
}

type ScimGroupMember

type ScimGroupMember struct {
	Origin string `json:"origin,omitempty"`
	Type   string `json:"type,omitempty"`
	Value  string `json:"value,omitempty"`
}

type ScimMetaInfo

type ScimMetaInfo struct {
	Version      int    `json:"version,omitempty"`
	Created      string `json:"created,omitempty"`
	LastModified string `json:"lastModified,omitempty"`
}

type ScimSortOrder

type ScimSortOrder string

type ScimUser

type ScimUser struct {
	ID                   string          `json:"id,omitempty"`
	Password             string          `json:"password,omitempty"`
	ExternalId           string          `json:"externalId,omitempty"`
	Meta                 *ScimMetaInfo   `json:"meta,omitempty"`
	Username             string          `json:"userName,omitempty"`
	Name                 *ScimUserName   `json:"name,omitempty"`
	Emails               []ScimUserEmail `json:"emails,omitempty"`
	Groups               []ScimUserGroup `json:"groups,omitempty"`
	Approvals            []Approval      `json:"approvals,omitempty"`
	PhoneNumbers         []PhoneNumber   `json:"phoneNumbers,omitempty"`
	Active               *bool           `json:"active,omitempty"`
	Verified             *bool           `json:"verified,omitempty"`
	Origin               string          `json:"origin,omitempty"`
	ZoneId               string          `json:"zoneId,omitempty"`
	PasswordLastModified string          `json:"passwordLastModified,omitempty"`
	PreviousLogonTime    int             `json:"previousLogonTime,omitempty"`
	LastLogonTime        int             `json:"lastLogonTime,omitempty"`
	Schemas              []string        `json:"schemas,omitempty"`
}

type ScimUserEmail

type ScimUserEmail struct {
	Value   string `json:"value,omitempty"`
	Primary *bool  `json:"primary,omitempty"`
}

type ScimUserGroup

type ScimUserGroup struct {
	Value   string `json:"value,omitempty"`
	Display string `json:"display,omitempty"`
	Type    string `json:"type,omitempty"`
}

type ScimUserName

type ScimUserName struct {
	FamilyName string `json:"familyName,omitempty"`
	GivenName  string `json:"givenName,omitempty"`
}

type Target

type Target struct {
	BaseUrl           string
	SkipSSLValidation bool
	Contexts          map[string]UaaContext
	ActiveContextName string
}

func NewTarget

func NewTarget() Target

func (Target) GetActiveContext

func (t Target) GetActiveContext() UaaContext

type TokenFormat

type TokenFormat string

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	IdToken      string `json:"id_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int32  `json:"expires_in"`
	Scope        string `json:"scope"`
	JTI          string `json:"jti"`
}

type UaaClient

type UaaClient struct {
	ClientId             string   `json:"client_id,omitempty"`
	ClientSecret         string   `json:"client_secret,omitempty"`
	Scope                []string `json:"scope,omitempty"`
	ResourceIds          []string `json:"resource_ids,omitempty"`
	AuthorizedGrantTypes []string `json:"authorized_grant_types,omitempty"`
	RedirectUri          []string `json:"redirect_uri,omitempty"`
	Authorities          []string `json:"authorities,omitempty"`
	TokenSalt            string   `json:"token_salt,omitempty"`
	AllowedProviders     []string `json:"allowedproviders,omitempty"`
	DisplayName          string   `json:"name,omitempty"`
	LastModified         int64    `json:"lastModified,omitempty"`
	RequiredUserGroups   []string `json:"required_user_groups,omitempty"`
	AccessTokenValidity  int64    `json:"access_token_validity,omitempty"`
	RefreshTokenValidity int64    `json:"refresh_token_validity,omitempty"`
}

func (*UaaClient) PreCreateValidation

func (c *UaaClient) PreCreateValidation() error

type UaaContext

type UaaContext struct {
	ClientId  string    `json:"client_id"`
	GrantType GrantType `json:"grant_type"`
	Username  string    `json:"username"`
	TokenResponse
}

func NewContextWithToken

func NewContextWithToken(accessToken string) UaaContext

type UaaHealthStatus

type UaaHealthStatus string

func Health

func Health(target Target) (UaaHealthStatus, error)

type UaaInfo

type UaaInfo struct {
	App            uaaApp              `json:"app"`
	Links          uaaLinks            `json:"links"`
	Prompts        map[string][]string `json:"prompts"`
	ZoneName       string              `json:"zone_name"`
	EntityId       string              `json:"entityID"`
	CommitId       string              `json:"commit_id"`
	Timestamp      string              `json:"timestamp"`
	IdpDefinitions map[string]string   `json:"idpDefinitions"`
}

func Info

func Info(client *http.Client, config Config) (UaaInfo, error)

type UnauthenticatedRequestFactory

type UnauthenticatedRequestFactory struct{}

func (UnauthenticatedRequestFactory) Delete

func (urf UnauthenticatedRequestFactory) Delete(target Target, path string, query string) (*http.Request, error)

func (UnauthenticatedRequestFactory) Get

func (urf UnauthenticatedRequestFactory) Get(target Target, path string, query string) (*http.Request, error)

func (UnauthenticatedRequestFactory) PatchJson

func (urf UnauthenticatedRequestFactory) PatchJson(target Target, path string, query string, objToJsonify interface{}) (*http.Request, error)

func (UnauthenticatedRequestFactory) PostForm

func (urf UnauthenticatedRequestFactory) PostForm(target Target, path string, query string, data *url.Values) (*http.Request, error)

func (UnauthenticatedRequestFactory) PostJson

func (urf UnauthenticatedRequestFactory) PostJson(target Target, path string, query string, objToJsonify interface{}) (*http.Request, error)

func (UnauthenticatedRequestFactory) PutJson

func (urf UnauthenticatedRequestFactory) PutJson(target Target, path string, query string, objToJsonify interface{}) (*http.Request, error)

type UnauthenticatedRequester

type UnauthenticatedRequester struct{}

func (UnauthenticatedRequester) Delete

func (ug UnauthenticatedRequester) Delete(client *http.Client, config Config, path string, query string) ([]byte, error)

func (UnauthenticatedRequester) Get

func (ug UnauthenticatedRequester) Get(client *http.Client, config Config, path string, query string) ([]byte, error)

func (UnauthenticatedRequester) PatchJson

func (ug UnauthenticatedRequester) PatchJson(client *http.Client, config Config, path string, query string, body interface{}) ([]byte, error)

func (UnauthenticatedRequester) PostForm

func (ug UnauthenticatedRequester) PostForm(client *http.Client, config Config, path string, query string, body map[string]string) ([]byte, error)

func (UnauthenticatedRequester) PostJson

func (ug UnauthenticatedRequester) PostJson(client *http.Client, config Config, path string, query string, body interface{}) ([]byte, error)

func (UnauthenticatedRequester) PutJson

func (ug UnauthenticatedRequester) PutJson(client *http.Client, config Config, path string, query string, body interface{}) ([]byte, error)

type UserManager

type UserManager struct {
	HttpClient *http.Client
	Config     Config
}

func (UserManager) Activate

func (um UserManager) Activate(userID string, userMetaVersion int) error

func (UserManager) Create

func (um UserManager) Create(toCreate ScimUser) (ScimUser, error)

func (UserManager) Deactivate

func (um UserManager) Deactivate(userID string, userMetaVersion int) error

func (UserManager) Delete

func (um UserManager) Delete(userId string) (ScimUser, error)

func (UserManager) Get

func (um UserManager) Get(userId string) (ScimUser, error)

func (UserManager) GetByUsername

func (um UserManager) GetByUsername(username, origin, attributes string) (ScimUser, error)

func (UserManager) List

func (um UserManager) List(filter, sortBy, attributes string, sortOrder ScimSortOrder, startIdx, count int) (PaginatedUserList, error)

func (UserManager) Update

func (um UserManager) Update(toUpdate ScimUser) (ScimUser, error)

type Userinfo

type Userinfo struct {
	UserId            string   `json:"user_id"`
	Sub               string   `json:"sub"`
	Username          string   `json:"user_name"`
	GivenName         string   `json:"given_name"`
	FamilyName        string   `json:"family_name"`
	Email             string   `json:"email"`
	PhoneNumber       []string `json:"phone_number"`
	PreviousLoginTime int64    `json:"previous_logon_time"`
	Name              string   `json:"name"`
}

func Me

func Me(client *http.Client, config Config) (Userinfo, error)

Jump to

Keyboard shortcuts

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