Documentation
¶
Index ¶
- func CreateApplicationOrganization(token, applicationID string, params map[string]interface{}) error
- func CreateApplicationUser(token, applicationID string, params map[string]interface{}) error
- func CreateInvitation(token string, params map[string]interface{}) error
- func CreateOrganizationUser(token, orgID string, params map[string]interface{}) error
- func DeleteApplication(token, applicationID string) error
- func DeleteApplicationOrganization(token, applicationID, organizationID string) error
- func DeleteApplicationUser(token, applicationID, userID string) error
- func DeleteOrganizationUser(token, orgID, userID string) error
- func DeleteToken(token, tokenID string) error
- func RequestPasswordReset(token, applicationID *string, email string) error
- func ResetPassword(token *string, resetPasswordToken, passwd string) error
- func Status() error
- func UpdateApplication(token, applicationID string, params map[string]interface{}) error
- func UpdateOrganization(token, organizationID string, params map[string]interface{}) error
- func UpdateOrganizationUser(token, orgID, userID string, params map[string]interface{}) error
- func UpdateUser(token, userID string, params map[string]interface{}) error
- type Application
- type AuthenticationResponse
- type Invite
- type JSONWebKey
- type Organization
- func CreateOrganization(token string, params map[string]interface{}) (*Organization, error)
- func GetOrganizationDetails(token, organizationID string, params map[string]interface{}) (*Organization, error)
- func ListApplicationOrganizations(token, applicationID string, params map[string]interface{}) ([]*Organization, error)
- func ListOrganizations(token string, params map[string]interface{}) ([]*Organization, error)
- type Service
- type Token
- func CreateApplicationToken(token, applicationID string, params map[string]interface{}) (*Token, error)
- func CreateToken(token string, params map[string]interface{}) (*Token, error)
- func GetTokenDetails(token, tokenID string, params map[string]interface{}) (*Token, error)
- func ListApplicationTokens(token, applicationID string, params map[string]interface{}) ([]*Token, error)
- func ListTokens(token string, params map[string]interface{}) ([]*Token, error)
- type User
- func CreateUser(token string, params map[string]interface{}) (*User, error)
- func GetUserDetails(token, userID string, params map[string]interface{}) (*User, error)
- func ListApplicationInvitations(token, applicationID string, params map[string]interface{}) ([]*User, error)
- func ListApplicationUsers(token, applicationID string, params map[string]interface{}) ([]*User, error)
- func ListOrganizationInvitations(token, organizationID string, params map[string]interface{}) ([]*User, error)
- func ListOrganizationUsers(token, orgID string, params map[string]interface{}) ([]*User, error)
- func ListUsers(token string, params map[string]interface{}) ([]*User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateApplicationOrganization ¶
func CreateApplicationOrganization(token, applicationID string, params map[string]interface{}) error
CreateApplicationOrganization associates an organization with an application
func CreateApplicationUser ¶
CreateApplicationUser associates a user with an application
func CreateInvitation ¶
CreateInvitation creates a user invitation
func CreateOrganizationUser ¶
CreateOrganizationUser associates a user with an organization
func DeleteApplication ¶
DeleteApplication soft-deletes the application using the given API token
func DeleteApplicationOrganization ¶
DeleteApplicationOrganization disassociates an organization with an application
func DeleteApplicationUser ¶
DeleteApplicationUser disassociates a user with an application
func DeleteOrganizationUser ¶
DeleteOrganizationUser disassociates a user with an organization
func DeleteToken ¶
DeleteToken removes a previously authorized API token, effectively deauthorizing future calls using the token
func RequestPasswordReset ¶
RequestPasswordReset initiates a password reset request
func ResetPassword ¶
ResetPassword completes a previously-requested password reset operation for a user
func UpdateApplication ¶
UpdateApplication using the given API token, application id and params
func UpdateOrganization ¶
UpdateOrganization updates an organization
func UpdateOrganizationUser ¶
UpdateOrganizationUser updates an associated organization user=
func UpdateUser ¶
UpdateUser updates an existing user
Types ¶
type Application ¶
type Application struct {
api.Model
NetworkID uuid.UUID `json:"network_id,omitempty"`
UserID *string `json:"user_id,omitempty"` // this is the user that initially created the app
Name *string `json:"name"`
Description *string `json:"description"`
Status *string `json:"status,omitempty"` // this is for enrichment purposes only
Type *string `json:"type"`
Config map[string]interface{} `json:"config"`
Hidden bool `json:"hidden"`
}
Application model which is initially owned by the user who created it
func CreateApplication ¶
func CreateApplication(token string, params map[string]interface{}) (*Application, error)
CreateApplication on behalf of the given API token
func GetApplicationDetails ¶
func GetApplicationDetails(token, applicationID string, params map[string]interface{}) (*Application, error)
GetApplicationDetails retrives application details for the given API token and application id
func ListApplications ¶
func ListApplications(token string, params map[string]interface{}) ([]*Application, error)
ListApplications retrieves a paginated list of applications scoped to the given API token
type AuthenticationResponse ¶
AuthenticationResponse is returned upon successful authentication of a user (i.e., by email address)
func Authenticate ¶
func Authenticate(email, password string) (*AuthenticationResponse, error)
Authenticate a user by email address and password
func AuthenticateAcceptInvite ¶
func AuthenticateAcceptInvite(email, password, invitationToken string) (*AuthenticationResponse, error)
Authenticate a user by email address and password and attempt to accept an invite associated with the given invitation token
type Invite ¶
type Invite struct {
api.Model
ApplicationID *uuid.UUID `json:"application_id,omitempty"`
UserID *string `json:"user_id,omitempty"`
FirstName *string `json:"first_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
Email *string `json:"email,omitempty"`
InvitorID *uuid.UUID `json:"invitor_id,omitempty"`
InvitorName *string `json:"invitor_name,omitempty"`
OrganizationID *string `json:"organization_id,omitempty"`
OrganizationName *string `json:"organization_name,omitempty"`
Permissions uint32 `json:"permissions,omitempty"`
Params map[string]interface{} `json:"params,omitempty"`
}
Invite model
type JSONWebKey ¶
type JSONWebKey struct {
Kid string `json:"kid,omitempty"`
Use string `json:"use,omitempty"`
N string `json:"n,omitempty"`
E string `json:"e,omitempty"`
X5c []string `json:"x5c,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
PublicKey string `json:"public_key,omitempty"`
}
JSONWebKey represents the public part of a JWT
func GetJWKs ¶
func GetJWKs() ([]*JSONWebKey, error)
GetJWKs returns the set of keys containing the public keys used to verify JWTs
type Organization ¶
type Organization struct {
api.ModelWithDID
Name *string `json:"name"`
UserID *string `json:"user_id,omitempty"`
Description *string `json:"description"`
Permissions uint32 `json:"permissions,omitempty"`
Metadata map[string]interface{} `json:"metadata"`
UsersCount *uint32 `json:"users_count,omitempty"`
}
Organization model
func CreateOrganization ¶
func CreateOrganization(token string, params map[string]interface{}) (*Organization, error)
CreateOrganization creates a new organization
func GetOrganizationDetails ¶
func GetOrganizationDetails(token, organizationID string, params map[string]interface{}) (*Organization, error)
GetOrganizationDetails retrieves details for the given organization
func ListApplicationOrganizations ¶
func ListApplicationOrganizations(token, applicationID string, params map[string]interface{}) ([]*Organization, error)
ListApplicationOrganizations retrieves a paginated list of organizations scoped to the given API token
func ListOrganizations ¶
func ListOrganizations(token string, params map[string]interface{}) ([]*Organization, error)
ListOrganizations retrieves a paginated list of organizations scoped to the given API token
type Service ¶
Service for the ident api
func InitDefaultIdentService ¶
InitDefaultIdentService convenience method to initialize a default `ident.Service` (i.e., production) instance
func InitIdentService ¶
InitIdentService convenience method to initialize an `ident.Service` instance
type Token ¶
type Token struct {
api.Model
Token *string `json:"token,omitempty"`
// OAuth 2 fields
AccessToken *string `json:"access_token,omitempty"`
RefreshToken *string `json:"refresh_token,omitempty"`
Scope *string `json:"scope,omitempty"`
// Ephemeral JWT header fields and claims; these are here for convenience and
// are not always populated, even if they exist on the underlying token
Kid *string `json:"kid,omitempty"` // key fingerprint
Audience *string `json:"audience,omitempty"`
Issuer *string `json:"issuer,omitempty"`
IssuedAt *time.Time `json:"issued_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
ExpiresIn *uint64 `json:"expires_in,omitempty"`
NotBefore *time.Time `json:"not_before_at,omitempty"`
Subject *string `json:"subject,omitempty"`
Permissions uint32 `json:"permissions,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
}
Token represents a bearer JWT
func CreateApplicationToken ¶
func CreateApplicationToken(token, applicationID string, params map[string]interface{}) (*Token, error)
CreateApplicationToken creates a new API token for the given application ID.
func CreateToken ¶
CreateToken creates a new API token.
func GetTokenDetails ¶
GetTokenDetails retrieves details for the given API token id
type User ¶
type User struct {
api.ModelWithDID
Name string `json:"name"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
Permissions uint32 `json:"permissions,omitempty,omitempty"`
PrivacyPolicyAgreedAt *time.Time `json:"privacy_policy_agreed_at,omitempty"`
TermsOfServiceAgreedAt *time.Time `json:"terms_of_service_agreed_at,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
User represents a user
func CreateUser ¶
CreateUser creates a new user for which API tokens and managed signing identities can be authorized
func GetUserDetails ¶
GetUserDetails retrieves details for the given user id
func ListApplicationInvitations ¶
func ListApplicationInvitations(token, applicationID string, params map[string]interface{}) ([]*User, error)
ListApplicationInvitations retrieves a paginated list of invitations scoped to the given API token
func ListApplicationUsers ¶
func ListApplicationUsers(token, applicationID string, params map[string]interface{}) ([]*User, error)
ListApplicationUsers retrieves a paginated list of users scoped to the given API token
func ListOrganizationInvitations ¶
func ListOrganizationInvitations(token, organizationID string, params map[string]interface{}) ([]*User, error)
ListOrganizationInvitations retrieves a paginated list of organization invitations scoped to the given API token
func ListOrganizationUsers ¶
ListOrganizationUsers retrieves a paginated list of users scoped to an organization