Documentation
¶
Overview ¶
Package auth0 is a generated GoMock package.
Index ¶
- Variables
- func Error(e error, message string) error
- type API
- type ActionAPI
- type AnomalyAPI
- type AttackProtectionAPI
- type BrandingAPI
- type ClientAPI
- type ClientGrantAPI
- type ConnectionAPI
- type CustomDomainAPI
- type EmailTemplateAPI
- type HTTPClientAPI
- type JobsAPI
- type LogAPI
- type LogStreamAPI
- type MockActionAPI
- func (m *MockActionAPI) Create(a *management.Action, opts ...management.RequestOption) error
- func (m *MockActionAPI) Delete(id string, opts ...management.RequestOption) error
- func (m *MockActionAPI) Deploy(id string, opts ...management.RequestOption) (*management.ActionVersion, error)
- func (m *MockActionAPI) EXPECT() *MockActionAPIMockRecorder
- func (m *MockActionAPI) List(opts ...management.RequestOption) (*management.ActionList, error)
- func (m *MockActionAPI) Read(id string, opts ...management.RequestOption) (*management.Action, error)
- func (m *MockActionAPI) Triggers(opts ...management.RequestOption) (*management.ActionTriggerList, error)
- func (m *MockActionAPI) Update(id string, a *management.Action, opts ...management.RequestOption) error
- type MockActionAPIMockRecorder
- func (mr *MockActionAPIMockRecorder) Create(a interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockActionAPIMockRecorder) Delete(id interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockActionAPIMockRecorder) Deploy(id interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockActionAPIMockRecorder) List(opts ...interface{}) *gomock.Call
- func (mr *MockActionAPIMockRecorder) Read(id interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockActionAPIMockRecorder) Triggers(opts ...interface{}) *gomock.Call
- func (mr *MockActionAPIMockRecorder) Update(id, a interface{}, opts ...interface{}) *gomock.Call
- type OrganizationAPI
- type PromptAPI
- type Quickstart
- type Quickstarts
- type ResourceServerAPI
- type RoleAPI
- type RuleAPI
- type TenantAPI
- type UserAPI
Constants ¶
This section is empty.
Variables ¶
var ( Bool = auth0.Bool BoolValue = auth0.BoolValue String = auth0.String StringValue = auth0.StringValue Int = auth0.Int IntValue = auth0.IntValue Float64 = auth0.Float64 Float64Value = auth0.Float64Value Time = auth0.Time TimeValue = auth0.TimeValue )
Alias all the helper methods so we can keep just typing `auth0.Bool` and the compiler can autocomplete our internal package.
Functions ¶
Types ¶
type API ¶
type API struct {
Action ActionAPI
Anomaly AnomalyAPI
AttackProtection AttackProtectionAPI
Branding BrandingAPI
Client ClientAPI
ClientGrant ClientGrantAPI
Connection ConnectionAPI
CustomDomain CustomDomainAPI
EmailTemplate EmailTemplateAPI
Log LogAPI
LogStream LogStreamAPI
Organization OrganizationAPI
Prompt PromptAPI
ResourceServer ResourceServerAPI
Role RoleAPI
Rule RuleAPI
Tenant TenantAPI
User UserAPI
Jobs JobsAPI
HTTPClient HTTPClientAPI
}
API mimics `management.Management`s general interface, except it refers to the interfaces instead of the concrete structs.
func NewAPI ¶
func NewAPI(m *management.Management) *API
type ActionAPI ¶
type ActionAPI interface {
// Create a new action.
//
// See: https://auth0.com/docs/api/management/v2#!/Actions/post_action
Create(a *management.Action, opts ...management.RequestOption) error
// Read action details.
//
// See: https://auth0.com/docs/api/management/v2#!/Actions/get_action
Read(id string, opts ...management.RequestOption) (*management.Action, error)
// Update an existing action.
//
// See: https://auth0.com/docs/api/management/v2#!/Actions/patch_action
Update(id string, a *management.Action, opts ...management.RequestOption) error
// Delete an action
//
// See: https://auth0.com/docs/api/management/v2#!/Actions/delete_action
Delete(id string, opts ...management.RequestOption) error
// List all actions.
//
// See: https://auth0.com/docs/api/management/v2#!/Actions/get_actions
List(opts ...management.RequestOption) (c *management.ActionList, err error)
// Triggers available.
//
// https://auth0.com/docs/api/management/v2/#!/Actions/get_triggers
Triggers(opts ...management.RequestOption) (l *management.ActionTriggerList, err error)
// Deploy an action.
//
// See: https://auth0.com/docs/api/management/v2/#!/Actions/post_deploy_action
Deploy(id string, opts ...management.RequestOption) (v *management.ActionVersion, err error)
}
type AnomalyAPI ¶ added in v0.7.0
type AnomalyAPI interface {
// Check if a given IP address is blocked via the multiple user accounts
// trigger due to multiple failed logins.
//
// See: https://auth0.com/docs/api/management/v2#!/Anomaly/get_ips_by_id
CheckIP(ip string, opts ...management.RequestOption) (isBlocked bool, err error)
// Unblock an IP address currently blocked by the multiple user accounts
// trigger due to multiple failed logins.
//
// See: https://auth0.com/docs/api/management/v2#!/Anomaly/delete_ips_by_id
UnblockIP(ip string, opts ...management.RequestOption) (err error)
}
type AttackProtectionAPI ¶ added in v0.11.7
type AttackProtectionAPI interface {
// GetBreachedPasswordDetection retrieves breached password detection settings.
//
// Required scope: `read:attack_protection`
//
// See: https://auth0.com/docs/api/management/v2#!/Attack_Protection/get_breached_password_detection
GetBreachedPasswordDetection(
opts ...management.RequestOption,
) (bpd *management.BreachedPasswordDetection, err error)
// UpdateBreachedPasswordDetection updates the breached password detection settings.
//
// Required scope: `update:attack_protection`
//
// See: https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_breached_password_detection
UpdateBreachedPasswordDetection(
bpd *management.BreachedPasswordDetection,
opts ...management.RequestOption,
) (err error)
// GetBruteForceProtection retrieves the brute force configuration.
//
// Required scope: `read:attack_protection`
//
// See: https://auth0.com/docs/api/management/v2#!/Attack_Protection/get_brute_force_protection
GetBruteForceProtection(
opts ...management.RequestOption,
) (bfp *management.BruteForceProtection, err error)
// UpdateBruteForceProtection updates the brute force configuration.
//
// Required scope: `update:attack_protection`
//
// See: https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_brute_force_protection
UpdateBruteForceProtection(
bfp *management.BruteForceProtection,
opts ...management.RequestOption,
) (err error)
// GetSuspiciousIPThrottling retrieves the suspicious IP throttling configuration.
//
// Required scope: `read:attack_protection`
//
// See: https://auth0.com/docs/api/management/v2#!/Attack_Protection/get_suspicious_ip_throttling
GetSuspiciousIPThrottling(
opts ...management.RequestOption,
) (sit *management.SuspiciousIPThrottling, err error)
// UpdateSuspiciousIPThrottling updates the suspicious IP throttling configuration.
//
// Required scope: `update:attack_protection`
//
// See: https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_suspicious_ip_throttling
UpdateSuspiciousIPThrottling(
sit *management.SuspiciousIPThrottling,
opts ...management.RequestOption,
) (err error)
}
type BrandingAPI ¶ added in v0.6.0
type BrandingAPI interface {
Read(opts ...management.RequestOption) (b *management.Branding, err error)
Update(t *management.Branding, opts ...management.RequestOption) (err error)
UniversalLogin(opts ...management.RequestOption) (ul *management.BrandingUniversalLogin, err error)
SetUniversalLogin(ul *management.BrandingUniversalLogin, opts ...management.RequestOption) (err error)
DeleteUniversalLogin(opts ...management.RequestOption) (err error)
}
type ClientAPI ¶
type ClientAPI interface {
// Create a new client application.
Create(c *management.Client, opts ...management.RequestOption) (err error)
// Read a client by its id.
Read(id string, opts ...management.RequestOption) (c *management.Client, err error)
// List all client applications.
List(opts ...management.RequestOption) (c *management.ClientList, err error)
// Update a client.
Update(id string, c *management.Client, opts ...management.RequestOption) (err error)
// RotateSecret rotates a client secret.
RotateSecret(id string, opts ...management.RequestOption) (c *management.Client, err error)
// Delete a client and all its related assets (like rules, connections, etc)
// given its id.
Delete(id string, opts ...management.RequestOption) error
}
type ClientGrantAPI ¶ added in v1.0.0
type ClientGrantAPI interface {
// List all client grants.
List(opts ...management.RequestOption) (*management.ClientGrantList, error)
}
type ConnectionAPI ¶ added in v0.7.0
type ConnectionAPI interface {
// Create a new connection.
Create(c *management.Connection, opts ...management.RequestOption) (err error)
// Read retrieves a connection by its id.
Read(id string, opts ...management.RequestOption) (c *management.Connection, err error)
// ReadByName retrieves a connection by its name.
ReadByName(id string, opts ...management.RequestOption) (c *management.Connection, err error)
// Update a connection.
Update(id string, c *management.Connection, opts ...management.RequestOption) (err error)
// Delete a connection.
Delete(id string, opts ...management.RequestOption) (err error)
// List all connections.
List(opts ...management.RequestOption) (ul *management.ConnectionList, err error)
}
type CustomDomainAPI ¶ added in v0.6.0
type CustomDomainAPI interface {
// Create a new custom domain.
Create(c *management.CustomDomain, opts ...management.RequestOption) (err error)
// Read retrieves a custom domain by its id.
Read(id string, opts ...management.RequestOption) (c *management.CustomDomain, err error)
// Update a custom domain.
Update(id string, c *management.CustomDomain, opts ...management.RequestOption) (err error)
// Delete a custom domain.
Delete(id string, opts ...management.RequestOption) (err error)
// Verify a custom domain.
Verify(id string, opts ...management.RequestOption) (c *management.CustomDomain, err error)
// List all custom domains.
List(opts ...management.RequestOption) (c []*management.CustomDomain, err error)
}
type EmailTemplateAPI ¶ added in v0.9.1
type EmailTemplateAPI interface {
// Create an email template.
//
// See: https://auth0.com/docs/api/management/v2#!/Email_Templates/post_email_templates
Create(template *management.EmailTemplate, opts ...management.RequestOption) error
// Read an email template by pre-defined name.
//
// These names are `verify_email`, `reset_email`, `welcome_email`,
// `blocked_account`, `stolen_credentials`, `enrollment_email`, and
// `mfa_oob_code`.
//
// The names `change_password`, and `password_reset` are also supported for
// legacy scenarios.
//
// See: https://auth0.com/docs/api/management/v2#!/Email_Templates/get_email_templates_by_templateName
Read(template string, opts ...management.RequestOption) (e *management.EmailTemplate, err error)
// Update an email template.
//
// See: https://auth0.com/docs/api/management/v2#!/Email_Templates/patch_email_templates_by_templateName
Update(template string, e *management.EmailTemplate, opts ...management.RequestOption) (err error)
}
type HTTPClientAPI ¶ added in v1.0.0
type HTTPClientAPI interface {
// NewRequest returns a new HTTP request.
// If the payload is not nil it will be encoded as JSON.
NewRequest(method, uri string, payload interface{}, options ...management.RequestOption) (*http.Request, error)
// Do triggers an HTTP request and returns an HTTP response,
// handling any context cancellations or timeouts.
Do(req *http.Request) (*http.Response, error)
}
type JobsAPI ¶ added in v0.11.6
type JobsAPI interface {
VerifyEmail(j *management.Job, opts ...management.RequestOption) (err error)
Read(id string, opts ...management.RequestOption) (j *management.Job, err error)
ExportUsers(j *management.Job, opts ...management.RequestOption) (err error)
ImportUsers(j *management.Job, opts ...management.RequestOption) (err error)
}
type LogAPI ¶
type LogAPI interface {
// Read the data related to the log entry identified by id. This returns a
// single log entry representation as specified in the schema.
Read(id string, opts ...management.RequestOption) (l *management.Log, err error)
// List all log entries that match the specified search criteria (or lists all
// log entries if no criteria are used). Set custom search criteria using the
// `q` parameter, or search from a specific log id ("search from checkpoint").
//
// For more information on all possible event types, their respective acronyms
// and descriptions, Log Data Event Listing.
List(opts ...management.RequestOption) (l []*management.Log, err error)
// Search is an alias for List
Search(opts ...management.RequestOption) ([]*management.Log, error)
}
type LogStreamAPI ¶ added in v0.8.0
type LogStreamAPI interface {
// Create a log stream.
Create(ls *management.LogStream, opts ...management.RequestOption) (err error)
// Read a log stream.
Read(id string, opts ...management.RequestOption) (ls *management.LogStream, err error)
// Update a log stream.
Update(id string, ls *management.LogStream, opts ...management.RequestOption) (err error)
// List all log streams.
List(opts ...management.RequestOption) (ls []*management.LogStream, err error)
// Delete a log stream.
Delete(id string, opts ...management.RequestOption) (err error)
}
type MockActionAPI ¶ added in v0.2.5
type MockActionAPI struct {
// contains filtered or unexported fields
}
MockActionAPI is a mock of ActionAPI interface.
func NewMockActionAPI ¶ added in v0.2.5
func NewMockActionAPI(ctrl *gomock.Controller) *MockActionAPI
NewMockActionAPI creates a new mock instance.
func (*MockActionAPI) Create ¶ added in v0.2.5
func (m *MockActionAPI) Create(a *management.Action, opts ...management.RequestOption) error
Create mocks base method.
func (*MockActionAPI) Delete ¶ added in v0.2.5
func (m *MockActionAPI) Delete(id string, opts ...management.RequestOption) error
Delete mocks base method.
func (*MockActionAPI) Deploy ¶
func (m *MockActionAPI) Deploy(id string, opts ...management.RequestOption) (*management.ActionVersion, error)
Deploy mocks base method.
func (*MockActionAPI) EXPECT ¶ added in v0.2.5
func (m *MockActionAPI) EXPECT() *MockActionAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockActionAPI) List ¶ added in v0.2.5
func (m *MockActionAPI) List(opts ...management.RequestOption) (*management.ActionList, error)
List mocks base method.
func (*MockActionAPI) Read ¶ added in v0.2.5
func (m *MockActionAPI) Read(id string, opts ...management.RequestOption) (*management.Action, error)
Read mocks base method.
func (*MockActionAPI) Triggers ¶
func (m *MockActionAPI) Triggers(opts ...management.RequestOption) (*management.ActionTriggerList, error)
Triggers mocks base method.
func (*MockActionAPI) Update ¶ added in v0.2.5
func (m *MockActionAPI) Update(id string, a *management.Action, opts ...management.RequestOption) error
Update mocks base method.
type MockActionAPIMockRecorder ¶ added in v0.2.5
type MockActionAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockActionAPIMockRecorder is the mock recorder for MockActionAPI.
func (*MockActionAPIMockRecorder) Create ¶ added in v0.2.5
func (mr *MockActionAPIMockRecorder) Create(a interface{}, opts ...interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockActionAPIMockRecorder) Delete ¶ added in v0.2.5
func (mr *MockActionAPIMockRecorder) Delete(id interface{}, opts ...interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockActionAPIMockRecorder) Deploy ¶
func (mr *MockActionAPIMockRecorder) Deploy(id interface{}, opts ...interface{}) *gomock.Call
Deploy indicates an expected call of Deploy.
func (*MockActionAPIMockRecorder) List ¶ added in v0.2.5
func (mr *MockActionAPIMockRecorder) List(opts ...interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockActionAPIMockRecorder) Read ¶ added in v0.2.5
func (mr *MockActionAPIMockRecorder) Read(id interface{}, opts ...interface{}) *gomock.Call
Read indicates an expected call of Read.
func (*MockActionAPIMockRecorder) Triggers ¶
func (mr *MockActionAPIMockRecorder) Triggers(opts ...interface{}) *gomock.Call
Triggers indicates an expected call of Triggers.
func (*MockActionAPIMockRecorder) Update ¶ added in v0.2.5
func (mr *MockActionAPIMockRecorder) Update(id, a interface{}, opts ...interface{}) *gomock.Call
Update indicates an expected call of Update.
type OrganizationAPI ¶ added in v0.10.0
type OrganizationAPI interface {
// Create an Organization.
//
// See: https://auth0.com/docs/api/management/v2/#!/Organizations/post_organizations
Create(o *management.Organization, opts ...management.RequestOption) error
// Read a specific organization.
//
// See: https://auth0.com/docs/api/management/v2/#!/Organizations/get_organizations_by_id
Read(id string, opts ...management.RequestOption) (*management.Organization, error)
// Update an organization.
//
// See: https://auth0.com/docs/api/management/v2/#!/Organizations/patch_organizations_by_id
Update(id string, o *management.Organization, opts ...management.RequestOption) error
// Delete a specific organization.
//
// See: https://auth0.com/docs/api/management/v2/#!/Organizations/delete_organizations_by_id
Delete(id string, opts ...management.RequestOption) error
// List available organizations.
//
// See: https://auth0.com/docs/api/management/v2/#!/Organizations/get_organizations
List(opts ...management.RequestOption) (c *management.OrganizationList, err error)
// Members lists members of an organization.
//
// See: https://auth0.com/docs/api/management/v2#!/Organizations/get_members
Members(id string, opts ...management.RequestOption) (o *management.OrganizationMemberList, err error)
// MemberRoles lists roles assigned to a member of an organization
//
// See: https://auth0.com/docs/api/management/v2#!/Organizations/get_organization_member_roles
MemberRoles(id string, userID string, opts ...management.RequestOption) (r *management.OrganizationMemberRoleList, err error)
}
type PromptAPI ¶ added in v0.11.3
type PromptAPI interface {
// Read retrieves prompts settings.
//
// See: https://auth0.com/docs/api/management/v2#!/Prompts/get_prompts
Read(opts ...management.RequestOption) (p *management.Prompt, err error)
// Update prompts settings.
//
// See: https://auth0.com/docs/api/management/v2#!/Prompts/patch_prompts
Update(p *management.Prompt, opts ...management.RequestOption) error
// CustomText retrieves the custom text for a specific prompt and language.
//
// See: https://auth0.com/docs/api/management/v2#!/Prompts/get_custom_text_by_language
CustomText(p string, l string, opts ...management.RequestOption) (t map[string]interface{}, err error)
// SetCustomText sets the custom text for a specific prompt. Existing texts will be overwritten.
//
// See: https://auth0.com/docs/api/management/v2#!/Prompts/put_custom_text_by_language
SetCustomText(p string, l string, b map[string]interface{}, opts ...management.RequestOption) (err error)
}
type Quickstart ¶ added in v0.5.0
type Quickstart struct {
Name string `json:"name"`
AppType string `json:"appType"`
URL string `json:"url"`
Logo string `json:"logo"`
DownloadLink string `json:"downloadLink"`
DownloadInstructions string `json:"downloadInstructions"`
}
func (Quickstart) Download ¶ added in v1.0.0
func (q Quickstart) Download(ctx context.Context, downloadPath string, client *management.Client) error
func (Quickstart) SamplePath ¶ added in v1.0.0
func (q Quickstart) SamplePath(downloadPath string) (string, error)
type Quickstarts ¶ added in v1.0.0
type Quickstarts []Quickstart
func GetQuickstarts ¶ added in v1.0.0
func GetQuickstarts(ctx context.Context) (Quickstarts, error)
func (Quickstarts) FilterByType ¶ added in v1.0.0
func (q Quickstarts) FilterByType(qsType string) (Quickstarts, error)
func (Quickstarts) FindByStack ¶ added in v1.0.0
func (q Quickstarts) FindByStack(stack string) (Quickstart, error)
func (Quickstarts) Stacks ¶ added in v1.0.0
func (q Quickstarts) Stacks() []string
type ResourceServerAPI ¶
type ResourceServerAPI interface {
// Create a resource server.
Create(rs *management.ResourceServer, opts ...management.RequestOption) (err error)
// Read retrieves a resource server by its id or audience.
Read(id string, opts ...management.RequestOption) (rs *management.ResourceServer, err error)
// Update a resource server.
Update(id string, rs *management.ResourceServer, opts ...management.RequestOption) (err error)
// Delete a resource server.
Delete(id string, opts ...management.RequestOption) (err error)
// List all resource server.
List(opts ...management.RequestOption) (rl *management.ResourceServerList, err error)
// Stream is a helper method which handles pagination
Stream(fn func(s *management.ResourceServer), opts ...management.RequestOption) error
}
type RoleAPI ¶ added in v0.7.0
type RoleAPI interface {
// Create a new role.
Create(r *management.Role, opts ...management.RequestOption) (err error)
// Retrieve a role.
Read(id string, opts ...management.RequestOption) (r *management.Role, err error)
// List all roles that can be assigned to users or groups.
List(opts ...management.RequestOption) (r *management.RoleList, err error)
// Update a role.
Update(id string, r *management.Role, opts ...management.RequestOption) (err error)
// Delete a role.
Delete(id string, opts ...management.RequestOption) (err error)
// AssociatePermissions associates permissions to a role.
//
// See: https://auth0.com/docs/api/management/v2#!/Roles/post_role_permission_assignment
AssociatePermissions(id string, permissions []*management.Permission, opts ...management.RequestOption) error
// Permissions retrieves all permissions granted by a role.
//
// See: https://auth0.com/docs/api/management/v2#!/Roles/get_role_permission
Permissions(id string, opts ...management.RequestOption) (p *management.PermissionList, err error)
// RemovePermissions removes permissions associated to a role.
//
// See: https://auth0.com/docs/api/management/v2#!/Roles/delete_role_permission_assignment
RemovePermissions(id string, permissions []*management.Permission, opts ...management.RequestOption) error
}
type RuleAPI ¶ added in v0.3.0
type RuleAPI interface {
// Create a new rule.
//
// Note: Changing a rule's stage of execution from the default `login_success`
// can change the rule's function signature to have user omitted.
Create(r *management.Rule, opts ...management.RequestOption) error
// Retrieve rule details. Accepts a list of fields to include or exclude in the result.
Read(id string, opts ...management.RequestOption) (r *management.Rule, err error)
// Update an existing rule.
Update(id string, r *management.Rule, opts ...management.RequestOption) error
// Delete a rule.
Delete(id string, opts ...management.RequestOption) error
// List all rules.
List(opts ...management.RequestOption) (r *management.RuleList, err error)
}
type TenantAPI ¶ added in v0.6.0
type TenantAPI interface {
Read(opts ...management.RequestOption) (t *management.Tenant, err error)
}
type UserAPI ¶ added in v0.5.1
type UserAPI interface {
// Blocks retrieves a list of blocked IP addresses of a particular user.
Blocks(id string, opts ...management.RequestOption) ([]*management.UserBlock, error)
// Unblock a user that was blocked due to an excessive amount of incorrectly
// provided credentials.
Unblock(id string, opts ...management.RequestOption) error
// Create a new user.
Create(u *management.User, opts ...management.RequestOption) (err error)
// Read user details for a given user.
Read(id string, opts ...management.RequestOption) (u *management.User, err error)
// Update user.
Update(id string, u *management.User, opts ...management.RequestOption) (err error)
// Delete a user.
Delete(id string, opts ...management.RequestOption) (err error)
// List all users.
List(opts ...management.RequestOption) (ul *management.UserList, err error)
// Search for users
Search(opts ...management.RequestOption) (us *management.UserList, err error)
// Roles lists all roles associated with a user.
Roles(id string, opts ...management.RequestOption) (r *management.RoleList, err error)
// AssignRoles assigns roles to a user.
AssignRoles(id string, roles []*management.Role, opts ...management.RequestOption) error
// RemoveRoles removes roles from a user.
RemoveRoles(id string, roles []*management.Role, opts ...management.RequestOption) error
}