auth

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ZINC_CACHED_PERMISSIONS = cachedPermissions{/* contains filtered or unexported fields */}
View Source
var ZINC_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 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