Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(req *http.Request, payload []byte, date time.Time, credentials Credentials, ...)
- func Init(credentials Credentials, cache Cache)
- func InitWithCustomHTTPClient(credentials Credentials, cache Cache, httpClient *http.Client)
- func NewPageRequest(limit int, offset int) url.Values
- type Account
- func (account *Account) AddToGroup(group *Group) (*GroupMembership, error)
- func (r *Account) DeleteCustomData() error
- func (r *Account) GetCustomData() (CustomData, error)
- func (account *Account) GetGroupMemberships(criteria Criteria) (*GroupMemberships, error)
- func (account *Account) RemoveFromGroup(group *Group) error
- func (r *Account) UpdateCustomData(customData CustomData) (CustomData, error)
- type AccountCriteria
- func (c AccountCriteria) EmailEq(email string) AccountCriteria
- func (c AccountCriteria) GivenNameEq(givenName string) AccountCriteria
- func (c AccountCriteria) Limit(limit int) Criteria
- func (c AccountCriteria) MiddleNameEq(middleName string) AccountCriteria
- func (c AccountCriteria) Offset(offset int) Criteria
- func (c AccountCriteria) StatusEq(status string) AccountCriteria
- func (c AccountCriteria) SurnameEq(surname string) AccountCriteria
- func (c AccountCriteria) ToQueryString() string
- func (c AccountCriteria) UsernameEq(username string) 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) WithTenant() AccountCriteria
- type AccountPasswordResetToken
- type AccountStoreMapping
- type AccountStoreMappingCriteria
- type AccountStoreMappings
- type Accounts
- type Application
- func (app *Application) AuthenticateAccount(username string, password string) (*Account, error)
- func (app *Application) CreateGroup(group *Group) error
- func (app *Application) CreateIDSiteURL(options map[string]string) (string, error)
- func (app *Application) GetAccountStoreMappings(criteria Criteria) (*AccountStoreMappings, error)
- func (r *Application) GetAccounts(criteria Criteria) (*Accounts, error)
- func (app *Application) GetGroups(criteria Criteria) (*Groups, error)
- func (app *Application) HandleIDSiteCallback(URL string) (*IDSiteCallbackResult, error)
- func (app *Application) Purge() error
- func (app *Application) RegisterAccount(account *Account) error
- func (app *Application) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
- func (app *Application) ResetPassword(token string, newPassword string) (*Account, error)
- func (app *Application) SendPasswordResetEmail(username string) (*AccountPasswordResetToken, error)
- func (app *Application) ValidatePasswordResetToken(token string) (*AccountPasswordResetToken, error)
- type ApplicationCriteria
- func (c ApplicationCriteria) DescriptionEq(description string) ApplicationCriteria
- func (c ApplicationCriteria) Limit(limit int) Criteria
- func (c ApplicationCriteria) NameEq(name string) ApplicationCriteria
- func (c ApplicationCriteria) Offset(offset int) Criteria
- func (c ApplicationCriteria) StatusEq(status string) ApplicationCriteria
- func (c ApplicationCriteria) ToQueryString() string
- 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) WithTenant() ApplicationCriteria
- type Applications
- type Cache
- type Cacheable
- type Client
- type Credentials
- type Criteria
- type CustomData
- type Directories
- type Directory
- func (dir *Directory) CreateGroup(group *Group) error
- func (r *Directory) GetAccounts(criteria Criteria) (*Accounts, error)
- func (dir *Directory) GetGroups(criteria Criteria) (*Groups, error)
- func (dir *Directory) RegisterAccount(account *Account) error
- func (dir *Directory) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
- type DirectoryCriteria
- func (c DirectoryCriteria) DescriptionEq(description string) DirectoryCriteria
- func (c DirectoryCriteria) Limit(limit int) Criteria
- func (c DirectoryCriteria) NameEq(name string) DirectoryCriteria
- func (c DirectoryCriteria) Offset(offset int) Criteria
- func (c DirectoryCriteria) StatusEq(status string) DirectoryCriteria
- func (c DirectoryCriteria) ToQueryString() string
- func (c DirectoryCriteria) WithAccounts(pageRequest PageRequest) DirectoryCriteria
- func (c DirectoryCriteria) WithCustomData() DirectoryCriteria
- func (c DirectoryCriteria) WithGroups(pageRequest PageRequest) DirectoryCriteria
- func (c DirectoryCriteria) WithTenant() DirectoryCriteria
- type Error
- type Group
- type GroupCriteria
- func (c GroupCriteria) DescriptionEq(description string) GroupCriteria
- func (c GroupCriteria) Limit(limit int) Criteria
- func (c GroupCriteria) NameEq(name string) GroupCriteria
- func (c GroupCriteria) Offset(offset int) Criteria
- func (c GroupCriteria) StatusEq(status string) GroupCriteria
- func (c GroupCriteria) ToQueryString() string
- func (c GroupCriteria) WithAccounts(pageRequest PageRequest) GroupCriteria
- func (c GroupCriteria) WithCustomData() GroupCriteria
- func (c GroupCriteria) WithDirectory() GroupCriteria
- func (c GroupCriteria) WithTenant() GroupCriteria
- type GroupMembership
- func (r *GroupMembership) Delete() error
- func (groupmembership *GroupMembership) GetAccount(criteria Criteria) (*Account, error)
- func (groupmembership *GroupMembership) GetGroup(criteria Criteria) (*Group, error)
- func (r GroupMembership) IsCacheable() bool
- func (r *GroupMembership) Refresh() error
- func (r *GroupMembership) Save() error
- type GroupMembershipCriteria
- func (c GroupMembershipCriteria) Limit(limit int) Criteria
- func (c GroupMembershipCriteria) Offset(offset int) Criteria
- func (c GroupMembershipCriteria) ToQueryString() string
- func (c GroupMembershipCriteria) WithAccount() GroupMembershipCriteria
- func (c GroupMembershipCriteria) WithGroup() GroupMembershipCriteria
- type GroupMemberships
- type Groups
- type IDSiteCallbackResult
- type PageRequest
- type ProviderData
- type RedisCache
- type SocialAccount
- type Tenant
- func (tenant *Tenant) CreateApplication(app *Application) error
- func (tenant *Tenant) CreateDirectory(dir *Directory) error
- func (r *Tenant) DeleteCustomData() error
- func (tenant *Tenant) GetApplications(criteria Criteria) (*Applications, error)
- func (r *Tenant) GetCustomData() (CustomData, error)
- func (tenant *Tenant) GetDirectories(criteria Criteria) (*Directories, error)
- func (r *Tenant) UpdateCustomData(customData CustomData) (CustomData, error)
Constants ¶
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" )
SAuthc1 algorithm constants
Variables ¶
var BaseURL = "https://api.stormpath.com/v1/"
BaseURL defines the Stormpath API base URL
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, credentials Credentials, nonce string)
Authenticate generates the proper authentication header for the SAuthc1 algorithm use by Stormpath
func Init ¶
func Init(credentials Credentials, cache Cache)
Init initializes the underlying client that communicates with Stormpath
func InitWithCustomHTTPClient ¶
func InitWithCustomHTTPClient(credentials Credentials, cache Cache, httpClient *http.Client)
InitWithCustomHTTPClient initializes the underlying client that communicates with Stormpath with a custom http.Client
Types ¶
type Account ¶
type Account struct { Username string `json:"username"` Email string `json:"email"` Password string `json:"password"` FullName string `json:"fullName,omitempty"` GivenName string `json:"givenName"` MiddleName string `json:"middleName,omitempty"` Surname string `json:"surname"` 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,omitempty"` // contains filtered or unexported fields }
Account represents an Stormpath account object
See: http://docs.stormpath.com/rest/product-guide/#accounts
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) 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) 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 Criteria) (*GroupMemberships, error)
GetGroupMemberships returns a paged result of the group memeberships of the given account
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 AccountCriteria ¶
type AccountCriteria struct {
// contains filtered or unexported fields
}
func MakeAccountCriteria ¶
func MakeAccountCriteria() AccountCriteria
func MakeAccountsCriteria ¶
func MakeAccountsCriteria() AccountCriteria
func (AccountCriteria) EmailEq ¶
func (c AccountCriteria) EmailEq(email string) AccountCriteria
func (AccountCriteria) GivenNameEq ¶
func (c AccountCriteria) GivenNameEq(givenName string) AccountCriteria
func (AccountCriteria) MiddleNameEq ¶
func (c AccountCriteria) MiddleNameEq(middleName string) AccountCriteria
func (AccountCriteria) StatusEq ¶
func (c AccountCriteria) StatusEq(status string) AccountCriteria
func (AccountCriteria) SurnameEq ¶
func (c AccountCriteria) SurnameEq(surname string) AccountCriteria
func (AccountCriteria) ToQueryString ¶
func (c AccountCriteria) ToQueryString() string
func (AccountCriteria) UsernameEq ¶
func (c AccountCriteria) UsernameEq(username string) AccountCriteria
func (AccountCriteria) WithCustomData ¶
func (c AccountCriteria) WithCustomData() AccountCriteria
func (AccountCriteria) WithDirectory ¶
func (c AccountCriteria) WithDirectory() AccountCriteria
func (AccountCriteria) WithGroupMemberships ¶
func (c AccountCriteria) WithGroupMemberships(pageRequest PageRequest) AccountCriteria
func (AccountCriteria) WithGroups ¶
func (c AccountCriteria) WithGroups(pageRequest PageRequest) AccountCriteria
func (AccountCriteria) WithTenant ¶
func (c AccountCriteria) WithTenant() 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 AccountStoreMapping ¶
type AccountStoreMapping struct { ListIndex *int `json:"collectionResourceIndex,omitempty"` IsDefaultAccountStore *bool `json:"isDefaultAccountStore,omitempty"` IsDefaultGroupStore *bool `json:"isDefaultGroupStore,omitempty"` Application Application `json:"application"` AccountStore resource `json:"accountStore"` CreatedAt time.Time `json:"createdAt,omitempty"` ModifiedAt time.Time `json:"modifiedAt,omitempty"` // contains filtered or unexported fields }
AccountStoreMapping represents an Stormpath account store mapping
See: http://docs.stormpath.com/rest/product-guide/#account-store-mappings
func NewAccountStoreMapping ¶
func NewAccountStoreMapping(applicationHref string, accountStoreHref string) *AccountStoreMapping
NewAccountStoreMapping creates a new account store mappings
func (*AccountStoreMapping) Delete ¶
func (r *AccountStoreMapping) Delete() error
Delete deletes the given account, it wont modify the calling account
func (AccountStoreMapping) IsCacheable ¶
func (r AccountStoreMapping) IsCacheable() bool
func (*AccountStoreMapping) Refresh ¶
func (r *AccountStoreMapping) Refresh() error
Refresh refreshes the resource by doing a GET to the resource href endpoint
func (*AccountStoreMapping) Save ¶
func (mapping *AccountStoreMapping) Save() error
Save saves the given account store mapping
type AccountStoreMappingCriteria ¶
type AccountStoreMappingCriteria struct {
// contains filtered or unexported fields
}
func MakeAccountStoreMappingCriteria ¶
func MakeAccountStoreMappingCriteria() AccountStoreMappingCriteria
func MakeAccountStoreMappingsCriteria ¶
func MakeAccountStoreMappingsCriteria() AccountStoreMappingCriteria
func (AccountStoreMappingCriteria) ToQueryString ¶
func (c AccountStoreMappingCriteria) ToQueryString() string
func (AccountStoreMappingCriteria) WithApplication ¶
func (c AccountStoreMappingCriteria) WithApplication() AccountStoreMappingCriteria
type AccountStoreMappings ¶
type AccountStoreMappings struct { Items []AccountStoreMapping `json:"items"` // contains filtered or unexported fields }
AccountStoreMappings represents a pages result of account store mappings
See: http://docs.stormpath.com/rest/product-guide/#collectionResource-account-store-mappings
func (AccountStoreMappings) IsCacheable ¶
func (r AccountStoreMappings) IsCacheable() bool
type Accounts ¶
type Accounts struct { Items []Account `json:"items"` // 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 *AccountStoreMappings `json:"accountStoreMappings,omitempty"` DefaultAccountStoreMapping *AccountStoreMapping `json:"defaultAccountStoreMapping,omitempty"` DefaultGroupStoreMapping *AccountStoreMapping `json:"defaultGroupStoreMapping,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` ModifiedAt time.Time `json:"modifiedAt,omitempty"` // contains filtered or unexported fields }
Application represents a Stormpath application object
See: http://docs.stormpath.com/rest/product-guide/#applications
func GetApplication ¶
func GetApplication(href string, criteria Criteria) (*Application, error)
func NewApplication ¶
func NewApplication(name string) *Application
NewApplication creates a new application
func (*Application) AuthenticateAccount ¶
func (app *Application) AuthenticateAccount(username string, password string) (*Account, error)
AuthenticateAccount authenticates an account against the application
See: http://docs.stormpath.com/rest/product-guide/#authenticate-an-account
func (*Application) CreateGroup ¶
func (app *Application) CreateGroup(group *Group) error
CreateGroup creates a new group in the application
See: http://docs.stormpath.com/rest/product-guide/#application-groups
func (*Application) CreateIDSiteURL ¶
func (app *Application) CreateIDSiteURL(options map[string]string) (string, error)
CreateIDSiteURL creates the IDSite URL for the application
func (*Application) GetAccountStoreMappings ¶
func (app *Application) GetAccountStoreMappings(criteria Criteria) (*AccountStoreMappings, error)
GetAccountStoreMappings returns all the applications account store mappings
See: http://docs.stormpath.com/rest/product-guide/#application-account-store-mappings
func (*Application) GetAccounts ¶
GetAccounts returns all the accounts of the application
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Application) GetGroups ¶
func (app *Application) GetGroups(criteria Criteria) (*Groups, error)
GetGroups returns all the application groups
See: http://docs.stormpath.com/rest/product-guide/#application-groups
func (*Application) HandleIDSiteCallback ¶
func (app *Application) HandleIDSiteCallback(URL string) (*IDSiteCallbackResult, error)
HandleIDSiteCallback handles the URL from an ID Site callback it parses the JWT token validates it and return an IDSiteCallbackResult with the token info + the Account if the sub was given
func (*Application) Purge ¶
func (app *Application) Purge() error
Purge deletes all the account stores before deleting the application
See: http://docs.stormpath.com/rest/product-guide/#delete-an-application
func (*Application) RegisterAccount ¶
func (app *Application) RegisterAccount(account *Account) error
RegisterAccount registers a new account into the application
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Application) RegisterSocialAccount ¶
func (app *Application) RegisterSocialAccount(socialAccount *SocialAccount) (*Account, error)
RegisterSocialAccount registers a new account into the application using an external provider Google, Facebook
func (*Application) ResetPassword ¶
func (app *Application) ResetPassword(token string, newPassword string) (*Account, error)
ResetPassword resets a user password based on the reset token
See: http://docs.stormpath.com/rest/product-guide/#reset-an-accounts-password
func (*Application) SendPasswordResetEmail ¶
func (app *Application) SendPasswordResetEmail(username string) (*AccountPasswordResetToken, error)
SendPasswordResetEmail sends a password reset email to the given user
See: http://docs.stormpath.com/rest/product-guide/#reset-an-accounts-password
func (*Application) ValidatePasswordResetToken ¶
func (app *Application) ValidatePasswordResetToken(token string) (*AccountPasswordResetToken, error)
ValidatePasswordResetToken validates a password reset token
See: http://docs.stormpath.com/rest/product-guide/#reset-an-accounts-password
type ApplicationCriteria ¶
type ApplicationCriteria struct {
// contains filtered or unexported fields
}
func MakeApplicationCriteria ¶
func MakeApplicationCriteria() ApplicationCriteria
func MakeApplicationsCriteria ¶
func MakeApplicationsCriteria() ApplicationCriteria
func (ApplicationCriteria) DescriptionEq ¶
func (c ApplicationCriteria) DescriptionEq(description string) ApplicationCriteria
func (ApplicationCriteria) NameEq ¶
func (c ApplicationCriteria) NameEq(name string) ApplicationCriteria
func (ApplicationCriteria) StatusEq ¶
func (c ApplicationCriteria) StatusEq(status string) ApplicationCriteria
func (ApplicationCriteria) ToQueryString ¶
func (c ApplicationCriteria) ToQueryString() string
func (ApplicationCriteria) WithAccountStoreMappings ¶
func (c ApplicationCriteria) WithAccountStoreMappings(pageRequest PageRequest) ApplicationCriteria
func (ApplicationCriteria) WithAccounts ¶
func (c ApplicationCriteria) WithAccounts(pageRequest PageRequest) ApplicationCriteria
func (ApplicationCriteria) WithCustomData ¶
func (c ApplicationCriteria) WithCustomData() ApplicationCriteria
func (ApplicationCriteria) WithDefaultAccountStoreMapping ¶
func (c ApplicationCriteria) WithDefaultAccountStoreMapping() ApplicationCriteria
func (ApplicationCriteria) WithDefaultGroupStoreMapping ¶
func (c ApplicationCriteria) WithDefaultGroupStoreMapping() ApplicationCriteria
func (ApplicationCriteria) WithGroups ¶
func (c ApplicationCriteria) WithGroups(pageRequest PageRequest) ApplicationCriteria
func (ApplicationCriteria) WithTenant ¶
func (c ApplicationCriteria) WithTenant() ApplicationCriteria
type Applications ¶
type Applications struct { Items []Application `json:"items"` // contains filtered or unexported fields }
Applications represents a paged result or applications
func (Applications) IsCacheable ¶
func (r Applications) IsCacheable() bool
type Cache ¶
type Cache interface { Exists(key string) bool Set(key string, data interface{}) Get(key string, result interface{}) error 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 Client ¶
type Client struct { Credentials Credentials HTTPClient *http.Client Cache Cache }
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 Credentials ¶
Credentials represents a set of Stormpath credentials
func NewCredentialsFromFile ¶
func NewCredentialsFromFile(file string) (Credentials, error)
NewCredentialsFromFile creates a new credentials from a Stormpath key files
func NewDefaultCredentials ¶
func NewDefaultCredentials() (Credentials, error)
NewDefaultCredentials would create a new credentials based on env variables first then the default file location at ~/.config/stormpath/apiKey.properties
type CustomData ¶
type CustomData map[string]interface{}
CustomData represents Stormpath's custom data resouce
type Directories ¶
type Directories struct { Items []Directory `json:"items"` // 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"` CreatedAt time.Time `json:"createdAt,omitempty"` ModifiedAt time.Time `json:"modifiedAt,omitempty"` // contains filtered or unexported fields }
Directory represents a Stormpath directory object
See: http://docs.stormpath.com/rest/product-guide/#directories
func NewDirectory ¶
NewDirectory creates a new directory with the given name
func (*Directory) CreateGroup ¶
CreateGroup creates a new group in the directory
func (*Directory) GetAccounts ¶
GetAccounts returns all the accounts of the application
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
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) NameEq ¶
func (c DirectoryCriteria) NameEq(name string) DirectoryCriteria
func (DirectoryCriteria) StatusEq ¶
func (c DirectoryCriteria) StatusEq(status string) DirectoryCriteria
func (DirectoryCriteria) ToQueryString ¶
func (c DirectoryCriteria) ToQueryString() string
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) WithTenant ¶
func (c DirectoryCriteria) WithTenant() DirectoryCriteria
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"` CreatedAt time.Time `json:"createdAt,omitempty"` ModifiedAt time.Time `json:"modifiedAt,omitempty"` // contains filtered or unexported fields }
Group represents a Stormpath Group
See: http://docs.stormpath.com/rest/product-guide/#groups
func (*Group) GetAccounts ¶
GetAccounts returns all the accounts of the application
See: http://docs.stormpath.com/rest/product-guide/#application-accounts
func (*Group) GetGroupMemberships ¶
func (group *Group) GetGroupMemberships(criteria Criteria) (*GroupMemberships, error)
type GroupCriteria ¶
type GroupCriteria struct {
// contains filtered or unexported fields
}
func MakeGroupCriteria ¶
func MakeGroupCriteria() GroupCriteria
func MakeGroupMemershipsCriteria ¶
func MakeGroupMemershipsCriteria() GroupCriteria
func MakeGroupsCriteria ¶
func MakeGroupsCriteria() GroupCriteria
func (GroupCriteria) DescriptionEq ¶
func (c GroupCriteria) DescriptionEq(description string) GroupCriteria
func (GroupCriteria) NameEq ¶
func (c GroupCriteria) NameEq(name string) GroupCriteria
func (GroupCriteria) StatusEq ¶
func (c GroupCriteria) StatusEq(status string) GroupCriteria
func (GroupCriteria) ToQueryString ¶
func (c GroupCriteria) ToQueryString() string
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"` CreatedAt time.Time `json:"createdAt,omitempty"` ModifiedAt time.Time `json:"modifiedAt,omitempty"` // 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 Criteria) (*Account, error)
func (*GroupMembership) GetGroup ¶
func (groupmembership *GroupMembership) GetGroup(criteria Criteria) (*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 (GroupMembershipCriteria) ToQueryString ¶
func (c GroupMembershipCriteria) ToQueryString() string
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"` // contains filtered or unexported fields }
func (GroupMemberships) IsCacheable ¶
func (r GroupMemberships) IsCacheable() bool
type Groups ¶
type Groups struct { Items []Group `json:"items"` // contains filtered or unexported fields }
Groups represent a paged result of groups
func (Groups) IsCacheable ¶
func (r Groups) IsCacheable() bool
type IDSiteCallbackResult ¶
IDSiteCallbackResult holds the ID Site callback parsed JWT token information + the acccount if one was given
type PageRequest ¶
PageRequest contains the limit and offset values for any paginated Stormpath request
type ProviderData ¶
type ProviderData struct { ProviderID string `json:"providerId"` AccessToken string `json:"accessToken,omitempty"` }
ProviderData represents the especific information needed by the social provider (Google, Github, Faceboo, etc)
type RedisCache ¶
RedisCache is the default provided implementation of the Cache interface using Redis as backend
func (RedisCache) Exists ¶
func (r RedisCache) Exists(key string) bool
Exists returns true if the key exists in the cache false otherwise
func (RedisCache) Get ¶
func (r RedisCache) Get(key string, result interface{}) error
Get returns the data store under key it should return an error if any occur
func (RedisCache) Set ¶
func (r RedisCache) Set(key string, data interface{})
Set stores data in the the cache for the given key
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 Tenant ¶
type Tenant struct { Name string `json:"name"` Key string `json:"key"` Applications Applications `json:"applications"` Directories Directories `json:"directories"` CreatedAt time.Time `json:"createdAt,omitempty"` ModifiedAt time.Time `json:"modifiedAt,omitempty"` // contains filtered or unexported fields }
Tenant represents a Stormpath tennat see http://docs.stormpath.com/rest/product-guide/#tenants
func CurrentTenant ¶
CurrentTenant returns the current tenant see http://docs.stormpath.com/rest/product-guide/#retrieve-the-current-tenant
func (*Tenant) CreateApplication ¶
func (tenant *Tenant) CreateApplication(app *Application) error
CreateApplication creates a new application for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-applications
func (*Tenant) CreateDirectory ¶
CreateDirectory creates a new directory for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-directories
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) GetApplications ¶
func (tenant *Tenant) GetApplications(criteria Criteria) (*Applications, error)
GetApplications returns all the applications for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-applications
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 Criteria) (*Directories, error)
GetDirectories returns all the directories for the given tenant
See: http://docs.stormpath.com/rest/product-guide/#tenant-directories
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_criteria.go
- account_store_mapping.go
- account_store_mapping_criteria.go
- application.go
- application_criteria.go
- cache.go
- credentials.go
- criteria.go
- custom_data.go
- directory.go
- directory_criteria.go
- error.go
- group.go
- group_criteria.go
- group_membership.go
- group_membership_criteria.go
- logger.go
- page_request.go
- redis_cache.go
- resources.go
- sauthc1.go
- stormpath.go
- tenant.go