Documentation
¶
Index ¶
- Constants
- Variables
- func Authenticate(req *http.Request, payload []byte, date time.Time, apiKeyID string, ...)
- func CreateApplication(app *Application) error
- func CreateDirectory(dir *Directory) error
- func GetToken(href string) string
- func Init(clientConfiguration ClientConfiguration, cache Cache)
- func InitLog()
- func JWT(claims jwt.Claims, extraHeaders map[string]interface{}) string
- func NewPageRequest(limit int, offset int) url.Values
- func ParseJWT(token string, claims jwt.Claims) *jwt.Token
- type APIKey
- type APIKeyCriteria
- type APIKeys
- type AccessTokenClaims
- type Account
- func (account *Account) AddToGroup(group *Group) (*GroupMembership, error)
- func (account *Account) CreateAPIKey() (*APIKey, error)
- func (r *Account) DeleteCustomData() error
- func (account *Account) GetAccessTokens(criteria OAuthTokenCriteria) (*OAuthTokens, error)
- func (r *Account) GetCustomData() (CustomData, error)
- func (account *Account) GetGroupMemberships(criteria GroupMembershipCriteria) (*GroupMemberships, error)
- func (account *Account) GetRefreshTokens(criteria OAuthTokenCriteria) (*OAuthTokens, error)
- func (account *Account) Refresh() error
- func (account *Account) RemoveFromGroup(group *Group) error
- func (account *Account) Update() error
- func (r *Account) UpdateCustomData(customData CustomData) (CustomData, error)
- type AccountCreationPolicy
- func (r *AccountCreationPolicy) Delete() error
- func (policy *AccountCreationPolicy) GetVerificationEmailTemplates() (*EmailTemplates, error)
- func (policy *AccountCreationPolicy) GetVerificationSuccessEmailTemplates() (*EmailTemplates, error)
- func (policy *AccountCreationPolicy) GetWelcomeEmailTemplates() (*EmailTemplates, error)
- func (r AccountCreationPolicy) IsCacheable() bool
- func (policy *AccountCreationPolicy) Refresh() error
- func (policy *AccountCreationPolicy) Update() error
- type AccountCriteria
- func (c AccountCriteria) CustomDataEq(k string, v string) AccountCriteria
- func (c AccountCriteria) EmailEq(email string) AccountCriteria
- func (c AccountCriteria) GivenNameEq(givenName string) AccountCriteria
- func (c AccountCriteria) Limit(limit int) AccountCriteria
- func (c AccountCriteria) MiddleNameEq(middleName string) AccountCriteria
- func (c AccountCriteria) Offset(offset int) AccountCriteria
- func (c AccountCriteria) StatusEq(status string) AccountCriteria
- func (c AccountCriteria) SurnameEq(surname string) AccountCriteria
- func (c AccountCriteria) UsernameEq(username string) AccountCriteria
- func (c AccountCriteria) WithAPIKeys() AccountCriteria
- func (c AccountCriteria) WithApplications() AccountCriteria
- func (c AccountCriteria) WithCustomData() AccountCriteria
- func (c AccountCriteria) WithDirectory() AccountCriteria
- func (c AccountCriteria) WithGroupMemberships(pageRequest PageRequest) AccountCriteria
- func (c AccountCriteria) WithGroups(pageRequest PageRequest) AccountCriteria
- func (c AccountCriteria) WithProviderData() AccountCriteria
- func (c AccountCriteria) WithTenant() AccountCriteria
- type AccountPasswordResetToken
- type Accounts
- type Application
- func (app *Application) AuthenticateAccount(username string, password string, accountStoreHref string) (*Account, error)
- func (app *Application) CreateGroup(group *Group) error
- func (app *Application) CreateIDSiteURL(options IDSiteOptions) (string, error)
- func (app *Application) GetAPIKey(apiKeyID string, criteria APIKeyCriteria) (*APIKey, error)
- func (app *Application) GetAccountStoreMappings(criteria ApplicationAccountStoreMappingCriteria) (*ApplicationAccountStoreMappings, error)
- func (r *Application) GetAccounts(criteria AccountCriteria) (*Accounts, error)
- func (app *Application) GetDefaultAccountStoreMapping(criteria ApplicationAccountStoreMappingCriteria) (*ApplicationAccountStoreMapping, error)
- func (app *Application) GetGroups(criteria GroupCriteria) (*Groups, error)
- func (app *Application) GetOAuthPolicy() (*OAuthPolicy, error)
- func (app *Application) GetOAuthToken(username string, password string) (*OAuthResponse, error)
- func (app *Application) GetOAuthTokenClientCredentialsGrantType(apiKeyID, apiKeySecret string) (*OAuthResponse, error)
- func (app *Application) GetOAuthTokenSocialGrantType(providerID, accessToken, code string) (*OAuthResponse, error)
- func (app *Application) GetOAuthTokenStormpathGrantType(token string) (*OAuthResponse, error)
- func (app *Application) HandleCallback(URL string) (*CallbackResult, error)
- func (app *Application) Purge() error
- func (app *Application) Refresh() error
- func (app *Application) RefreshOAuthToken(refreshToken string) (*OAuthResponse, error)
- func (app *Application) RegisterAccount(account *Account) error
- func (app *Application) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
- func (app *Application) ResendVerificationEmail(email string) error
- func (app *Application) ResetPassword(token string, newPassword string) (*Account, error)
- func (app *Application) SendPasswordResetEmail(email string) (*AccountPasswordResetToken, error)
- func (app *Application) Update() error
- func (app *Application) ValidatePasswordResetToken(token string) (*AccountPasswordResetToken, error)
- func (app *Application) ValidateToken(token string) (*OAuthToken, error)
- type ApplicationAccountStoreMapping
- func (r *ApplicationAccountStoreMapping) Delete() error
- func (mapping *ApplicationAccountStoreMapping) IsAccountStoreDirectory() bool
- func (mapping *ApplicationAccountStoreMapping) IsAccountStoreGroup() bool
- func (mapping *ApplicationAccountStoreMapping) IsAccountStoreOrganization() bool
- func (r ApplicationAccountStoreMapping) IsCacheable() bool
- func (mapping *ApplicationAccountStoreMapping) Save() error
- type ApplicationAccountStoreMappingCriteria
- func (c ApplicationAccountStoreMappingCriteria) Limit(limit int) ApplicationAccountStoreMappingCriteria
- func (c ApplicationAccountStoreMappingCriteria) Offset(offset int) ApplicationAccountStoreMappingCriteria
- func (c ApplicationAccountStoreMappingCriteria) WithApplication() ApplicationAccountStoreMappingCriteria
- type ApplicationAccountStoreMappings
- type ApplicationCriteria
- func (c ApplicationCriteria) DescriptionEq(description string) ApplicationCriteria
- func (c ApplicationCriteria) Limit(limit int) ApplicationCriteria
- func (c ApplicationCriteria) NameEq(name string) ApplicationCriteria
- func (c ApplicationCriteria) Offset(offset int) ApplicationCriteria
- func (c ApplicationCriteria) StatusEq(status string) ApplicationCriteria
- func (c ApplicationCriteria) WithAccessTokens(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithAccountStoreMappings(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithAccounts(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithCustomData() ApplicationCriteria
- func (c ApplicationCriteria) WithDefaultAccountStoreMapping() ApplicationCriteria
- func (c ApplicationCriteria) WithDefaultGroupStoreMapping() ApplicationCriteria
- func (c ApplicationCriteria) WithGroups(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithRefreshTokens(pageRequest PageRequest) ApplicationCriteria
- func (c ApplicationCriteria) WithTenant() ApplicationCriteria
- type Applications
- type AuthResult
- type AuthenticationResult
- type Authenticator
- type BasicAuthenticator
- type Cache
- type Cacheable
- type CallbackResult
- type Claims
- type Client
- type ClientConfiguration
- type CustomData
- type Directories
- type Directory
- func GetDirectory(href string, criteria DirectoryCriteria) (*Directory, error)
- func NewDirectory(name string) *Directory
- func NewFacebookDirectory(name string, clientID string, clientSecret string) *Directory
- func NewGithubDirectory(name string, clientID string, clientSecret string) *Directory
- func NewGoogleDirectory(name string, clientID string, clientSecret string, redirectURI string) *Directory
- func NewLinkedInDirectory(name string, clientID string, clientSecret string, redirectURI string) *Directory
- func (dir *Directory) CreateGroup(group *Group) error
- func (dir *Directory) GetAccountCreationPolicy() (*AccountCreationPolicy, error)
- func (r *Directory) GetAccounts(criteria AccountCriteria) (*Accounts, error)
- func (dir *Directory) GetGroups(criteria GroupCriteria) (*Groups, error)
- func (dir *Directory) Refresh() error
- func (dir *Directory) RegisterAccount(account *Account) error
- func (dir *Directory) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
- func (dir *Directory) Update() error
- type DirectoryCriteria
- func (c DirectoryCriteria) DescriptionEq(description string) DirectoryCriteria
- func (c DirectoryCriteria) Limit(limit int) DirectoryCriteria
- func (c DirectoryCriteria) NameEq(name string) DirectoryCriteria
- func (c DirectoryCriteria) Offset(offset int) DirectoryCriteria
- func (c DirectoryCriteria) StatusEq(status string) DirectoryCriteria
- func (c DirectoryCriteria) WithAccountCreationPolicy() DirectoryCriteria
- func (c DirectoryCriteria) WithAccounts(pageRequest PageRequest) DirectoryCriteria
- func (c DirectoryCriteria) WithCustomData() DirectoryCriteria
- func (c DirectoryCriteria) WithGroups(pageRequest PageRequest) DirectoryCriteria
- func (c DirectoryCriteria) WithPasswordPolicy() DirectoryCriteria
- func (c DirectoryCriteria) WithProvider() DirectoryCriteria
- func (c DirectoryCriteria) WithTenant() DirectoryCriteria
- type EmailTemplate
- type EmailTemplates
- type Error
- type ExpandedJWT
- type GrantTypeClientCredentialsTokenClaims
- type GrantTypeStormpathTokenClaims
- type Group
- type GroupCriteria
- func (c GroupCriteria) DescriptionEq(description string) GroupCriteria
- func (c GroupCriteria) Limit(limit int) GroupCriteria
- func (c GroupCriteria) NameEq(name string) GroupCriteria
- func (c GroupCriteria) Offset(offset int) GroupCriteria
- func (c GroupCriteria) StatusEq(status string) GroupCriteria
- func (c GroupCriteria) WithAccounts(pageRequest PageRequest) GroupCriteria
- func (c GroupCriteria) WithCustomData() GroupCriteria
- func (c GroupCriteria) WithDirectory() GroupCriteria
- func (c GroupCriteria) WithTenant() GroupCriteria
- type GroupMembership
- type GroupMembershipCriteria
- type GroupMemberships
- type Groups
- type Header
- type IDSiteAssertionTokenClaims
- type IDSiteOptions
- type LocalCache
- type OAuthAccessTokenResult
- type OAuthBearerAuthenticator
- type OAuthClientCredentialsAuthenticationResult
- type OAuthClientCredentialsAuthenticator
- type OAuthPasswordAuthenticator
- type OAuthPolicy
- type OAuthProvider
- type OAuthRefreshTokenAuthenticator
- type OAuthRequestAuthenticator
- type OAuthResponse
- type OAuthStormpathTokenAuthenticator
- type OAuthToken
- type OAuthTokenCriteria
- type OAuthTokens
- type Organization
- func (org *Organization) GetAccountStoreMappings(criteria OrganizationAccountStoreMappingCriteria) (*OrganizationAccountStoreMappings, error)
- func (r *Organization) GetAccounts(criteria AccountCriteria) (*Accounts, error)
- func (org *Organization) GetDefaultAccountStoreMapping(criteria OrganizationAccountStoreMappingCriteria) (*OrganizationAccountStoreMapping, error)
- func (org *Organization) Refresh() error
- func (org *Organization) RegisterAccount(account *Account) error
- func (org *Organization) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
- func (org *Organization) Update() error
- type OrganizationAccountStoreMapping
- func (r *OrganizationAccountStoreMapping) Delete() error
- func (mapping *OrganizationAccountStoreMapping) IsAccountStoreDirectory() bool
- func (mapping *OrganizationAccountStoreMapping) IsAccountStoreGroup() bool
- func (mapping *OrganizationAccountStoreMapping) IsAccountStoreOrganization() bool
- func (r OrganizationAccountStoreMapping) IsCacheable() bool
- func (mapping *OrganizationAccountStoreMapping) Save() error
- type OrganizationAccountStoreMappingCriteria
- func (c OrganizationAccountStoreMappingCriteria) Limit(limit int) OrganizationAccountStoreMappingCriteria
- func (c OrganizationAccountStoreMappingCriteria) Offset(offset int) OrganizationAccountStoreMappingCriteria
- func (c OrganizationAccountStoreMappingCriteria) WithOrganization() OrganizationAccountStoreMappingCriteria
- type OrganizationAccountStoreMappings
- type OrganizationCriteria
- func (c OrganizationCriteria) DescriptionEq(description string) OrganizationCriteria
- func (c OrganizationCriteria) Limit(limit int) OrganizationCriteria
- func (c OrganizationCriteria) NameEq(name string) OrganizationCriteria
- func (c OrganizationCriteria) NameKeyEq(status string) OrganizationCriteria
- func (c OrganizationCriteria) Offset(offset int) OrganizationCriteria
- func (c OrganizationCriteria) StatusEq(status string) OrganizationCriteria
- func (c OrganizationCriteria) WithAccountStoreMappings(pageRequest PageRequest) OrganizationCriteria
- func (c OrganizationCriteria) WithAccounts(pageRequest PageRequest) OrganizationCriteria
- func (c OrganizationCriteria) WithCustomData() OrganizationCriteria
- func (c OrganizationCriteria) WithDefaultAccountStoreMapping() OrganizationCriteria
- func (c OrganizationCriteria) WithDefaultGroupStoreMapping() OrganizationCriteria
- func (c OrganizationCriteria) WithGroups(pageRequest PageRequest) OrganizationCriteria
- func (c OrganizationCriteria) WithTenant() OrganizationCriteria
- type Organizations
- type PageRequest
- type PasswordPolicy
- func (r *PasswordPolicy) Delete() error
- func (policy *PasswordPolicy) GetResetEmailTemplates() (*EmailTemplates, error)
- func (policy *PasswordPolicy) GetResetSuccessEmailTemplates() (*EmailTemplates, error)
- func (r PasswordPolicy) IsCacheable() bool
- func (policy *PasswordPolicy) Refresh() error
- func (policy *PasswordPolicy) Update() error
- type Provider
- type ProviderData
- type SAMLAssertionTokenClaims
- type SAMLAuthenticationTokenClaims
- type SSOTokenClaims
- type ScopeFactoryFunc
- type SocialAccount
- type StormpathAssertionAuthenticationResult
- type StormpathAssertionAuthenticator
- type Tenant
- func (tenant *Tenant) CreateOrganization(org *Organization) error
- func (r *Tenant) DeleteCustomData() error
- func (tenant *Tenant) GetAccounts(criteria AccountCriteria) (*Accounts, error)
- func (tenant *Tenant) GetApplications(criteria ApplicationCriteria) (*Applications, error)
- func (r *Tenant) GetCustomData() (CustomData, error)
- func (tenant *Tenant) GetDirectories(criteria DirectoryCriteria) (*Directories, error)
- func (tenant *Tenant) GetGroups(criteria GroupCriteria) (*Groups, error)
- func (tenant *Tenant) GetOrganizations(criteria OrganizationCriteria) (*Organizations, error)
- func (r *Tenant) UpdateCustomData(customData CustomData) (CustomData, error)
Examples ¶
Constants ¶
const ( Name = "name" Description = "description" Status = "status" )
const ( Facebook = "facebook" Google = "google" GitHub = "github" LinkedIn = "linkedin" )
const ( IDTerminator = "sauthc1_request" AuthenticationScheme = "SAuthc1" NL = "\n" HostHeader = "Host" AuthorizationHeader = "Authorization" StormpathDateHeader = "X-Stormpath-Date" Algorithm = "HMAC-SHA-256" SAUTHC1Id = "sauthc1Id" SAUTHC1SignedHeaders = "sauthc1SignedHeaders" SAUTHC1Signature = "sauthc1Signature" DateFormat = "20060102" TimestampFormat = "20060102T150405Z0700" EQ = '=' SPACE = ' ' SLASH = '/' AMP = '&' CS = ", " COMMA = ',' COLON = ':' SemiColon = ';' EMPTY = "" )
SAuthc1 algorithm constants
const ( Enabled = "ENABLED" Disabled = "DISABLED" Unverified = "UNVERIFIED" ApplicationJSON = "application/json" ApplicationFormURLencoded = "application/x-www-form-urlencoded" TextPlain = "text/plain" TextHTML = "text/html" ContentTypeHeader = "Content-Type" AcceptHeader = "Accept" UserAgentHeader = "User-Agent" )
Variables ¶
var DefaultPageRequest = PageRequest{25, 0}
var Logger *log.Logger
Logger library wide logger
Functions ¶
func Authenticate ¶
func Authenticate(req *http.Request, payload []byte, date time.Time, apiKeyID string, apiKeySecret string, nonce string)
Authenticate generates the proper authentication header for the SAuthc1 algorithm use by Stormpath
func CreateApplication ¶
func CreateApplication(app *Application) error
CreateApplication creates a new application in Stormpath. It also passes the createDirectory param as true so the default directory would be created and mapped to the application.
func CreateDirectory ¶
CreateDirectory creates a new directory for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-directories
func Init ¶
func Init(clientConfiguration ClientConfiguration, cache Cache)
Init initializes the underlying client that communicates with Stormpath
func JWT ¶
JWT helper function to create JWT token strings with the given claims, extra header values, and sign with client API Key Secret using SigningMethodHS256 algorithm
func NewPageRequest ¶
NewPageRequest is a conviniece constructor for a PageRequest
Types ¶
type APIKey ¶
type APIKey struct { ID string `json:"id"` Secret string `json:"secret"` Status string `json:"status"` Account *Account `json:"account"` Tenant *Tenant `json:"tenant"` // contains filtered or unexported fields }
APIKey represents an Account key id/secret pair resource
See: https://docs.stormpath.com/rest/product-guide/latest/reference.html#account-api-keys
func GetAPIKey ¶
func GetAPIKey(href string, criteria APIKeyCriteria) (*APIKey, error)
GetAPIKey retrives an APIKey resource by href and optional criteria
func (APIKey) IsCacheable ¶
func (r APIKey) IsCacheable() bool
type APIKeyCriteria ¶
type APIKeyCriteria struct {
// contains filtered or unexported fields
}
APIKeyCriteria represents the criteria type for the APIKey resource
func MakeAPIKeyCriteria ¶
func MakeAPIKeyCriteria() APIKeyCriteria
MakeAPIKeyCriteria creates a default APIKeyCriteria for a single APIKey resource
func MakeAPIKeysCriteria ¶
func MakeAPIKeysCriteria() APIKeyCriteria
MakeAPIKeysCriteria creates a default APIKeyCriteria for a APIKeys collection resource
func (APIKeyCriteria) IDEq ¶
func (c APIKeyCriteria) IDEq(id string) APIKeyCriteria
IDEq adds the id filter to the given APIKeyCriteria
func (APIKeyCriteria) WithAccount ¶
func (c APIKeyCriteria) WithAccount() APIKeyCriteria
WithAccount adds the account expansion to the given APIKeyCriteria
func (APIKeyCriteria) WithTenant ¶
func (c APIKeyCriteria) WithTenant() APIKeyCriteria
WithTenant adds the tenant expansion to the given APIKeyCriteria
type APIKeys ¶
type APIKeys struct { Items []APIKey `json:"items,omitempty"` // contains filtered or unexported fields }
APIKeys represents a collection of APIKey resources
func (APIKeys) IsCacheable ¶
func (r APIKeys) IsCacheable() bool
type AccessTokenClaims ¶
type AccessTokenClaims struct { jwt.StandardClaims RefreshTokenID string `json:"rti,omitempty"` }
AccessTokenClaims are the JWT for a Stormpath OAuth2 access token
type Account ¶
type Account struct { Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` Password string `json:"password,omitempty"` FullName string `json:"fullName,omitempty"` GivenName string `json:"givenName,omitempty"` MiddleName string `json:"middleName,omitempty"` Surname string `json:"surname,omitempty"` Status string `json:"status,omitempty"` Groups *Groups `json:"groups,omitempty"` GroupMemberships *GroupMemberships `json:"groupMemberships,omitempty"` Directory *Directory `json:"directory,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` EmailVerificationToken *resource `json:"emailVerificationToken"` AccessTokens *OAuthTokens `json:"accessTokens,omitempty"` RefreshTokens *OAuthTokens `json:"refreshTokens,omitempty"` ProviderData *ProviderData `json:"providerData,omitempty"` APIKeys *APIKeys `json:"apiKeys,omitempty"` Applications *Applications `json:"applications,omitempty"` // contains filtered or unexported fields }
Account represents an Stormpath account object
See: http://docs.stormpath.com/rest/product-guide/#accounts
func GetAccount ¶
func GetAccount(href string, criteria AccountCriteria) (*Account, error)
GetAccount fetches an account by href and criteria
func NewAccount ¶
NewAccount returns a pointer to an Account with the minimum data required
func VerifyEmailToken ¶
VerifyEmailToken verifies an email verification token associated with an account
See: http://docs.stormpath.com/rest/product-guide/#account-verify-email
func (*Account) AddToGroup ¶
func (account *Account) AddToGroup(group *Group) (*GroupMembership, error)
AddToGroup adds the given account to a given group and returns the respective GroupMembership
func (*Account) CreateAPIKey ¶
CreateAPIKey creates a new API key pair for the given account, it returns a pointer to the APIKey pair.
func (*Account) DeleteCustomData ¶
func (r *Account) DeleteCustomData() error
DeleteCustomData deletes all the resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
func (*Account) GetAccessTokens ¶
func (account *Account) GetAccessTokens(criteria OAuthTokenCriteria) (*OAuthTokens, error)
GetAccessTokens returns the acounts's accessToken collection
func (*Account) GetCustomData ¶
func (r *Account) GetCustomData() (CustomData, error)
GetCustomData returns the given resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
func (*Account) GetGroupMemberships ¶
func (account *Account) GetGroupMemberships(criteria GroupMembershipCriteria) (*GroupMemberships, error)
GetGroupMemberships returns a paged result of the group memeberships of the given account
func (*Account) GetRefreshTokens ¶
func (account *Account) GetRefreshTokens(criteria OAuthTokenCriteria) (*OAuthTokens, error)
GetRefreshTokens returns the account's refreshToken collection
func (*Account) Refresh ¶
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*Account) RemoveFromGroup ¶
RemoveFromGroup removes the given account from the given group by searching the account groupmemberships, and deleting the corresponding one
func (*Account) UpdateCustomData ¶
func (r *Account) UpdateCustomData(customData CustomData) (CustomData, error)
UpdateCustomData sets or updates the given resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
type AccountCreationPolicy ¶
type AccountCreationPolicy struct { VerificationEmailStatus string `json:"verificationEmailStatus,omitempty"` VerificationEmailTemplates *EmailTemplates `json:"verificationEmailTemplates,omitempty"` VerificationSuccessEmailStatus string `json:"verificationSuccessEmailStatus,omitempty"` VerificationSuccessEmailTemplates *EmailTemplates `json:"verificationSuccessEmailTemplates,omitempty"` WelcomeEmailStatus string `json:"welcomeEmailStatus,omitempty"` WelcomeEmailTemplates *EmailTemplates `json:"welcomeEmailTemplates,omitempty"` // contains filtered or unexported fields }
AccountCreationPolicy represents a directory account creation policy object
See: http://docs.stormpath.com/rest/product-guide/#directory-account-creation-policy
func (*AccountCreationPolicy) Delete ¶
func (r *AccountCreationPolicy) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*AccountCreationPolicy) GetVerificationEmailTemplates ¶
func (policy *AccountCreationPolicy) GetVerificationEmailTemplates() (*EmailTemplates, error)
GetVerificationEmailTemplates loads the policy VerificationEmailTemplates collection and returns it
func (*AccountCreationPolicy) GetVerificationSuccessEmailTemplates ¶
func (policy *AccountCreationPolicy) GetVerificationSuccessEmailTemplates() (*EmailTemplates, error)
GetVerificationSuccessEmailTemplates loads the policy VerificationSuccessEmailTemplates collection and returns it
func (*AccountCreationPolicy) GetWelcomeEmailTemplates ¶
func (policy *AccountCreationPolicy) GetWelcomeEmailTemplates() (*EmailTemplates, error)
GetWelcomeEmailTemplates loads the policy WelcomeEmailTemplates collection and returns it
func (AccountCreationPolicy) IsCacheable ¶
func (r AccountCreationPolicy) IsCacheable() bool
func (*AccountCreationPolicy) Refresh ¶
func (policy *AccountCreationPolicy) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*AccountCreationPolicy) Update ¶
func (policy *AccountCreationPolicy) Update() error
Update updates the given resource, by doing a POST to the resource Href
type AccountCriteria ¶
type AccountCriteria struct {
// contains filtered or unexported fields
}
AccountCriteria represents the Criteria type for accounts
func MakeAccountCriteria ¶
func MakeAccountCriteria() AccountCriteria
MakeAccountCriteria creates a new AccountCriteria for a single Account resource
func MakeAccountsCriteria ¶
func MakeAccountsCriteria() AccountCriteria
MakeAccountsCriteria creates a new AccountCriteria for a AccountList resource
func (AccountCriteria) CustomDataEq ¶
func (c AccountCriteria) CustomDataEq(k string, v string) AccountCriteria
func (AccountCriteria) EmailEq ¶
func (c AccountCriteria) EmailEq(email string) AccountCriteria
EmailEq adds the email equals filter to the given AccountCriteria
func (AccountCriteria) GivenNameEq ¶
func (c AccountCriteria) GivenNameEq(givenName string) AccountCriteria
GivenNameEq adds the givenName equal filter to the given AccountCriteria
func (AccountCriteria) Limit ¶
func (c AccountCriteria) Limit(limit int) AccountCriteria
func (AccountCriteria) MiddleNameEq ¶
func (c AccountCriteria) MiddleNameEq(middleName string) AccountCriteria
MiddleNameEq adds the middleName equals filter to the given AccountCriteria
func (AccountCriteria) Offset ¶
func (c AccountCriteria) Offset(offset int) AccountCriteria
func (AccountCriteria) StatusEq ¶
func (c AccountCriteria) StatusEq(status string) AccountCriteria
StatusEq adds the status equals filter to the given AccountCriteria
func (AccountCriteria) SurnameEq ¶
func (c AccountCriteria) SurnameEq(surname string) AccountCriteria
SurnameEq adds the surname equals filter to the given AccountCriteria
func (AccountCriteria) UsernameEq ¶
func (c AccountCriteria) UsernameEq(username string) AccountCriteria
UsernameEq adds the username equals fitler to the given AccountCriteria
func (AccountCriteria) WithAPIKeys ¶
func (c AccountCriteria) WithAPIKeys() AccountCriteria
WithAPIKeys adds the apiKeys expansion to the given AccountCriteria
func (AccountCriteria) WithApplications ¶
func (c AccountCriteria) WithApplications() AccountCriteria
WithApplications adds the applications expansion to the given AccountCriteria
func (AccountCriteria) WithCustomData ¶
func (c AccountCriteria) WithCustomData() AccountCriteria
WithCustomData adds the customData expansion to the given AccountCriteria
func (AccountCriteria) WithDirectory ¶
func (c AccountCriteria) WithDirectory() AccountCriteria
WithDirectory adds the directory expansion to the given AccountCriteria
func (AccountCriteria) WithGroupMemberships ¶
func (c AccountCriteria) WithGroupMemberships(pageRequest PageRequest) AccountCriteria
WithGroupMemberships adds the groupMembership expansion to the given AccountCriteria
func (AccountCriteria) WithGroups ¶
func (c AccountCriteria) WithGroups(pageRequest PageRequest) AccountCriteria
WithGroups adds the groups expansion to the given AccountCriteria
func (AccountCriteria) WithProviderData ¶
func (c AccountCriteria) WithProviderData() AccountCriteria
WithProviderData adds the providerData expansion to the given AccountCriteria
func (AccountCriteria) WithTenant ¶
func (c AccountCriteria) WithTenant() AccountCriteria
WithTenant adds the tenant expansion to the given AccountCriteria
type AccountPasswordResetToken ¶
AccountPasswordResetToken represents an password reset token for a given account
See: http://docs.stormpath.com/rest/product-guide/#application-accounts (Reset An Account’s Password)
type Accounts ¶
type Accounts struct { Items []Account `json:"items,omitempty"` // contains filtered or unexported fields }
Accounts represents a paged result of Account objects
See: http://docs.stormpath.com/rest/product-guide/#accounts-collectionResource
func (Accounts) IsCacheable ¶
func (r Accounts) IsCacheable() bool
type Application ¶
type Application struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` Groups *Groups `json:"groups,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` PasswordResetTokens *resource `json:"passwordResetTokens,omitempty"` AccountStoreMappings *ApplicationAccountStoreMappings `json:"accountStoreMappings,omitempty"` DefaultAccountStoreMapping *ApplicationAccountStoreMapping `json:"defaultAccountStoreMapping,omitempty"` DefaultGroupStoreMapping *ApplicationAccountStoreMapping `json:"defaultGroupStoreMapping,omitempty"` OAuthPolicy *OAuthPolicy `json:"oAuthPolicy,omitempty"` APIKeys *APIKeys `json:"apiKeys,omitempty"` // contains filtered or unexported fields }
Application is resource in Stormpath contains information about any real-world software that communicates with Stormpath via REST APIs. You control who may log in to an application by assigning (or ‘mapping’) one or more Directory, Group, or Organization resources (generically called Account Stores) to an Application resource. The Accounts in these associated Account Stores collectively form the application’s user base.
func GetApplication ¶
func GetApplication(href string, criteria ApplicationCriteria) (*Application, error)
GetApplication loads an application by href. It can optionally have its attributes expanded depending on the ApplicationCriteria value.
func (*Application) AuthenticateAccount ¶
func (app *Application) AuthenticateAccount(username string, password string, accountStoreHref string) (*Account, error)
AuthenticateAccount authenticates an account against the application, using its username and password. It can also include an optional account store HREF, if the accountStoreHref is a zero value string, then it won't be used.
func (*Application) CreateGroup ¶
func (app *Application) CreateGroup(group *Group) error
CreateGroup creates a new application group. Creating a group for an application automatically creates the proper account store mapping between the group and the application.
func (*Application) CreateIDSiteURL ¶
func (app *Application) CreateIDSiteURL(options IDSiteOptions) (string, error)
CreateIDSiteURL generates the IDSite URL for the application. This URL is used to initiate an IDSite workflow. You can pass an IDSiteOptions values to customize the IDSite workflow.
For more information on Stormpath's IDSite feature see: http://docs.stormpath.com/rest/product-guide/latest/idsite.html
func (*Application) GetAPIKey ¶
func (app *Application) GetAPIKey(apiKeyID string, criteria APIKeyCriteria) (*APIKey, error)
GetAPIKey retrives an APIKey from the application by its ID.
It can optionally have its attributes expanded depending on the APIKeyCriteria value.
func (*Application) GetAccountStoreMappings ¶
func (app *Application) GetAccountStoreMappings(criteria ApplicationAccountStoreMappingCriteria) (*ApplicationAccountStoreMappings, error)
GetAccountStoreMappings retrives the collection of all account store mappings associated with the Application.
The collection can be filtered and/or paginated by passing the desire ApplicationAccountStoreMappingCriteria value
func (*Application) GetAccounts ¶
func (r *Application) GetAccounts(criteria AccountCriteria) (*Accounts, error)
GetAccounts returns the accounts within a context of: application, directory, group, organization.
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Application) GetDefaultAccountStoreMapping ¶
func (app *Application) GetDefaultAccountStoreMapping(criteria ApplicationAccountStoreMappingCriteria) (*ApplicationAccountStoreMapping, error)
GetDefaultAccountStoreMapping retrieves the application default application account store mapping.
It can optionally have its attributes expanded depending on the ApplicationAccountStoreMappingCriteria value.
func (*Application) GetGroups ¶
func (app *Application) GetGroups(criteria GroupCriteria) (*Groups, error)
GetGroups retrives the collection of all groups associated with the Application.
The collection can be filtered and/or paginated by passing the desire GroupCriteria value.
func (*Application) GetOAuthPolicy ¶
func (app *Application) GetOAuthPolicy() (*OAuthPolicy, error)
GetOAuthPolicy return the application OAuthPolicy
func (*Application) GetOAuthToken ¶
func (app *Application) GetOAuthToken(username string, password string) (*OAuthResponse, error)
GetOAuthToken creates a OAuth2 token response for an account, using the password grant type.
func (*Application) GetOAuthTokenClientCredentialsGrantType ¶
func (app *Application) GetOAuthTokenClientCredentialsGrantType(apiKeyID, apiKeySecret string) (*OAuthResponse, error)
func (*Application) GetOAuthTokenSocialGrantType ¶
func (app *Application) GetOAuthTokenSocialGrantType(providerID, accessToken, code string) (*OAuthResponse, error)
GetOAuthTokenSocialGrantType creates a OAuth2 token response, for an account using a socical provider via the stormpath_social grant type. This grant type supports exchanging a social provider accessToken or code for a Stormpath access/refresh tokens. You can either pass an accessToken or code but not both, the one that is not used should be pass as a zero value string. If both values are empty or both values are not empty an error is return.
For more information on the stormpath_social grant type see: http://docs.stormpath.com/rest/product-guide/latest/auth_n.html#social
func (*Application) GetOAuthTokenStormpathGrantType ¶
func (app *Application) GetOAuthTokenStormpathGrantType(token string) (*OAuthResponse, error)
GetOAuthTokenStormpathGrantType creates an OAuth2 token response, for a given Stormpath JWT, using the stormpath_token grant type. This grant type is use together with IDSite.
For more information on the stormpath_token grant type see: http://docs.stormpath.com/rest/product-guide/latest/idsite.html#exchanging-the-id-site-jwt-for-an-oauth-token
func (*Application) HandleCallback ¶
func (app *Application) HandleCallback(URL string) (*CallbackResult, error)
HandleCallback handles the URL from an ID Site or SAML callback it parses the JWT token validates it and returns a CallbackResult, if the JWT was valid.
func (*Application) Purge ¶
func (app *Application) Purge() error
Purge deletes the application and all its account stores.
func (*Application) Refresh ¶
func (app *Application) Refresh() error
Refresh refreshes the application based on the latest state from Stormpath.
func (*Application) RefreshOAuthToken ¶
func (app *Application) RefreshOAuthToken(refreshToken string) (*OAuthResponse, error)
RefreshOAuthToken creates an OAuth2 response using the refresh_token grant type.
func (*Application) RegisterAccount ¶
func (app *Application) RegisterAccount(account *Account) error
RegisterAccount registers a new account into the application.
func (*Application) RegisterSocialAccount ¶
func (app *Application) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
RegisterSocialAccount registers a new account into the application using an external social provider Google, Facebook, GitHub or LinkedIn.
func (*Application) ResendVerificationEmail ¶
func (app *Application) ResendVerificationEmail(email string) error
ResendVerificationEmail triggers a resend of the account verification email in Stormpath for a given email address.
For more info on the Stormpath verification workflow see: http://docs.stormpath.com/rest/product-guide/latest/accnt_mgmt.html#how-to-verify-an-account-s-email
func (*Application) ResetPassword ¶
func (app *Application) ResetPassword(token string, newPassword string) (*Account, error)
ResetPassword resets a user password based on the reset password token.
func (*Application) SendPasswordResetEmail ¶
func (app *Application) SendPasswordResetEmail(email string) (*AccountPasswordResetToken, error)
SendPasswordResetEmail triggers a send of the password reset email in Stormpath for a given email address.
For more info on the Stormpath password reset workflow see: http://docs.stormpath.com/rest/product-guide/latest/accnt_mgmt.html#password-reset-flow
func (*Application) Update ¶
func (app *Application) Update() error
Update updates the application in Stormpath.
func (*Application) ValidatePasswordResetToken ¶
func (app *Application) ValidatePasswordResetToken(token string) (*AccountPasswordResetToken, error)
ValidatePasswordResetToken validates the given password reset token against Stormpath.
func (*Application) ValidateToken ¶
func (app *Application) ValidateToken(token string) (*OAuthToken, error)
ValidateToken validates either an OAuth2 access or refresh token against Stormpath.
type ApplicationAccountStoreMapping ¶
type ApplicationAccountStoreMapping struct { ListIndex *int `json:"collectionResourceIndex,omitempty"` IsDefaultAccountStore bool `json:"isDefaultAccountStore"` IsDefaultGroupStore bool `json:"isDefaultGroupStore"` Application *Application `json:"application,omitempty"` AccountStore *resource `json:"accountStore,omitempty"` // contains filtered or unexported fields }
ApplicationAccountStoreMapping represents an Stormpath account store mapping
See: https://docs.stormpath.com/rest/product-guide/latest/reference.html#account-store-mapping
func NewApplicationAccountStoreMapping ¶
func NewApplicationAccountStoreMapping(applicationHref string, accountStoreHref string) *ApplicationAccountStoreMapping
NewApplicationAccountStoreMapping creates a new account store mapping for the Application resource
func (*ApplicationAccountStoreMapping) Delete ¶
func (r *ApplicationAccountStoreMapping) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*ApplicationAccountStoreMapping) IsAccountStoreDirectory ¶
func (mapping *ApplicationAccountStoreMapping) IsAccountStoreDirectory() bool
IsAccountStoreDirectory checks if a given ApplicationAccountStoreMapping maps an Application to a Directory
func (*ApplicationAccountStoreMapping) IsAccountStoreGroup ¶
func (mapping *ApplicationAccountStoreMapping) IsAccountStoreGroup() bool
IsAccountStoreGroup checks if a given ApplicationAccountStoreMapping maps an Application to a Group
func (*ApplicationAccountStoreMapping) IsAccountStoreOrganization ¶
func (mapping *ApplicationAccountStoreMapping) IsAccountStoreOrganization() bool
IsAccountStoreOrganization checks if a given ApplicationAccountStoreMapping maps an Application to an Organization
func (ApplicationAccountStoreMapping) IsCacheable ¶
func (r ApplicationAccountStoreMapping) IsCacheable() bool
func (*ApplicationAccountStoreMapping) Save ¶
func (mapping *ApplicationAccountStoreMapping) Save() error
Save saves the given ApplicationAccountStoreMapping
type ApplicationAccountStoreMappingCriteria ¶
type ApplicationAccountStoreMappingCriteria struct {
// contains filtered or unexported fields
}
ApplicationAccountStoreMappingCriteria is the criteria type for the ApplicationAccountStoreMapping resource
func MakeApplicationAccountStoreMappingCriteria ¶
func MakeApplicationAccountStoreMappingCriteria() ApplicationAccountStoreMappingCriteria
MakeApplicationAccountStoreMappingCriteria creates a default ApplicationAccountStoreMappingCriteria for a single ApplicationAccountStoreMapping resource
func MakeApplicationAccountStoreMappingsCriteria ¶
func MakeApplicationAccountStoreMappingsCriteria() ApplicationAccountStoreMappingCriteria
MakeApplicationAccountStoreMappingsCriteria creates a default ApplicationAccountStoreMappingCriteria for a ApplicationAccountStoreMappings collection resource
func (ApplicationAccountStoreMappingCriteria) Limit ¶
func (c ApplicationAccountStoreMappingCriteria) Limit(limit int) ApplicationAccountStoreMappingCriteria
Pagination
func (ApplicationAccountStoreMappingCriteria) Offset ¶
func (c ApplicationAccountStoreMappingCriteria) Offset(offset int) ApplicationAccountStoreMappingCriteria
func (ApplicationAccountStoreMappingCriteria) WithApplication ¶
func (c ApplicationAccountStoreMappingCriteria) WithApplication() ApplicationAccountStoreMappingCriteria
WithApplication adds the application expansion to the given ApplicationAccountStoreMappingCriteria
type ApplicationAccountStoreMappings ¶
type ApplicationAccountStoreMappings struct { Items []ApplicationAccountStoreMapping `json:"items,omitempty"` // contains filtered or unexported fields }
ApplicationAccountStoreMappings represents a pages result of account store mappings
See: http://docs.stormpath.com/rest/product-guide/#collectionResource-account-store-mappings
func (ApplicationAccountStoreMappings) GetLimit ¶
func (r ApplicationAccountStoreMappings) GetLimit() int
func (ApplicationAccountStoreMappings) GetOffset ¶
func (r ApplicationAccountStoreMappings) GetOffset() int
func (ApplicationAccountStoreMappings) GetSize ¶
func (r ApplicationAccountStoreMappings) GetSize() int
func (ApplicationAccountStoreMappings) IsCacheable ¶
func (r ApplicationAccountStoreMappings) IsCacheable() bool
type ApplicationCriteria ¶
type ApplicationCriteria struct {
// contains filtered or unexported fields
}
ApplicationCriteria rerpresents the criteria object for an application or an applications collection.
func MakeApplicationCriteria ¶
func MakeApplicationCriteria() ApplicationCriteria
MakeApplicationCriteria an empty ApplicationCriteria for an application.
func MakeApplicationsCriteria ¶
func MakeApplicationsCriteria() ApplicationCriteria
MakeApplicationsCriteria an empty ApplicationCriteria for an applications collection.
func (ApplicationCriteria) DescriptionEq ¶
func (c ApplicationCriteria) DescriptionEq(description string) ApplicationCriteria
DescriptionEq adds the description filter to the given ApplicationCriteria
func (ApplicationCriteria) Limit ¶
func (c ApplicationCriteria) Limit(limit int) ApplicationCriteria
func (ApplicationCriteria) NameEq ¶
func (c ApplicationCriteria) NameEq(name string) ApplicationCriteria
NameEq adds the name filter to the given ApplicationCriteria
func (ApplicationCriteria) Offset ¶
func (c ApplicationCriteria) Offset(offset int) ApplicationCriteria
func (ApplicationCriteria) StatusEq ¶
func (c ApplicationCriteria) StatusEq(status string) ApplicationCriteria
StatusEq adds the status filter to the given ApplicationCriteria
func (ApplicationCriteria) WithAccessTokens ¶
func (c ApplicationCriteria) WithAccessTokens(pageRequest PageRequest) ApplicationCriteria
WithAccessTokens adds the accessTokens expansion to the given ApplicationCriteria
func (ApplicationCriteria) WithAccountStoreMappings ¶
func (c ApplicationCriteria) WithAccountStoreMappings(pageRequest PageRequest) ApplicationCriteria
WithAccountStoreMappings adds the accountStoreMapping expansion to the given ApplicationCriteria
func (ApplicationCriteria) WithAccounts ¶
func (c ApplicationCriteria) WithAccounts(pageRequest PageRequest) ApplicationCriteria
WithAccounts adds the accounts expansion to the given ApplicationCriteria
func (ApplicationCriteria) WithCustomData ¶
func (c ApplicationCriteria) WithCustomData() ApplicationCriteria
WithCustomData adds the customData expansion to the given ApplicationCriteria
func (ApplicationCriteria) WithDefaultAccountStoreMapping ¶
func (c ApplicationCriteria) WithDefaultAccountStoreMapping() ApplicationCriteria
WithDefaultAccountStoreMapping adds the defaultGroupStoreMapping expansion to the given ApplicationCriteria
func (ApplicationCriteria) WithDefaultGroupStoreMapping ¶
func (c ApplicationCriteria) WithDefaultGroupStoreMapping() ApplicationCriteria
WithDefaultGroupStoreMapping adds the defaultGroupStoreMapping expansion to the given ApplicationCriteria
func (ApplicationCriteria) WithGroups ¶
func (c ApplicationCriteria) WithGroups(pageRequest PageRequest) ApplicationCriteria
WithGroups adds the groups expansion to the given ApplicationCriteria
func (ApplicationCriteria) WithRefreshTokens ¶
func (c ApplicationCriteria) WithRefreshTokens(pageRequest PageRequest) ApplicationCriteria
WithRefreshTokens adds the refreshTokens expansion to the given ApplicationCriteria
func (ApplicationCriteria) WithTenant ¶
func (c ApplicationCriteria) WithTenant() ApplicationCriteria
WithTenant adds the tenant expansion to the given ApplicationCriteria
type Applications ¶
type Applications struct { Items []Application `json:"items,omitempty"` // contains filtered or unexported fields }
Applications is the collection resource of applications.
For more on Stormpath collection resources see: http://docs.stormpath.com/rest/product-guide/latest/reference.html#collection-resource
func (Applications) IsCacheable ¶
func (r Applications) IsCacheable() bool
type AuthResult ¶
type AuthResult interface {
GetAccount() *Account
}
AuthResult is implemented by any authentication result for any of the posible authenticators to retrieve the authentication result account.
type AuthenticationResult ¶
type AuthenticationResult struct {
Account *Account
}
AuthenticationResult base authentication result for all authenticators
func (*AuthenticationResult) GetAccount ¶
func (ar *AuthenticationResult) GetAccount() *Account
type Authenticator ¶
type Authenticator struct {
Application *Application
}
Authenticator is the base authenticator type
See https://github.com/stormpath/stormpath-sdk-spec/blob/master/specifications/authenticators.md
type BasicAuthenticator ¶
type BasicAuthenticator Authenticator
BasicAuthenticator will authenticate the API Key and Secret of a Stormpath Account object. Authentication should succeed only if the following are true:
* The provided API Key and Secret exist for an account that is reachable by the application. * The API Key is not disabled. * The Account is not disabled.
func NewBasicAuthenticator ¶
func NewBasicAuthenticator(application *Application) BasicAuthenticator
NewBasicAuthenticator returns a BasicAuthenticator for the given application
func (BasicAuthenticator) Authenticate ¶
func (a BasicAuthenticator) Authenticate(accountAPIKey, accountAPISecret string) (*AuthenticationResult, error)
Authenticate authenticates the given account APIKey and APISecret
type Cache ¶
type Cache interface { Exists(key string) bool Set(key string, data []byte) Get(key string) []byte Del(key string) }
Cache is a base interface for any cache provider
type Cacheable ¶
type Cacheable interface {
IsCacheable() bool
}
Cacheable determines if the implementor should be cached or not
type CallbackResult ¶
CallbackResult is the parsed IDSite callback JWT token information and an optional account if the tocken contain one.
type Claims ¶
type Claims struct { EXP int64 `json:"exp"` IAT int64 `json:"iat"` ISS string `json:"iss"` JTI string `json:"jti"` RTI string `json:"rti"` SUB string `json:"sub"` }
Claims represents the expanded JWT claims
type Client ¶
type Client struct { ClientConfiguration ClientConfiguration HTTPClient *http.Client Cache Cache WebSDKToken string }
Client is low level REST client for any Stormpath request, it holds the credentials, an the actual http client, and the cache. The Cache can be initialize in nil and the client would simply ignore it and don't cache any response.
type ClientConfiguration ¶
type ClientConfiguration struct { APIKeyFile string APIKeyID string APIKeySecret string CacheManagerEnabled bool CacheTTL time.Duration CacheTTI time.Duration BaseURL string ConnectionTimeout int AuthenticationScheme string ProxyPort int ProxyHost string ProxyUsername string ProxyPassword string }
ClientConfiguration representd the overall SDK configuration options
func LoadConfiguration ¶
func LoadConfiguration() (ClientConfiguration, error)
LoadConfiguration loads the configuration from the default locations
func LoadConfigurationWithCreds ¶
func LoadConfigurationWithCreds(key string, secret string) ClientConfiguration
LoadConfigurationWithCreds loads the configuration from the default localtions but with custom Stormpath credentials
func (ClientConfiguration) GetJWTSigningKey ¶
func (config ClientConfiguration) GetJWTSigningKey() []byte
GetJWTSigningKey returns the API Key Secret as a []byte to sign JWT tokens
type CustomData ¶
type CustomData map[string]interface{}
CustomData represents Stormpath's custom data resouce
func (CustomData) IsCacheable ¶
func (customData CustomData) IsCacheable() bool
type Directories ¶
type Directories struct { Items []Directory `json:"items,omitempty"` // contains filtered or unexported fields }
Directories represnets a paged result of directories
func (Directories) IsCacheable ¶
func (r Directories) IsCacheable() bool
type Directory ¶
type Directory struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` Groups *Groups `json:"groups,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` Provider *Provider `json:"provider,omitempty"` AccountCreationPolicy *AccountCreationPolicy `json:"accountCreationPolicy,omitempty"` PasswordPolicy *PasswordPolicy `json:"passwordPolicy,omitempty"` // contains filtered or unexported fields }
Directory represents a Stormpath directory object
See: http://docs.stormpath.com/rest/product-guide/#directories
func GetDirectory ¶
func GetDirectory(href string, criteria DirectoryCriteria) (*Directory, error)
GetDirectory loads a directory by href and criteria
func NewDirectory ¶
NewDirectory creates a new directory with the given name
func NewFacebookDirectory ¶
NewFacebookDirectory creates a new directory with a Facebook backed provider
func NewGithubDirectory ¶
NewGithubDirectory creates a new directory with a GitHub backed provider
func NewGoogleDirectory ¶
func NewGoogleDirectory(name string, clientID string, clientSecret string, redirectURI string) *Directory
NewGoogleDirectory creates a new directory with a Google backed provider
func NewLinkedInDirectory ¶
func NewLinkedInDirectory(name string, clientID string, clientSecret string, redirectURI string) *Directory
NewLinkedInDirectory creates a new directory with a LinkedIn backend provider
func (*Directory) CreateGroup ¶
CreateGroup creates a new group in the directory
func (*Directory) GetAccountCreationPolicy ¶
func (dir *Directory) GetAccountCreationPolicy() (*AccountCreationPolicy, error)
GetAccountCreationPolicy loads the directory account creation policy
func (*Directory) GetAccounts ¶
func (r *Directory) GetAccounts(criteria AccountCriteria) (*Accounts, error)
GetAccounts returns the accounts within a context of: application, directory, group, organization.
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Directory) GetGroups ¶
func (dir *Directory) GetGroups(criteria GroupCriteria) (*Groups, error)
GetGroups returns all the groups from a directory
func (*Directory) Refresh ¶
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*Directory) RegisterAccount ¶
RegisterAccount registers a new account into the directory
See: http://docs.stormpath.com/rest/product-guide/#directory-accounts
func (*Directory) RegisterSocialAccount ¶
func (dir *Directory) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
RegisterSocialAccount registers a new account into the application using an external provider Google, Facebook
type DirectoryCriteria ¶
type DirectoryCriteria struct {
// contains filtered or unexported fields
}
func MakeDirectoriesCriteria ¶
func MakeDirectoriesCriteria() DirectoryCriteria
func MakeDirectoryCriteria ¶
func MakeDirectoryCriteria() DirectoryCriteria
func (DirectoryCriteria) DescriptionEq ¶
func (c DirectoryCriteria) DescriptionEq(description string) DirectoryCriteria
func (DirectoryCriteria) Limit ¶
func (c DirectoryCriteria) Limit(limit int) DirectoryCriteria
func (DirectoryCriteria) NameEq ¶
func (c DirectoryCriteria) NameEq(name string) DirectoryCriteria
func (DirectoryCriteria) Offset ¶
func (c DirectoryCriteria) Offset(offset int) DirectoryCriteria
func (DirectoryCriteria) StatusEq ¶
func (c DirectoryCriteria) StatusEq(status string) DirectoryCriteria
func (DirectoryCriteria) WithAccountCreationPolicy ¶
func (c DirectoryCriteria) WithAccountCreationPolicy() DirectoryCriteria
func (DirectoryCriteria) WithAccounts ¶
func (c DirectoryCriteria) WithAccounts(pageRequest PageRequest) DirectoryCriteria
func (DirectoryCriteria) WithCustomData ¶
func (c DirectoryCriteria) WithCustomData() DirectoryCriteria
func (DirectoryCriteria) WithGroups ¶
func (c DirectoryCriteria) WithGroups(pageRequest PageRequest) DirectoryCriteria
func (DirectoryCriteria) WithPasswordPolicy ¶
func (c DirectoryCriteria) WithPasswordPolicy() DirectoryCriteria
func (DirectoryCriteria) WithProvider ¶
func (c DirectoryCriteria) WithProvider() DirectoryCriteria
func (DirectoryCriteria) WithTenant ¶
func (c DirectoryCriteria) WithTenant() DirectoryCriteria
type EmailTemplate ¶
type EmailTemplate struct { FromEmailAddress string `json:"fromEmailAddress"` FromName string `json:"fromName"` Subject string `json:"subject"` HTMLBody string `json:"htmlBody"` TextBody string `json:"textBody"` MimeType string `json:"mimeType"` DefaultModel map[string]string `json:"defaultModel"` // contains filtered or unexported fields }
EmailTemplate represents an account creation policy email template
func GetEmailTemplate ¶
func GetEmailTemplate(href string) (*EmailTemplate, error)
GetEmailTemplate loads an email template by href
func (*EmailTemplate) Delete ¶
func (r *EmailTemplate) Delete() error
Delete deletes the given account, it wont modify the calling account
func (EmailTemplate) IsCacheable ¶
func (r EmailTemplate) IsCacheable() bool
func (*EmailTemplate) Refresh ¶
func (template *EmailTemplate) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*EmailTemplate) Update ¶
func (template *EmailTemplate) Update() error
Update updates the given resource, by doing a POST to the resource Href
type EmailTemplates ¶
type EmailTemplates struct { Items []EmailTemplate `json:"items,omitempty"` // contains filtered or unexported fields }
EmailTemplates represents a collection of EmailTemplate
func (EmailTemplates) IsCacheable ¶
func (r EmailTemplates) IsCacheable() bool
type Error ¶
type Error struct { RequestID string Status int `json:"status"` Code int `json:"code"` Message string `json:"message"` DeveloperMessage string `json:"developerMessage"` MoreInfo string `json:"moreInfo"` OAuth2Error string `json:"error"` }
Error maps a Stormpath API JSON error object which implements Go error interface
type ExpandedJWT ¶
type ExpandedJWT struct { Claims Claims `json:"claims"` Header Header `json:"header"` Signature string `json:"signature"` }
ExpandedJWT represents the OAuth token expanded JWT information
type GrantTypeClientCredentialsTokenClaims ¶
type GrantTypeClientCredentialsTokenClaims struct { jwt.StandardClaims Scope string `json:"scope,omitempty"` }
GrantTypeClientCredentialsTokenClaims are the JWT claims use for the client credentials OAuth2 grant type authentication
type GrantTypeStormpathTokenClaims ¶
type GrantTypeStormpathTokenClaims struct { jwt.StandardClaims Status string `json:"status,omitempty"` }
GrantTypeStormpathTokenClaims are the JWT claims for a Stormpath OAuth2 authentication using the stormpath_token grant type
type Group ¶
type Group struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` Directory *Directory `json:"directory,omitempty"` AccountMemberships *GroupMemberships `json:"accountMemberships,omitempty"` // contains filtered or unexported fields }
Group represents a Stormpath Group
See: http://docs.stormpath.com/rest/product-guide/#groups
func GetGroup ¶
func GetGroup(href string, criteria GroupCriteria) (*Group, error)
GetGroup loads a group by href and criteria
func (*Group) GetAccounts ¶
func (r *Group) GetAccounts(criteria AccountCriteria) (*Accounts, error)
GetAccounts returns the accounts within a context of: application, directory, group, organization.
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Group) GetGroupAccountMemberships ¶
func (group *Group) GetGroupAccountMemberships(criteria GroupMembershipCriteria) (*GroupMemberships, error)
GetGroupAccountMemberships loads the given group memeberships
type GroupCriteria ¶
type GroupCriteria struct {
// contains filtered or unexported fields
}
func MakeGroupCriteria ¶
func MakeGroupCriteria() GroupCriteria
func MakeGroupsCriteria ¶
func MakeGroupsCriteria() GroupCriteria
func (GroupCriteria) DescriptionEq ¶
func (c GroupCriteria) DescriptionEq(description string) GroupCriteria
func (GroupCriteria) Limit ¶
func (c GroupCriteria) Limit(limit int) GroupCriteria
func (GroupCriteria) NameEq ¶
func (c GroupCriteria) NameEq(name string) GroupCriteria
func (GroupCriteria) Offset ¶
func (c GroupCriteria) Offset(offset int) GroupCriteria
func (GroupCriteria) StatusEq ¶
func (c GroupCriteria) StatusEq(status string) GroupCriteria
func (GroupCriteria) WithAccounts ¶
func (c GroupCriteria) WithAccounts(pageRequest PageRequest) GroupCriteria
func (GroupCriteria) WithCustomData ¶
func (c GroupCriteria) WithCustomData() GroupCriteria
func (GroupCriteria) WithDirectory ¶
func (c GroupCriteria) WithDirectory() GroupCriteria
func (GroupCriteria) WithTenant ¶
func (c GroupCriteria) WithTenant() GroupCriteria
type GroupMembership ¶
type GroupMembership struct { Account *Account `json:"account"` Group *Group `json:"group"` // contains filtered or unexported fields }
func NewGroupMembership ¶
func NewGroupMembership(accountHref string, groupHref string) *GroupMembership
func (*GroupMembership) Delete ¶
func (r *GroupMembership) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*GroupMembership) GetAccount ¶
func (groupmembership *GroupMembership) GetAccount(criteria AccountCriteria) (*Account, error)
func (*GroupMembership) GetGroup ¶
func (groupmembership *GroupMembership) GetGroup(criteria GroupCriteria) (*Group, error)
func (GroupMembership) IsCacheable ¶
func (r GroupMembership) IsCacheable() bool
type GroupMembershipCriteria ¶
type GroupMembershipCriteria struct {
// contains filtered or unexported fields
}
func MakeGroupMemershipCriteria ¶
func MakeGroupMemershipCriteria() GroupMembershipCriteria
func MakeGroupMemershipsCriteria ¶
func MakeGroupMemershipsCriteria() GroupMembershipCriteria
func (GroupMembershipCriteria) Limit ¶
func (c GroupMembershipCriteria) Limit(limit int) GroupMembershipCriteria
func (GroupMembershipCriteria) Offset ¶
func (c GroupMembershipCriteria) Offset(offset int) GroupMembershipCriteria
func (GroupMembershipCriteria) WithAccount ¶
func (c GroupMembershipCriteria) WithAccount() GroupMembershipCriteria
func (GroupMembershipCriteria) WithGroup ¶
func (c GroupMembershipCriteria) WithGroup() GroupMembershipCriteria
type GroupMemberships ¶
type GroupMemberships struct { Items []GroupMembership `json:"items,omitempty"` // contains filtered or unexported fields }
func (GroupMemberships) IsCacheable ¶
func (r GroupMemberships) IsCacheable() bool
type Groups ¶
type Groups struct { Items []Group `json:"items,omitempty"` // contains filtered or unexported fields }
Groups represent a paged result of groups
func (Groups) IsCacheable ¶
func (r Groups) IsCacheable() bool
type IDSiteAssertionTokenClaims ¶
type IDSiteAssertionTokenClaims struct { jwt.StandardClaims State string `json:"state,omitempty"` Status string `json:"status,omitempty"` }
IDSiteAssertionTokenClaims are the JWT claims of an Stormpath Assertion type authentication this could originage from an IDSite workflow
type IDSiteOptions ¶
IDSiteOptions represents the posible options to generate an new IDSite URL.
type LocalCache ¶
type LocalCache struct {
// contains filtered or unexported fields
}
func NewLocalCache ¶
func NewLocalCache(ttl time.Duration, tti time.Duration) *LocalCache
func (*LocalCache) Count ¶
func (cache *LocalCache) Count() int
Count returns the number of items in the cache (helpful for tracking memory leaks)
func (*LocalCache) Del ¶
func (cache *LocalCache) Del(key string)
func (*LocalCache) Exists ¶
func (cache *LocalCache) Exists(key string) bool
func (*LocalCache) Get ¶
func (cache *LocalCache) Get(key string) []byte
func (*LocalCache) Set ¶
func (cache *LocalCache) Set(key string, data []byte)
type OAuthAccessTokenResult ¶
type OAuthAccessTokenResult OAuthResponse
OAuthAccessTokenResult is the default OAuth response
func (*OAuthAccessTokenResult) GetAccount ¶
func (ar *OAuthAccessTokenResult) GetAccount() *Account
type OAuthBearerAuthenticator ¶
type OAuthBearerAuthenticator Authenticator
OAuthBearerAuthenticator should authenticate OAuth2 bearer tokens only. The token is an access token JWT that has been created by Stormpath. The token may have been created by the client_credential or password_grant flow. This can be determined by looking at the kid property in the header of the JWT. Password grant JWTs will have a kid, but client credential JWTs will not.
func NewOAuthBearerAuthenticator ¶
func NewOAuthBearerAuthenticator(application *Application) OAuthBearerAuthenticator
func (OAuthBearerAuthenticator) Authenticate ¶
func (a OAuthBearerAuthenticator) Authenticate(accessTokenJWT string) (*AuthenticationResult, error)
type OAuthClientCredentialsAuthenticationResult ¶
type OAuthClientCredentialsAuthenticationResult OAuthResponse
OAuthClientCredentialsAuthenticationResult is the authentication result for the OAuthClientCredentialsAuthenticator
func (*OAuthClientCredentialsAuthenticationResult) GetAccount ¶
func (ar *OAuthClientCredentialsAuthenticationResult) GetAccount() *Account
type OAuthClientCredentialsAuthenticator ¶
type OAuthClientCredentialsAuthenticator struct { Authenticator ScopeFactory ScopeFactoryFunc TTL time.Duration }
OAuthClientCredentialsAuthenticator this authenticator accepts an Account's API Key and Secret, and gives back an access token in response. The authenticator should follow the same authentication rules as the BasicAuthenticator. The end-user (account) can request scope, if the scope factory determines that this scope is permitted, then the scope should be added to the access token.
This authenticator is responsible for creating the access token. The Stormpath REST API does not yet provide the client_credential grant on the appplication's /oauth/token endpoint.
func NewOAuthClientCredentialsAuthenticator ¶
func NewOAuthClientCredentialsAuthenticator(application *Application) OAuthClientCredentialsAuthenticator
func (OAuthClientCredentialsAuthenticator) Authenticate ¶
func (a OAuthClientCredentialsAuthenticator) Authenticate(accountAPIKeyID, accountAPIKeySecret, scope string) (*OAuthClientCredentialsAuthenticationResult, error)
type OAuthPasswordAuthenticator ¶
type OAuthPasswordAuthenticator Authenticator
OAuthPasswordAuthenticator this authenticator accepts an account's username and password, and returns an access token response that is obtained by posting the username and password to the application's /oauth/token endpoint with the grant_type=password parameter.
func NewOAuthPasswordAuthenticator ¶
func NewOAuthPasswordAuthenticator(application *Application) OAuthPasswordAuthenticator
func (OAuthPasswordAuthenticator) Authenticate ¶
func (a OAuthPasswordAuthenticator) Authenticate(username, password string) (*OAuthAccessTokenResult, error)
type OAuthPolicy ¶
type OAuthPolicy struct { AccessTokenTTL string `json:"accessTokenTtl,omitempty"` RefreshTokenTTL string `json:"refreshTokenTtl,omitempty"` // contains filtered or unexported fields }
OAuthPolicy holds the application related OAuth configuration
func (*OAuthPolicy) Delete ¶
func (r *OAuthPolicy) Delete() error
Delete deletes the given account, it wont modify the calling account
func (OAuthPolicy) IsCacheable ¶
func (r OAuthPolicy) IsCacheable() bool
type OAuthProvider ¶
type OAuthProvider struct { ClientID string `json:"clientId,omitempty"` ClientSecret string `json:"clientSecret,omitempty"` RedirectURI string `json:"redirectUri,omitempty"` }
OAuthProvider represents a generic OAuth2 provider for all the social type directories
type OAuthRefreshTokenAuthenticator ¶
type OAuthRefreshTokenAuthenticator Authenticator
OAuthRefreshTokenAuthenticator this authenticator accepts a previously-issued refresh token and post's it to the application's /oauth/token endpoint with the grant_type=refresh_token parameter. The response is a new access token response.
func NewOAuthRefreshTokenAuthenticator ¶
func NewOAuthRefreshTokenAuthenticator(application *Application) OAuthRefreshTokenAuthenticator
func (OAuthRefreshTokenAuthenticator) Authenticate ¶
func (a OAuthRefreshTokenAuthenticator) Authenticate(refreshToken string) (*OAuthAccessTokenResult, error)
type OAuthRequestAuthenticator ¶
type OAuthRequestAuthenticator struct { Authenticator ScopeFactory ScopeFactoryFunc TTL time.Duration }
OAuthRequestAuthenticator should authenticate OAuth2 requests. It will eventually support authenticating all 4 OAuth2 grant types.
Specifically, right now, this class will authenticate OAuth2 access tokens, as well as handle API key for access token exchanges using the OAuth2 client credentials grant type.
func NewOAuthRequestAuthenticator ¶
func NewOAuthRequestAuthenticator(application *Application) OAuthRequestAuthenticator
NewOAuthRequestAuthenticator creates a new OAuthRequestAuthenticator for a given Application
func (OAuthRequestAuthenticator) Authenticate ¶
func (a OAuthRequestAuthenticator) Authenticate(r *http.Request) (*OAuthAccessTokenResult, error)
Authenticate authenticates an http.Request value using the possible grant types that Stormpath supports, it returns an error if the request is not authenticated.
Supported grant types: - password - client_credentials - refresh_token
type OAuthResponse ¶
type OAuthResponse struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token,omitempty"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` StormpathAccessTokenHref string `json:"stormpath_access_token_href,omitempty"` }
OAuthResponse represents an OAuth2 response from StormPath
type OAuthStormpathTokenAuthenticator ¶
type OAuthStormpathTokenAuthenticator Authenticator
OAuthStormpathTokenAuthenticator this authenticator takes a Stormpath Token JWT and posts it to the application's /oauth/token endpoint, as grant_type=stormpath_token. The result is an OAuthAccessTokenResult.
func NewOAuthStormpathTokenAuthenticator ¶
func NewOAuthStormpathTokenAuthenticator(application *Application) OAuthStormpathTokenAuthenticator
func (OAuthStormpathTokenAuthenticator) Authenticate ¶
func (a OAuthStormpathTokenAuthenticator) Authenticate(stormpathJWT string) (*OAuthAccessTokenResult, error)
type OAuthToken ¶
type OAuthToken struct { Account *Account `json:"account"` Application *Application `json:"application"` Tenant *Tenant `json:"tenant"` JWT string `json:"jwt"` ExpandedJWT ExpandedJWT `json:"expandedJwt"` // contains filtered or unexported fields }
OAuthToken represents the Stormpath OAuthToken see: https://docs.stormpath.com/guides/token-management/
func (OAuthToken) IsCacheable ¶
func (r OAuthToken) IsCacheable() bool
type OAuthTokenCriteria ¶
type OAuthTokenCriteria struct {
// contains filtered or unexported fields
}
func MakeOAuthTokensCriteria ¶
func MakeOAuthTokensCriteria() OAuthTokenCriteria
type OAuthTokens ¶
type OAuthTokens struct { Items []OAuthToken `json:"items,omitempty"` // contains filtered or unexported fields }
OAuthTokens collection type for OAuthToken
func (OAuthTokens) IsCacheable ¶
func (r OAuthTokens) IsCacheable() bool
type Organization ¶
type Organization struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` NameKey string `json:"nameKey,omitempty"` Groups *Groups `json:"groups,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` AccountStoreMappings *OrganizationAccountStoreMappings `json:"accountStoreMappings,omitempty"` DefaultAccountStoreMapping *OrganizationAccountStoreMapping `json:"defaultAccountStoreMapping,omitempty"` DefaultGroupStoreMapping *OrganizationAccountStoreMapping `json:"defaultGroupStoreMapping,omitempty"` // contains filtered or unexported fields }
Organization represnts the Stormpath organization resource, use for multitenancy
func GetOrganization ¶
func GetOrganization(href string, criteria OrganizationCriteria) (*Organization, error)
GetOrganization loads an organization by href and criteria
func NewOrganization ¶
func NewOrganization(name string, nameKey string) *Organization
NewOrganization creates a new organization
func (*Organization) GetAccountStoreMappings ¶
func (org *Organization) GetAccountStoreMappings(criteria OrganizationAccountStoreMappingCriteria) (*OrganizationAccountStoreMappings, error)
GetAccountStoreMappings returns all the applications account store mappings
func (*Organization) GetAccounts ¶
func (r *Organization) GetAccounts(criteria AccountCriteria) (*Accounts, error)
GetAccounts returns the accounts within a context of: application, directory, group, organization.
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Organization) GetDefaultAccountStoreMapping ¶
func (org *Organization) GetDefaultAccountStoreMapping(criteria OrganizationAccountStoreMappingCriteria) (*OrganizationAccountStoreMapping, error)
func (*Organization) Refresh ¶
func (org *Organization) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*Organization) RegisterAccount ¶
func (org *Organization) RegisterAccount(account *Account) error
RegisterAccount registers a new account into the organization
func (*Organization) RegisterSocialAccount ¶
func (org *Organization) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
RegisterSocialAccount registers a new account into the organization using an external provider Google, Facebook
func (*Organization) Update ¶
func (org *Organization) Update() error
Update updates the given resource, by doing a POST to the resource Href
type OrganizationAccountStoreMapping ¶
type OrganizationAccountStoreMapping struct { ListIndex *int `json:"collectionResourceIndex,omitempty"` IsDefaultAccountStore bool `json:"isDefaultAccountStore"` IsDefaultGroupStore bool `json:"isDefaultGroupStore"` Organization *Organization `json:"organization,omitempty"` AccountStore *resource `json:"accountStore,omitempty"` // contains filtered or unexported fields }
OrganizationAccountStoreMapping represents an Stormpath account store mapping for an Organization resource
func NewOrganizationAccountStoreMapping ¶
func NewOrganizationAccountStoreMapping(organizationHref string, accountStoreHref string) *OrganizationAccountStoreMapping
NewOrganizationAccountStoreMapping creates a new account mapping for the Organization resource
func (*OrganizationAccountStoreMapping) Delete ¶
func (r *OrganizationAccountStoreMapping) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*OrganizationAccountStoreMapping) IsAccountStoreDirectory ¶
func (mapping *OrganizationAccountStoreMapping) IsAccountStoreDirectory() bool
IsAccountStoreDirectory checks if a given OrganizationAccountStoreMapping maps an Application to a Directory
func (*OrganizationAccountStoreMapping) IsAccountStoreGroup ¶
func (mapping *OrganizationAccountStoreMapping) IsAccountStoreGroup() bool
IsAccountStoreGroup checks if a given OrganizationAccountStoreMapping maps an Application to a Directory
func (*OrganizationAccountStoreMapping) IsAccountStoreOrganization ¶
func (mapping *OrganizationAccountStoreMapping) IsAccountStoreOrganization() bool
IsAccountStoreOrganization checks if a given ApplicationAccountStoreMapping maps an Application to an Organization
func (OrganizationAccountStoreMapping) IsCacheable ¶
func (r OrganizationAccountStoreMapping) IsCacheable() bool
func (*OrganizationAccountStoreMapping) Save ¶
func (mapping *OrganizationAccountStoreMapping) Save() error
Save saves the given OrganizationAccountStoreMapping
type OrganizationAccountStoreMappingCriteria ¶
type OrganizationAccountStoreMappingCriteria struct {
// contains filtered or unexported fields
}
OrganizationAccountStoreMappingCriteria is the criteria type for OrganizationAccountStoreMapping
func MakeOrganizationAccountStoreMappingCriteria ¶
func MakeOrganizationAccountStoreMappingCriteria() OrganizationAccountStoreMappingCriteria
MakeOrganizationAccountStoreMappingCriteria creates a default OrganizationAccountStoreMappingCriteria for a single OrganizationAccountStoreMapping resource
func MakeOrganizationAccountStoreMappingsCriteria ¶
func MakeOrganizationAccountStoreMappingsCriteria() OrganizationAccountStoreMappingCriteria
MakeOrganizationAccountStoreMappingsCriteria creates a default OrganizationAccountStoreMappingCriteria for a OrganizationAccountStoreMappings collection resource
func (OrganizationAccountStoreMappingCriteria) Limit ¶
func (c OrganizationAccountStoreMappingCriteria) Limit(limit int) OrganizationAccountStoreMappingCriteria
func (OrganizationAccountStoreMappingCriteria) Offset ¶
func (c OrganizationAccountStoreMappingCriteria) Offset(offset int) OrganizationAccountStoreMappingCriteria
func (OrganizationAccountStoreMappingCriteria) WithOrganization ¶
func (c OrganizationAccountStoreMappingCriteria) WithOrganization() OrganizationAccountStoreMappingCriteria
WithOrganization adds the organization expansion to the given OrganizationAccountStoreMappingCriteria
type OrganizationAccountStoreMappings ¶
type OrganizationAccountStoreMappings struct { Items []OrganizationAccountStoreMapping `json:"items,omitempty"` // contains filtered or unexported fields }
OrganizationAccountStoreMappings represents a collection of OrganizationAccountStoreMapping
func (OrganizationAccountStoreMappings) GetLimit ¶
func (r OrganizationAccountStoreMappings) GetLimit() int
func (OrganizationAccountStoreMappings) GetOffset ¶
func (r OrganizationAccountStoreMappings) GetOffset() int
func (OrganizationAccountStoreMappings) GetSize ¶
func (r OrganizationAccountStoreMappings) GetSize() int
func (OrganizationAccountStoreMappings) IsCacheable ¶
func (r OrganizationAccountStoreMappings) IsCacheable() bool
type OrganizationCriteria ¶
type OrganizationCriteria struct {
// contains filtered or unexported fields
}
func MakeOrganizationCriteria ¶
func MakeOrganizationCriteria() OrganizationCriteria
func MakeOrganizationsCriteria ¶
func MakeOrganizationsCriteria() OrganizationCriteria
func (OrganizationCriteria) DescriptionEq ¶
func (c OrganizationCriteria) DescriptionEq(description string) OrganizationCriteria
func (OrganizationCriteria) Limit ¶
func (c OrganizationCriteria) Limit(limit int) OrganizationCriteria
func (OrganizationCriteria) NameEq ¶
func (c OrganizationCriteria) NameEq(name string) OrganizationCriteria
func (OrganizationCriteria) NameKeyEq ¶
func (c OrganizationCriteria) NameKeyEq(status string) OrganizationCriteria
func (OrganizationCriteria) Offset ¶
func (c OrganizationCriteria) Offset(offset int) OrganizationCriteria
func (OrganizationCriteria) StatusEq ¶
func (c OrganizationCriteria) StatusEq(status string) OrganizationCriteria
func (OrganizationCriteria) WithAccountStoreMappings ¶
func (c OrganizationCriteria) WithAccountStoreMappings(pageRequest PageRequest) OrganizationCriteria
func (OrganizationCriteria) WithAccounts ¶
func (c OrganizationCriteria) WithAccounts(pageRequest PageRequest) OrganizationCriteria
func (OrganizationCriteria) WithCustomData ¶
func (c OrganizationCriteria) WithCustomData() OrganizationCriteria
func (OrganizationCriteria) WithDefaultAccountStoreMapping ¶
func (c OrganizationCriteria) WithDefaultAccountStoreMapping() OrganizationCriteria
func (OrganizationCriteria) WithDefaultGroupStoreMapping ¶
func (c OrganizationCriteria) WithDefaultGroupStoreMapping() OrganizationCriteria
func (OrganizationCriteria) WithGroups ¶
func (c OrganizationCriteria) WithGroups(pageRequest PageRequest) OrganizationCriteria
func (OrganizationCriteria) WithTenant ¶
func (c OrganizationCriteria) WithTenant() OrganizationCriteria
type Organizations ¶
type Organizations struct { Items []Organization `json:"items,omitempty"` // contains filtered or unexported fields }
Organizations represents a paged result or applications
func (Organizations) IsCacheable ¶
func (r Organizations) IsCacheable() bool
type PageRequest ¶
PageRequest contains the limit and offset values for any paginated Stormpath request
type PasswordPolicy ¶
type PasswordPolicy struct { ResetTokenTTL int `json:"resetTokenTtl,omitempty"` ResetEmailStatus string `json:"resetEmailStatus,omitempty"` ResetSuccessEmailStatus string `json:"resetSuccessEmailStatus,omitempty"` ResetEmailTemplates *EmailTemplates `json:"resetEmailTemplates,omitempty"` ResetSuccessEmailTemplates *EmailTemplates `json:"resetSuccessEmailTemplates,omitempty"` // contains filtered or unexported fields }
func (*PasswordPolicy) Delete ¶
func (r *PasswordPolicy) Delete() error
Delete deletes the given account, it wont modify the calling account
func (*PasswordPolicy) GetResetEmailTemplates ¶
func (policy *PasswordPolicy) GetResetEmailTemplates() (*EmailTemplates, error)
GetResetEmailTemplates loads the policy ResetEmailTemplates collection and returns it
func (*PasswordPolicy) GetResetSuccessEmailTemplates ¶
func (policy *PasswordPolicy) GetResetSuccessEmailTemplates() (*EmailTemplates, error)
GetResetSuccessEmailTemplates loads the policy ResetSuccessEmailTemplates collection and returns it
func (PasswordPolicy) IsCacheable ¶
func (r PasswordPolicy) IsCacheable() bool
func (*PasswordPolicy) Refresh ¶
func (policy *PasswordPolicy) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*PasswordPolicy) Update ¶
func (policy *PasswordPolicy) Update() error
Update updates the given resource, by doing a POST to the resource Href
type Provider ¶
type Provider struct { OAuthProvider ProviderID string `json:"providerId,omitempty"` // contains filtered or unexported fields }
Provider represents the directory provider (cloud, google, github, facebook or linkedin)
func (*Provider) Delete ¶
func (r *Provider) Delete() error
Delete deletes the given account, it wont modify the calling account
func (Provider) IsCacheable ¶
func (r Provider) IsCacheable() bool
type ProviderData ¶
type ProviderData struct { ProviderID string `json:"providerId"` AccessToken string `json:"accessToken,omitempty"` Code string `json:"code,omitempty"` }
ProviderData represents the especific information needed by the social provider (Google, Github, Faceboo, etc)
type SAMLAssertionTokenClaims ¶
type SAMLAssertionTokenClaims struct { jwt.StandardClaims State string `json:"state,omitempty"` Status string `json:"status,omitempty"` IsNewSub string `json:"isNewSub,omitempty"` IRT string `json:"irt,omitempty"` }
SAMLAssertionTokenClaims are the JWT claims of an Stormpath Assertion type authentication this could originage from an SAML workflow
type SAMLAuthenticationTokenClaims ¶
type SAMLAuthenticationTokenClaims struct { jwt.StandardClaims CallbackURI string `json:"cb_uri,omitempty"` State string `json:"state,omitempty"` ASH string `json:"ash,omitempty"` ONK string `json:"onk,omitempty"` }
SAMLAuthenticationTokenClaims are the JWT claims needed to start a Stormpath SAML workflow
type SSOTokenClaims ¶
type SSOTokenClaims struct { jwt.StandardClaims CallbackURI string `json:"cb_uri,omitempty"` Path string `json:"path,omitempty"` State string `json:"state,omitempty"` OrganizationNameKey string `json:"organizationNameKey,omitempty"` ShowOrganiztaionField bool `json:"showOrganiztaionField,omitempty"` }
SSOTokenClaims are the JWT for initiating an IDSite workflow
type ScopeFactoryFunc ¶
ScopeFactoryFunc defines a function to valide scope for the cient credentials OAuth authentication
type SocialAccount ¶
type SocialAccount struct {
Data ProviderData `json:"providerData"`
}
SocialAccount represents the JSON payload use to create an account for a social backend directory (Google, Facebook, Github, etc)
type StormpathAssertionAuthenticationResult ¶
type StormpathAssertionAuthenticationResult CallbackResult
StormpathAssertionAuthenticationResult is the authentication result for the StormpathAssertionAuthenticator
func (*StormpathAssertionAuthenticationResult) GetAccount ¶
func (ar *StormpathAssertionAuthenticationResult) GetAccount() *Account
type StormpathAssertionAuthenticator ¶
type StormpathAssertionAuthenticator Authenticator
StormpathAssertionAuthenticator this authenticator will verify the a JWT from an ID Site or SAML callback. It should verify that:
* The token is not expired * The signature can be verified * The claims body does not contain an err property.
func NewStormpathAssertionAuthenticator ¶
func NewStormpathAssertionAuthenticator(application *Application) StormpathAssertionAuthenticator
func (StormpathAssertionAuthenticator) Authenticate ¶
func (a StormpathAssertionAuthenticator) Authenticate(stormpathJWT string) (*StormpathAssertionAuthenticationResult, error)
type Tenant ¶
type Tenant struct { Name string `json:"name,omitempty"` Key string `json:"key,omitempty"` Accounts *Accounts `json:"accounts,omitempty"` Applications *Applications `json:"applications,omitempty"` Directories *Directories `json:"directories,omitempty"` Groups *Groups `json:"groups,omitempty"` Organizations *Organizations `json:"organizations,omitempty"` // contains filtered or unexported fields }
Tenant
When you sign up for Stormpath, a private data space is created for you. This space is represented as a Tenant resource in the Stormpath REST API. Your Tenant resource can be thought of as your global starting point. You can access everything in your space by accessing your Tenant resource first and then interacting with its other linked resources (Applications, Directories, etc).
func CurrentTenant ¶
CurrentTenant retrieves the Tenant associated with the current API key.
Example ¶
tenant, err := CurrentTenant() if err != nil { log.Panicf("Couldn't get the current tenant %s", err) } fmt.Printf("tenant = %+v\n", tenant)
Output:
func (*Tenant) CreateOrganization ¶
func (tenant *Tenant) CreateOrganization(org *Organization) error
CreateOrganization creates new organization for the given tenant
func (*Tenant) DeleteCustomData ¶
func (r *Tenant) DeleteCustomData() error
DeleteCustomData deletes all the resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
func (*Tenant) GetAccounts ¶
func (tenant *Tenant) GetAccounts(criteria AccountCriteria) (*Accounts, error)
GetAccounts retrieves the collection of all the accounts associated with the Tenant.
The collection can be filtered and/or paginated by passing the desire AccountCriteria value.
func (*Tenant) GetApplications ¶
func (tenant *Tenant) GetApplications(criteria ApplicationCriteria) (*Applications, error)
GetApplications retrieves the collection of all the applications associated with the Tenant.
The collection can be filtered and/or paginated by passing the desire ApplicationCriteria value.
func (*Tenant) GetCustomData ¶
func (r *Tenant) GetCustomData() (CustomData, error)
GetCustomData returns the given resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
func (*Tenant) GetDirectories ¶
func (tenant *Tenant) GetDirectories(criteria DirectoryCriteria) (*Directories, error)
GetDirectories retrieves the collection of all the directories associated with the Tenant.
The collection can be filtered and/or paginated by passing the desire DirectoryCriteria value
func (*Tenant) GetGroups ¶
func (tenant *Tenant) GetGroups(criteria GroupCriteria) (*Groups, error)
GetGroups retrieves the collection of all the groups associated with the Tenant.
The collection can be filtered and/or paginated by passing the desire GroupCriteria value.
func (*Tenant) GetOrganizations ¶
func (tenant *Tenant) GetOrganizations(criteria OrganizationCriteria) (*Organizations, error)
GetOrganizations retrieves the collection of all the organizations associated with the Tenant.
The collection can be filtered and/or paginated by passing the desire OrganizationCriteria value
func (*Tenant) UpdateCustomData ¶
func (r *Tenant) UpdateCustomData(customData CustomData) (CustomData, error)
UpdateCustomData sets or updates the given resource custom data
See: http://docs.stormpath.com/rest/product-guide/#custom-data
Source Files
¶
- account.go
- account_creation_policy.go
- account_criteria.go
- account_store_mapping.go
- account_store_mapping_criteria.go
- api_keys.go
- application.go
- application_criteria.go
- authenticators.go
- cache.go
- config.go
- credentials.go
- criteria.go
- custom_data.go
- directory.go
- directory_criteria.go
- email_template.go
- error.go
- group.go
- group_criteria.go
- group_membership.go
- group_membership_criteria.go
- jwt.go
- local_cache.go
- logger.go
- oauth_policy.go
- oauth_token.go
- organization.go
- organization_criteria.go
- page_request.go
- password_policy.go
- resources.go
- sauthc1.go
- stormpath.go
- tenant.go