api

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthManager

type AuthManager struct {
	// contains filtered or unexported fields
}

AuthManager -

func NewAuthManager

func NewAuthManager(gateway net.Gateway, config coreconfig.ReadWriter, dumper net.RequestDumper) *AuthManager

NewAuthManager -

func (*AuthManager) Authenticate

func (tm *AuthManager) Authenticate(credentials map[string]string) error

Authenticate -

func (*AuthManager) Authorize

func (tm *AuthManager) Authorize(token string) (string, error)

Authorize -

func (*AuthManager) DumpRequest

func (tm *AuthManager) DumpRequest(req *http.Request)

DumpRequest -

func (*AuthManager) DumpResponse

func (tm *AuthManager) DumpResponse(res *http.Response)

DumpResponse -

func (*AuthManager) GetClientToken

func (tm *AuthManager) GetClientToken(clientID, clientSecret, subDomain string) (clientToken string, err error)

GetClientToken -

func (*AuthManager) RefreshToken

func (tm *AuthManager) RefreshToken() (string, error)

RefreshAuthToken -

type ClientManager

type ClientManager struct {
	// contains filtered or unexported fields
}

func (*ClientManager) ChangeSecret

func (manager *ClientManager) ChangeSecret(id, oldSecret, newSecret, zoneId string) (err error)

func (*ClientManager) Create

func (manager *ClientManager) Create(newClient UAAClient, zoneId string) (client UAAClient, err error)

func (*ClientManager) DeleteClient

func (manager *ClientManager) DeleteClient(id, zoneId string) (err error)

func (*ClientManager) FindByClientID

func (manager *ClientManager) FindByClientID(clientID, zoneId string) (client UAAClient, err error)

func (*ClientManager) GetClient

func (manager *ClientManager) GetClient(id, zoneId string) (client *UAAClient, err error)

func (*ClientManager) UpdateClient

func (manager *ClientManager) UpdateClient(updatedClient *UAAClient, zoneId string) (client UAAClient, err error)

type Config

type Config struct {
	LoginEndpoint     string
	AuthEndpoint      string
	ClientID          string
	ClientSecret      string
	CaCert            string
	SkipSslValidation bool
}

func (*Config) Client

func (config *Config) Client() (*Session, error)

type GroupManager

type GroupManager struct {
	// contains filtered or unexported fields
}

func (*GroupManager) CreateGroup

func (manager *GroupManager) CreateGroup(displayName string, description string, zoneId string) (group *UAAGroup, err error)

func (*GroupManager) DeleteGroup

func (manager *GroupManager) DeleteGroup(id, zoneId string) error

func (*GroupManager) FindByDisplayName

func (manager *GroupManager) FindByDisplayName(displayName, zoneId string) (group *UAAGroup, err error)

func (*GroupManager) GetGroup

func (manager *GroupManager) GetGroup(id, zoneId string) (group *UAAGroup, err error)

func (*GroupManager) UpdateGroup

func (manager *GroupManager) UpdateGroup(id, displayName, description, zoneId string) (group *UAAGroup, err error)

type IdentityZone

type IdentityZone struct {
	Id        string              `json:"id"`
	IsActive  bool                `json:"active"`
	Name      string              `json:"name,omitempty"`
	SubDomain string              `json:"subdomain,omitempty"`
	Config    *IdentityZoneConfig `json:"config,omitempty"`
}

type IdentityZoneBrandingBanner added in v1.0.2

type IdentityZoneBrandingBanner struct {
	BackgroundColor string `json:"backgroundColor,omitempty"`
	Text            string `json:"text,omitempty"`
	TextColor       string `json:"textColor,omitempty"`
	Url             string `json:"link,omitempty"`
}

type IdentityZoneBrandingConfig added in v1.0.1

type IdentityZoneBrandingConfig struct {
	Banner      *IdentityZoneBrandingBanner `json:"banner,omitempty"`
	CompanyName string                      `json:"companyName,omitempty"`
	Favicon     string                      `json:"squareLogo,omitempty"`
	FooterText  string                      `json:"footerLegalText,omitempty"`
	FooterLinks map[string]string           `json:"footerLinks,omitempty"`
}

type IdentityZoneClientSecretPolicy

type IdentityZoneClientSecretPolicy struct {
	MaxLength             *int64 `json:"maxLength,omitempty"`
	MinLength             *int64 `json:"minLength,omitempty"`
	MinUpperCaseCharacter *int64 `json:"requireUpperCaseCharacter,omitempty"`
	MinLowerCaseCharacter *int64 `json:"requireLowerCaseCharacter,omitempty"`
	MinDigit              *int64 `json:"requireDigit,omitempty"`
	MinSpecialCharacter   *int64 `json:"requireSpecialCharacter,omitempty"`
}

type IdentityZoneConfig

type IdentityZoneConfig struct {
	AccountChooserEnabled bool                            `json:"accountChooserEnabled"`
	Branding              *IdentityZoneBrandingConfig     `json:"branding,omitempty"`
	ClientSecretPolicy    *IdentityZoneClientSecretPolicy `json:"clientSecretPolicy,omitempty"`
	CorsPolicy            *IdentityZoneCorsPolicy         `json:"corsPolicy,omitempty"`
	IdpDiscoveryEnabled   bool                            `json:"idpDiscoveryEnabled"`
	InputPrompts          []*InputPrompt                  `json:"prompts,omitempty"`
	IssuerUrl             string                          `json:"issuer,omitempty"`
	Links                 *IdentityZoneLinks              `json:"links,omitempty"`
	MfaConfig             *MfaConfig                      `json:"MfaConfig,omitempty"`
	TokenPolicy           *IdentityZoneTokenPolicy        `json:"tokenPolicy,omitempty"`
	Saml                  *IdentityZoneSamlConfig         `json:"samlConfig,omitempty"`
	UserConfig            *UserConfig                     `json:"userConfig,omitempty"`
}

type IdentityZoneCorsConfig

type IdentityZoneCorsConfig struct {
	AllowedOrigins        []string `json:"allowedOrigins,omitempty"`
	AllowedOriginPatterns []string `json:"allowedOriginPatterns,omitempty"`
	AllowedUris           []string `json:"allowedUris,omitempty"`
	AllowedUriPatterns    []string `json:"allowedUriPatterns,omitempty"`
	AllowedHeaders        []string `json:"allowedHeaders,omitempty"`
	AllowedMethods        []string `json:"allowedMethods,omitempty"`
	AllowedCredentials    bool     `json:"allowedCredentials"`
	MaxAge                *int64   `json:"maxAge,omitempty"`
}

type IdentityZoneCorsPolicy

type IdentityZoneCorsPolicy struct {
	DefaultConfiguration *IdentityZoneCorsConfig `json:"defaultConfiguration,omitempty"`
	XhrConfiguration     *IdentityZoneCorsConfig `json:"xhrConfiguration,omitempty"`
}
type IdentityZoneLinks struct {
	HomeRedirect string                   `json:"homeRedirect,omitempty"`
	Logout       *IdentityZoneLogoutLinks `json:"logout,omitempty"`
	SelfService  *SelfServiceLinks        `json:"selfService,omitempty"`
}
type IdentityZoneLogoutLinks struct {
	RedirectUrl           string   `json:"redirectUrl,omitempty"`
	RedirectParameterName string   `json:"redirectParameterName,omitempty"`
	AllowedRedirectUrls   []string `json:"whitelist"`
}

type IdentityZoneManager

type IdentityZoneManager struct {
	// contains filtered or unexported fields
}

func (*IdentityZoneManager) Create

func (manager *IdentityZoneManager) Create(identityZone *IdentityZone) (*IdentityZone, error)

func (*IdentityZoneManager) Delete

func (manager *IdentityZoneManager) Delete(id string) error

func (*IdentityZoneManager) FindById

func (manager *IdentityZoneManager) FindById(id string) (*IdentityZone, error)

func (*IdentityZoneManager) FindByName

func (manager *IdentityZoneManager) FindByName(name string) (*IdentityZone, error)

func (*IdentityZoneManager) Update

func (manager *IdentityZoneManager) Update(id string, identityZone *IdentityZone) (*IdentityZone, error)

type IdentityZoneSamlConfig

type IdentityZoneSamlConfig struct {
	ActiveKeyId              string                          `json:"activeKeyId,omitempty"`
	AssertionTtlSeconds      *int64                          `json:"assertionTimeToLiveSeconds,omitempty"`
	Certificate              string                          `json:"certificate,omitempty"`
	DisableInResponseToCheck bool                            `json:"disableInResponseToCheck"`
	EntityId                 string                          `json:"entityID,omitempty"`
	IsAssertionSigned        bool                            `json:"assertionSigned"`
	IsRequestSigned          bool                            `json:"requestSigned"`
	Keys                     map[string]*IdentityZoneSamlKey `json:"keys,omitempty"`
	WantAssertionSigned      bool                            `json:"wantAssertionSigned"`
	WantAuthnRequestSigned   bool                            `json:"wantAuthnRequestSigned"`
}

type IdentityZoneSamlKey

type IdentityZoneSamlKey struct {
	Certificate string `json:"certificate,omitempty"`
}

type IdentityZoneTokenPolicy

type IdentityZoneTokenPolicy struct {
	AccessTokenTtl       *int64 `json:"accessTokenValidity,omitempty"`
	RefreshTokenTtl      *int64 `json:"refreshTokenValidity,omitempty"`
	IsJwtRevocable       bool   `json:"jwtRevocable"`
	IsRefreshTokenUnique bool   `json:"refreshTokenUnique"`
	RefreshTokenFormat   string `json:"refreshTokenFormat,omitempty"`
	ActiveKeyId          string `json:"activeKeyId,omitempty"`
}

type InputPrompt

type InputPrompt struct {
	Name  string `json:"name,omitempty"`
	Type  string `json:"type,omitempty"`
	Value string `json:"text,omitempty"`
}

type Logger

type Logger struct {
	UI terminal.UI

	TracePrinter trace.Printer
	// contains filtered or unexported fields
}

Logger -

func NewLogger

func NewLogger(debug bool, tracePath string) *Logger

NewLogger -

func (*Logger) DebugMessage

func (l *Logger) DebugMessage(format string, v ...interface{})

DebugMessage -

func (*Logger) LogMessage

func (l *Logger) LogMessage(format string, v ...interface{})

LogMessage -

type MfaConfig

type MfaConfig struct {
	IsEnabled         bool     `json:"enabled"`
	IdentityProviders []string `json:"identityProviders,omitempty"`
}
type SelfServiceLinks struct {
	Enabled          bool   `json:"selfServiceLinksEnabled"`
	SignupUrl        string `json:"signup,omitempty"`
	PasswordResetUrl string `json:"passwd,omitempty"`
}

type Session

type Session struct {
	Log *Logger
	// contains filtered or unexported fields
}

func NewSession

func NewSession(config *Config) (s *Session, err error)

func (*Session) AuthManager

func (s *Session) AuthManager() *AuthManager

func (*Session) ClientManager

func (s *Session) ClientManager() *ClientManager

func (*Session) GroupManager

func (s *Session) GroupManager() *GroupManager

func (*Session) IdentityZoneManager

func (s *Session) IdentityZoneManager() *IdentityZoneManager

func (*Session) UserManager

func (s *Session) UserManager() *UserManager

type UAAClient

type UAAClient struct {
	ClientID             string   `json:"client_id,omitempty"`
	ClientSecret         string   `json:"client_secret,omitempty"`
	AuthorizedGrantTypes []string `json:"authorized_grant_types,omitempty"`
	RedirectURI          []string `json:"redirect_uri,omitempty"`
	Scope                []string `json:"scope,omitempty"`
	ResourceIds          []string `json:"resource_ids,omitempty"`
	Authorities          []string `json:"authorities,omitempty"`
	AutoApprove          []string `json:"autoapprove,omitempty"`
	AccessTokenValidity  int      `json:"access_token_validity,omitempty"`
	RefreshTokenValidity int      `json:"refresh_token_validity,omitempty"`
	AllowedProviders     []string `json:"allowedproviders,omitempty"`
	Name                 string   `json:"name,omitempty"`
	TokenSalt            string   `json:"token_salt,omitempty"`
	CreatedWith          string   `json:"createdwith,omitempty"`
	ApprovalsDeleted     bool     `json:"approvals_deleted,omitempty"`
	RequiredUserGroups   []string `json:"required_user_groups,omitempty"`
	LastModified         int64    `json:"lastModified,omitempty"`
}

func (*UAAClient) HasDefaultAuthorites

func (c *UAAClient) HasDefaultAuthorites() bool

func (*UAAClient) HasDefaultResourceIds

func (c *UAAClient) HasDefaultResourceIds() bool

func (*UAAClient) HasDefaultScope

func (c *UAAClient) HasDefaultScope() bool

type UAAClientResourceList

type UAAClientResourceList struct {
	Resources []UAAClient `json:"resources"`
}

UAAClientResourceList -

type UAAGroup

type UAAGroup struct {
	Id          string `json:"id,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
	Description string `json:"description,omitempty"`
	ZoneId      string `json:"zoneId,omitempty"`
}

type UAAGroupResourceList

type UAAGroupResourceList struct {
	Resources []UAAGroup `json:"resources"`
}

type UAAUser

type UAAUser struct {
	Id       string         `json:"id,omitempty"`
	Username string         `json:"userName,omitempty"`
	Password string         `json:"password,omitempty"`
	Origin   string         `json:"origin,omitempty"`
	Name     UAAUserName    `json:"name,omitempty"`
	Emails   []UAAUserEmail `json:"emails,omitempty"`
	Groups   []UAAUserGroup `json:"groups,omitempty"`
	ZoneId   string         `json:"zoneId,omitempty"`
}

type UAAUserEmail

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

type UAAUserGroup

type UAAUserGroup struct {
	Value   string `json:"value"`
	Display string `json:"display"`
	Type    string `json:"type"`
}

type UAAUserName

type UAAUserName struct {
	GivenName  string `json:"givenName"`
	FamilyName string `json:"familyName"`
}

type UAAUserResourceList

type UAAUserResourceList struct {
	Resources []UAAUser `json:"resources"`
}

type UaaApi

type UaaApi struct {
	// contains filtered or unexported fields
}

func (*UaaApi) Delete

func (api *UaaApi) Delete(path string) error

func (*UaaApi) Get

func (api *UaaApi) Get(path string, responseBody any) error

func (*UaaApi) Patch

func (api *UaaApi) Patch(path string, body any, responseBody any) error

func (*UaaApi) Post

func (api *UaaApi) Post(path string, body any, responseBody any) error

func (*UaaApi) Put

func (api *UaaApi) Put(path string, body any, responseBody any) error

func (*UaaApi) WithHeaders

func (api *UaaApi) WithHeaders(headers map[string]string) *UaaApi

func (*UaaApi) WithZoneId

func (api *UaaApi) WithZoneId(zoneId string) *UaaApi

type UserConfig

type UserConfig struct {
	DefaultGroups []string `json:"defaultGroups,omitempty"`
}

type UserManager

type UserManager struct {
	// contains filtered or unexported fields
}

func (*UserManager) ChangePassword

func (um *UserManager) ChangePassword(id, oldPassword, newPassword, zoneId string) (err error)

func (*UserManager) CreateUser

func (um *UserManager) CreateUser(username, password, origin, givenName, familyName, email, zoneId string) (user *UAAUser, err error)

func (*UserManager) DeleteUser

func (um *UserManager) DeleteUser(id, zoneId string) error

func (*UserManager) FindByUsername

func (um *UserManager) FindByUsername(username, zoneId string) (user UAAUser, err error)

func (*UserManager) GetUser

func (um *UserManager) GetUser(id, zoneId string) (user *UAAUser, err error)

func (*UserManager) IsDefaultGroup

func (um *UserManager) IsDefaultGroup(zoneId, group string) (ok bool, err error)

func (*UserManager) UpdateRoles

func (um *UserManager) UpdateRoles(id string, scopesToDelete, scopesToAdd []string, origin, zoneId string) (err error)

func (*UserManager) UpdateUser

func (um *UserManager) UpdateUser(id, username, givenName, familyName, email, zoneId string) (user *UAAUser, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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