auth

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCredentials = errors.New(errors.ErrorTypeInvalidArgument, "invalid credentials")
View Source
var ZED_CACHED_PERMISSIONS = cachedPermissions{/* contains filtered or unexported fields */}
View Source
var ZED_CACHED_USERS = cachedUsers{/* contains filtered or unexported fields */}

Functions

func AddPermission

func AddPermission(p string)

func CreateRole

func CreateRole(id, name string, permissions []string) (*meta.Role, error)

func CreateUser

func CreateUser(id, name, plaintextPassword, role string) (*meta.User, error)

func DeleteRole

func DeleteRole(id string) error

func DeleteUser

func DeleteUser(id string) error

func GeneratePassword

func GeneratePassword(password, salt string) string

func GenerateSalt

func GenerateSalt() string

func GetPermissions

func GetPermissions() []string

func GetRole

func GetRole(id string) (*meta.Role, bool, error)

func GetRoles

func GetRoles() ([]*meta.Role, error)

func GetUser

func GetUser(id string) (*meta.User, bool, error)

func GetUsers

func GetUsers() ([]*meta.User, error)

func SetRole

func SetRole(id string, role meta.Role) error

func SetUser

func SetUser(id string, user meta.User) error

func UpdateAccount

func UpdateAccount(id, password, name, newPassword string) (*meta.User, error)

UpdateAccount lets a user change their own name and/or password after proving the current password. Empty name or newPassword keeps the current value.

func VerifyCredentials

func VerifyCredentials(userID, password string) (*meta.User, bool)

func VerifyRoleHasPermission

func VerifyRoleHasPermission(roleId, permission string) bool

Types

type Argon2Params

type Argon2Params struct {
	Time        uint32
	Memory      uint32
	Threads     uint8
	KeyLength   uint32
	SaltLength  uint32
	Parallelism uint8
	Iterations  uint32
}

Jump to

Keyboard shortcuts

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