persist

package
v0.0.0-...-798ae07 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnWrapConfig

func UnWrapConfig()

func Unwrap

func Unwrap(file string, i interface{}) error

Types

type Key

type Key struct {
	// API key, in argon2id format.
	Key string `json:"api_key" yaml:"apiKey" toml:"apikey"`
	// Unixnano expiration for this credential.
	Expiration int64 `json:"expire" yaml:"expire" toml:"expire"`
	// Effective priviledge level of this credential.
	PrivLevel int `json:"privilege" yaml:"privilege" toml:"privilege"`
}

type KeyStore

type KeyStore struct {
	APIKeys []Key  `json:"keys" yaml:"keys" toml:"keys"`
	Users   []User `json:"users" yaml:"users" toml:"users"`
}

type User

type User struct {
	// Username for this user
	Username string `json:"user" yaml:"user" toml:"user"`
	// Password for this user, (in argon2 hashed format)
	PassKey string `json:"pass_key" yaml:"passKey" toml:"passkey"`
	// Unixnano expiration for this credential.
	Expiration int64 `json:"expire" yaml:"expire" toml:"expire"`
	// Effective priviledge level of this credential.
	PrivLevel int `json:"privilege" yaml:"privilege" toml:"privilege"`
}

Jump to

Keyboard shortcuts

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