auth

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(username, password string) error

func ChangePassword

func ChangePassword(username, password string) error

func CheckCredentials

func CheckCredentials(username, password string) bool

func CreateToken

func CreateToken(userId, password string) (string, error)

func DropUsers

func DropUsers() error

func GetRole added in v0.0.25

func GetRole(username string) (string, error)

func GetRoleFromToken added in v0.0.25

func GetRoleFromToken(token string) (string, error)

func GetUser added in v0.0.25

func GetUser(username string) (providers.UserView, error)

func GetUserFromToken added in v0.0.25

func GetUserFromToken(token string) (string, error)

func GetUsers

func GetUsers() ([]string, error)

func InitializeAuth

func InitializeAuth(data json.RawMessage) error

func RemoveUser

func RemoveUser(username string) error

func SetRole added in v0.0.25

func SetRole(username, role string) error

func VerifyToken

func VerifyToken(token string) bool

func VerifyUserToken

func VerifyUserToken(userId, token string) bool

Types

type AuthConfig

type AuthConfig struct {
	Provider       string          `json:"provider"`
	SecretKey      string          `json:"secret_key"`
	ExpirationTime int             `json:"expiration_time,omitempty"`
	Settings       json.RawMessage `json:"settings"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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