Documentation ¶
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type AuthenticationDB
- type AuthenticatorAPI
- type Settings
- type User
Constants ¶
const (
// AuthHeaderKey helps to obtain authorization header matching the field in a request
AuthHeaderKey = "authorization"
)
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type AuthenticationDB ¶
type AuthenticationDB interface { // AddUser adds new user with name, password and permission groups. Password should be already hashed. AddUser(name, passwordHash string, permissions []string) error // GetUser returns user data according to name, or nil of not found GetUser(name string) (*User, error) // SetLoginTime writes last login time for specific user SetLoginTime(name string) // SetLoginTime writes last logout time for specific user SetLogoutTime(name string) // IsLoggedOut uses login/logout timestamps to evaluate whether the user was logged out IsLoggedOut(name string) (bool, error) }
AuthenticationDB is common interface to access user database/permissions
func CreateDefaultAuthDB ¶
func CreateDefaultAuthDB() AuthenticationDB
CreateDefaultAuthDB builds new default storage
type AuthenticatorAPI ¶
type AuthenticatorAPI interface { // AddPermissionGroup adds new permission group. PG is defined by name and a set of URL keys. User with // permission group enabled has access to that set of keys. PGs with duplicated names are skipped. AddPermissionGroup(group ...*access.PermissionGroup) // Validate serves as middleware used while registering new HTTP handler. For every request, token // and permission group is validated. Validate(provider http.HandlerFunc) http.HandlerFunc }
AuthenticatorAPI provides methods for handling permissions
func NewAuthenticator ¶
NewAuthenticator prepares new instance of authenticator.
type Settings ¶
type Settings struct { // Authentication database, default implementation is used if not set AuthStore AuthenticationDB // List of registered users Users []access.User // Expiration time (token claim). If not set, default value of 1 hour will be used. ExpTime time.Duration // Cost value used to hash user passwords Cost int // Custom token signature. If not set, default value will be used. Signature string }
Settings defines fields required to instantiate authenticator
Directories ¶
Path | Synopsis |
---|---|
model
|
|
package vpp-agent-ctl implements the vpp-agent-ctl test tool for testing VPP Agent plugins.
|
package vpp-agent-ctl implements the vpp-agent-ctl test tool for testing VPP Agent plugins. |