endpoints

package
v0.0.0-...-acad0d5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

<AuthFox - a simple authentication and session server for Puroto>

Copyright (C) 2022  PurotoApp

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccountNotExisting = errors.New("findUserData(): Given account does not exist")
)

Functions

func AutoMigrateAuthfox

func AutoMigrateAuthfox(pg_conn *gorm.DB)

func SetRoutes

func SetRoutes(router *gin.Engine, pg_conn *gorm.DB, redisVerify, redisSession *redis.Client)

Types

type Profile

type Profile struct {
	UserID     string `gorm:"unique;not null;primaryKey"`
	NameFormat string `gorm:"unique;not null"`
	NameStatic string `gorm:"unique;not null"`
	NamePretty string `gorm:"unique;not null"`
	Email      string `gorm:"unique;not null"`
	// visual
	BadgeBetaTester  bool
	BadgeAlphaTester bool
	BadgeStaff       bool
}

profile DB struct, will be moved to Meltdown

type User

type User struct {
	UserID       string    `gorm:"unique;not null;primaryKey"`
	Password     string    `gorm:"unique;not null"`
	RegisterIP   string    `gorm:"not null"`
	RegisterTime time.Time `gorm:"not null"`
}

user DB struct

type Verify

type Verify struct {
	UserID       string    `gorm:"unique;not null;primaryKey"`
	NameFormat   string    `gorm:"unique;not null"`
	NameStatic   string    `gorm:"unique;not null"`
	Email        string    `gorm:"unique;not null"`
	Password     string    `gorm:"unique;not null"`
	RegisterIP   string    `gorm:"not null"`
	RegisterTime time.Time `gorm:"not null"`
	VerifyCode   string    `gorm:"unique;not null"`
}

verify DB struct

Jump to

Keyboard shortcuts

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