account

package
v0.0.0-...-1ad4281 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(c *fiber.Ctx) error

Auth User authentication handler

func Create

func Create(c *fiber.Ctx) error

Create user handler

func Logout

func Logout(c *fiber.Ctx) error

Logout handler

func Salt

func Salt(c *fiber.Ctx) error

Salt get user's salt

Types

type AuthParts

type AuthParts struct {
	// Salt must be encoded as $argon2id$v=19$m={int},t={int},p={int}${salt}
	Salt string `json:"salt" form:"salt"`
	Hash string `json:"hash" form:"hash"`
}

type AuthRequest

type AuthRequest struct {
	UserName string `json:"userName"`
	AuthKey  string `json:"authKey"`
	Remember bool   `json:"remember"`
	Captcha  string `json:"captcha"`
}

AuthRequest struct

type AuthResponse

type AuthResponse struct {
	Success        bool           `json:"success"`
	PrivateArmored pgp.PrivateKey `json:"privateArmored,omitempty"`
	User           user.User      `json:"user,omitempty"`
	Error          string         `json:"error,omitempty"`
	// Require Captcha
	Captcha string `json:"captcha,omitempty"`
}

AuthResponse struct

type CreateRequest

type CreateRequest struct {
	UserName string    `json:"userName" form:"userName"`
	Email    string    `json:"email" form:"email"`
	Auth     AuthParts `json:"auth" form:"auth"`
	Key      Key       `json:"key" form:"key"`
	Captcha  string    `json:"captcha" form:"captcha"`
}

type CreateResponse

type CreateResponse struct {
	Success bool        `json:"success"`
	Errors  interface{} `json:"errors,omitempty"`
}

type Key

type Key struct {
	// PublicArmored armored PGP public key
	PublicArmored string `json:"publicArmored" form:"publicArmored"`
	// PrivateArmored armored PGP private key encrypted with passphrase
	PrivateArmored string `json:"privateArmored" form:"privateArmored"`
	// RecoveryHash hash of recovery key
	RecoveryHash string `json:"recoveryHash" form:"recoveryHash"`
	// RecoveryArmored PGP private key encrypted with recovery key
	RecoveryArmored string `json:"recoveryArmored" form:"recoveryArmored"`
}

type SaltRequest

type SaltRequest struct {
	UserName string `json:"userName" form:"userName"`
}

type SaltResponse

type SaltResponse struct {
	Salt  string `json:"salt"`
	Error string `json:"error,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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