stormpath

package module
v0.0.0-...-a458778 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2017 License: Apache-2.0 Imports: 25 Imported by: 4

README


Due to this announcement https://stormpath.com/blog/stormpaths-new-path 
this project is no longer maintain

Go SDK for the Stormpath API

Develop:

Build Status codecov.io

Master:

Build Status codecov.io

Usage

Core

go get github.com/jarias/stormpath-sdk-go

import "github.com/jarias/stormpath-sdk-go"
import "fmt"

//Load the configuration according to the StormPath framework spec
//See: https://github.com/stormpath/stormpath-sdk-spec/blob/master/specifications/config.md
clientConfig, err := stormpath.LoadConfiguration()

if err != nil {
    stormpath.Logger.Panicf("[ERROR] Couldn't load Stormpath client configuration: %s", err)
}

//Init the client with the loaded config and no specific cache,
//note that if the cache is enabled via config the default local cache would be used
stormpath.Init(clientConfig, nil)

//Get the current tenant
tenant, _ := stormpath.CurrentTenant()

//Get the tenat applications
apps, _ := tenant.GetApplications(stormpath.MakeApplicationCriteria().NameEq("test app"))

//Get the first application
app := apps.Items[0]

//Authenticate a user against the app
account, _ := app.AuthenticateAccount("username", "password")

fmt.Println(account)

Web

See web/example/example.go

Features

  • Cache with a sample local in-memory implementation
  • Almost 100% of the Stormpath API implemented
  • Load credentials via properties file or env variables
  • Load client configuration according to Stormpath framework spec
  • Requests are authenticated via Stormpath SAuthc1 algorithm only
  • Web extension according to the Stormpath Spec

Debugging

If you need to trace all requests done to stormpath you can enable debugging in the logs by setting the environment variable STORMPATH_LOG_LEVEL=DEBUG the default level is ERROR.

Contributing

Pull request are more than welcome, please follow this sample workflow, make sure you work out of the develop branch.

  • Fork
  • Clone git clone YOUR_USERNAME/stormpath-sdk-go
  • Checkout develop branch git checkout -t origin/develop
  • Create a feature branch git checkout -b YOUR_FEATURE_OR_BUG_FIX
  • Create a PR to jarias/develop hub pull-request -b jarias/stormpath-sdk-go:develop

Please make sure you add tests ;)

Development requirements:

  • Go 1.7+
  • Testify go get github.com/stretchr/testify/assert
  • An Stormpath account (for integration testing)

Running the test suite

Env variables:

export STORMPATH_API_KEY_ID=XXXX
export STORMPATH_API_KEY_SECRET=XXXX
go test . -cover -covermode=atomic

I'm aiming at 85% test coverage not yet met but thats the goal.

License

Copyright 2014, 2015, 2016 Julio Arias

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Examples

Constants

View Source
const (
	Name        = "name"
	Description = "description"
	Status      = "status"
)
View Source
const (
	Facebook = "facebook"
	Google   = "google"
	GitHub   = "github"
	LinkedIn = "linkedin"
)
View Source
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

View Source
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

View Source
var DefaultPageRequest = PageRequest{25, 0}
View Source
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

func CreateDirectory(dir *Directory) error

CreateDirectory creates a new directory for the given tenant

See: http://docs.stormpath.com/rest/product-guide/#tenant-directories

func GetToken

func GetToken(href string) string

func Init

func Init(clientConfiguration ClientConfiguration, cache Cache)

Init initializes the underlying client that communicates with Stormpath

func InitLog

func InitLog()

func JWT

func JWT(claims jwt.Claims, extraHeaders map[string]interface{}) string

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

func NewPageRequest(limit int, offset int) url.Values

NewPageRequest is a conviniece constructor for a PageRequest

func ParseJWT

func ParseJWT(token string, claims jwt.Claims) *jwt.Token

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) Delete

func (k *APIKey) Delete() error

Delete deletes a given APIKey

func (APIKey) IsCacheable

func (r APIKey) IsCacheable() bool

func (*APIKey) Update

func (k *APIKey) Update() error

Update updates the given APIKey against Stormpath

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

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) GetLimit

func (r APIKeys) GetLimit() int

func (APIKeys) GetOffset

func (r APIKeys) GetOffset() int

func (APIKeys) GetSize

func (r APIKeys) GetSize() int

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

func NewAccount(username, password, email, givenName, surname string) *Account

NewAccount returns a pointer to an Account with the minimum data required

func VerifyEmailToken

func VerifyEmailToken(token string) (*Account, error)

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

func (account *Account) CreateAPIKey() (*APIKey, error)

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

func (account *Account) Refresh() error

Refresh refreshes the resource by doing a GET to the resource href endpoint

func (*Account) RemoveFromGroup

func (account *Account) RemoveFromGroup(group *Group) error

RemoveFromGroup removes the given account from the given group by searching the account groupmemberships, and deleting the corresponding one

func (*Account) Update

func (account *Account) Update() error

Update updates the given resource, by doing a POST to the resource Href

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

type AccountPasswordResetToken struct {
	Href    string
	Email   string
	Account Account
}

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) GetLimit

func (r Accounts) GetLimit() int

func (Accounts) GetOffset

func (r Accounts) GetOffset() int

func (Accounts) GetSize

func (r Accounts) GetSize() int

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

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

Pagination

func (ApplicationAccountStoreMappingCriteria) Offset

func (ApplicationAccountStoreMappingCriteria) WithApplication

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 (ApplicationCriteria) NameEq

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

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) GetLimit

func (r Applications) GetLimit() int

func (Applications) GetOffset

func (r Applications) GetOffset() int

func (Applications) GetSize

func (r Applications) GetSize() int

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

type CallbackResult struct {
	Account *Account
	State   string
	IsNew   bool
	Status  string
}

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.

func GetClient

func GetClient() *Client

GetClient returns the configured client

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) GetLimit

func (r Directories) GetLimit() int

func (Directories) GetOffset

func (r Directories) GetOffset() int

func (Directories) GetSize

func (r Directories) GetSize() int

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

func NewDirectory(name string) *Directory

NewDirectory creates a new directory with the given name

func NewFacebookDirectory

func NewFacebookDirectory(name string, clientID string, clientSecret string) *Directory

NewFacebookDirectory creates a new directory with a Facebook backed provider

func NewGithubDirectory

func NewGithubDirectory(name string, clientID string, clientSecret string) *Directory

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

func (dir *Directory) CreateGroup(group *Group) error

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

func (dir *Directory) Refresh() error

Refresh refreshes the resource by doing a GET to the resource href endpoint

func (*Directory) RegisterAccount

func (dir *Directory) RegisterAccount(account *Account) error

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

See: http://docs.stormpath.com/rest/product-guide/#accessing-accounts-with-google-authorization-codes-or-an-access-tokens

func (*Directory) Update

func (dir *Directory) Update() error

Update updates the given resource, by doing a POST to the resource Href

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 (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) GetLimit

func (r EmailTemplates) GetLimit() int

func (EmailTemplates) GetOffset

func (r EmailTemplates) GetOffset() int

func (EmailTemplates) GetSize

func (r EmailTemplates) GetSize() int

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

func (Error) Error

func (e Error) Error() string

func (Error) String

func (e Error) String() string

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 NewGroup

func NewGroup(name string) *Group

NewGroup creates a new Group with the given name

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

func (*Group) Refresh

func (group *Group) Refresh() error

Refresh refreshes the resource by doing a GET to the resource href endpoint

func (*Group) Update

func (group *Group) Update() error

Update updates the given resource, by doing a POST to the resource Href

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 (GroupMembershipCriteria) Offset

func (GroupMembershipCriteria) WithAccount

func (GroupMembershipCriteria) WithGroup

type GroupMemberships

type GroupMemberships struct {
	Items []GroupMembership `json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (GroupMemberships) GetLimit

func (r GroupMemberships) GetLimit() int

func (GroupMemberships) GetOffset

func (r GroupMemberships) GetOffset() int

func (GroupMemberships) GetSize

func (r GroupMemberships) GetSize() int

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) GetLimit

func (r Groups) GetLimit() int

func (Groups) GetOffset

func (r Groups) GetOffset() int

func (Groups) GetSize

func (r Groups) GetSize() int

func (Groups) IsCacheable

func (r Groups) IsCacheable() bool
type Header struct {
	ALG string `json:"alg"`
	KID string `json:"kid"`
	STT string `json:"stt"`
}

Header represents the expanded JWT header

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

type IDSiteOptions struct {
	Logout      bool
	Path        string
	CallbackURL string
	State       string
}

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

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

func (*OAuthPolicy) Update

func (policy *OAuthPolicy) Update() error

Update OAuthPolicy

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

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) Delete

func (t *OAuthToken) Delete() error

Delete deletes the given OAuthToken

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) GetLimit

func (r OAuthTokens) GetLimit() int

func (OAuthTokens) GetOffset

func (r OAuthTokens) GetOffset() int

func (OAuthTokens) GetSize

func (r OAuthTokens) GetSize() int

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

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

See: https://docs.stormpath.com/rest/product-guide/latest/reference.html?organization-account-store-mapping-operations

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 (OrganizationAccountStoreMappingCriteria) Offset

func (OrganizationAccountStoreMappingCriteria) WithOrganization

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 (OrganizationCriteria) NameEq

func (OrganizationCriteria) NameKeyEq

func (c OrganizationCriteria) NameKeyEq(status string) OrganizationCriteria

func (OrganizationCriteria) Offset

func (OrganizationCriteria) StatusEq

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

type Organizations

type Organizations struct {
	Items []Organization `json:"items,omitempty"`
	// contains filtered or unexported fields
}

Organizations represents a paged result or applications

func (Organizations) GetLimit

func (r Organizations) GetLimit() int

func (Organizations) GetOffset

func (r Organizations) GetOffset() int

func (Organizations) GetSize

func (r Organizations) GetSize() int

func (Organizations) IsCacheable

func (r Organizations) IsCacheable() bool

type PageRequest

type PageRequest struct {
	Limit  int
	Offset int
}

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

see: http://docs.stormpath.com/guides/using-id-site/

type ScopeFactoryFunc

type ScopeFactoryFunc func(string) bool

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

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

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

func CurrentTenant() (*Tenant, error)

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

Directories

Path Synopsis
web

Jump to

Keyboard shortcuts

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