futureauth

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

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 8 Imported by: 0

README

futureauth

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PasswordConfig

type PasswordConfig struct {
	// contains filtered or unexported fields
}

PasswordConfig is used to generate the argon2 password hash

type SignupData

type SignupData struct {
	ID           string   `json:"id,omitempty"`
	Email        string   `json:"email" validate:"required,email,max=30,min=6"`
	Tenant       string   `json:"tenantID"`
	Password     string   `json:"password" validate:"required,max=30,min=6"`
	AppMetaData  string   `json:"appMetaData"`
	UserMetaData string   `json:"userMetaData"`
	Confirmed    bool     `json:"confirmed"`
	IsAdmin      bool     `json:"isAdmin"`
	Disabled     bool     `json:"disabled"`
	Roles        []string `json:"roles"`
}

SignupData is what's sent to the signup endpoint and used to create the User model

type User

type User struct {
	Email        string   `json:"name"`
	Tenant       string   `json:"tenantID"`
	Password     string   `json:"password"`
	AppMetaData  string   `json:"appMetaData"`
	UserMetaData string   `json:"userMetaData"`
	Confirmed    bool     `json:"confirmed"`
	IsAdmin      bool     `json:"isAdmin"`
	Disabled     bool     `json:"disabled"`
	Roles        []string `json:"roles"`
}

func CreateUser

func CreateUser(signupData SignupData) (*User, error)

func NewUser

func NewUser(email, tenant, password string, confirmed, isAdmin, disabled bool, appMetaData, userMetaData string, roles []string) (*User, error)

func (*User) VerifyPassword

func (u *User) VerifyPassword(password string) (bool, error)

Jump to

Keyboard shortcuts

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