api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// General messages
	NotImplemented     = "NotImplemented"
	InternalError      = "InternalError"
	FormParsingError   = "FormParsingError"
	DecodingFailed     = "DecodingFailed"
	ActionMissing      = "ActionMissing"
	IncorrectArguments = "IncorrectArguments"
	OK                 = "OK"

	// User input messages
	MissingEmail             = "MissingEmail"
	InvalidEmail             = "InvalidEmail"
	InvalidUsername          = "InvalidUsername"
	MissingPassword          = "MissingPassword"
	PasswordComplexityTooLow = "PasswordComplexityTooLow"
	DuplicateUserAccount     = "DuplicateUserAccount"
	CreateUserSuccess        = "CreateUserSuccess"

	// Status messages
	LoginSuccessful      = "LoginSuccessful"
	LogoutSuccessful     = "LogoutSuccessful"
	ActivationSuccessful = "ActivationSuccessful"
	AccountLocked        = "AccountLocked"
	UnlockSuccessful     = "UnlockSuccessful"
	PasswordUpdated      = "PasswordUpdated"
	AlreadyAuthenticated = "AlreadyAuthenticated"
	Unauthorized         = "Unauthorized"
	InvalidToken         = "InvalidToken"
	MissingToken         = "MissingToken"
	NoRecoveryPending    = "NoRecoveryPending"
	LoginRequired        = "LoginRequired"

	// Second factor messages
	SecondFactorRequired         = "SecondFactorRequired"
	SecondFactorNoRequestSession = "SecondFactorNoSession"
	SecondFactorInvalidSession   = "SecondFactorInvalidSession"
	SecondFactorBadResponse      = "SecondFactorBadResponse"
	SecondFactorSuccess          = "SecondFactorSuccess"
	SecondFactorFailed           = "SecondFactorFailed"
	TokenNameRequired            = "TokenNameRequired"
	SecondFactorNotFound         = "SecondFactorNotFound"

	U2FRegistrationFailed    = "U2FRegistrationFailed"
	U2FRegistrationComplete  = "U2FRegistrationComplete"
	NoU2FPending             = "NoU2FPending"
	NoU2FTokenFound          = "NoU2FTokenFound"
	U2FTokenRemoved          = "U2FTokenRemoved"
	RecoveryNoRequestPending = "RecoveryNoRequestPending"

	TOTPTokenRemoved = "TOTPTokenRemoved"

	BackupTokenOverwriteRequired = "CreateBackupTokenOverwriteRequired"
	BackupTokensRemoved          = "BackupTokensRemoved"

	// OAuth messages
	OAuthInvalidClientName  = "OAuthInvalidClientName"
	OAuthInvalidRedirect    = "OAuthInvalidRedirect"
	OAuthNoAuthorizePending = "OAuthNoAuthorizePending"
	OAuthNoTokenFound       = "OAuthNoTokenFound"
	OAuthNoGrantedScopes    = "OAuthNoGrantedScopes"
	OAuthMissingAccessToken = "OAuthMissingAccessToken"
)

API Response Messages for frontend / internationalisation parsing

Variables

View Source
var TokenError = errors.New("internal server error")
View Source
var TokenErrorAlreadyUsed = errors.New("action token already used")
View Source
var TokenErrorInvalidAction = errors.New("action token invalid action")
View Source
var TokenErrorInvalidUser = errors.New("action token invalid user")
View Source
var TokenErrorNotFound = errors.New("action token not found")

Functions

This section is empty.

Types

type Paginate

type Paginate struct {
	Count  uint
	Offset uint
}

type Response

type Response struct {
	// Response code
	Code string `json:"code"`
}

Response Common API response object

type TokenAction

type TokenAction string

Token action type for interface

const TokenActionActivate TokenAction = "activate"

Token success actions

const TokenActionExpired TokenAction = "expired"
const TokenActionInvalid TokenAction = "invalid"

Token error actions

const TokenActionRecovery TokenAction = "recover"
const TokenActionUnlock TokenAction = "unlock"

Jump to

Keyboard shortcuts

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