Documentation
¶
Overview ¶
Package authn provides AuthN API over HTTP(S)
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package authn provides AuthN API over HTTP(S)
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package authn provides AuthN API over HTTP(S)
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Package authn provides AuthN API over HTTP(S)
- Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.
Index ¶
- Constants
- func AddRole(bp api.BaseParams, roleSpec *Role) error
- func AddUser(bp api.BaseParams, newUser *User) error
- func DeleteRole(bp api.BaseParams, role string) error
- func DeleteUser(bp api.BaseParams, userID string) error
- func LoadToken(tokenFile string) (string, error)
- func RegisterCluster(bp api.BaseParams, cluSpec CluACL) error
- func RevokeToken(bp api.BaseParams, token string) error
- func SetConfig(bp api.BaseParams, conf *ConfigToUpdate) error
- func UnregisterCluster(bp api.BaseParams, spec CluACL) error
- func UpdateCluster(bp api.BaseParams, cluSpec CluACL) error
- func UpdateRole(bp api.BaseParams, roleSpec *Role) error
- func UpdateUser(bp api.BaseParams, user *User) error
- type BckACL
- type CluACL
- type Config
- func (c *Config) ApplyUpdate(cu *ConfigToUpdate) error
- func (c *Config) Expire() time.Duration
- func (c *Config) Init()
- func (*Config) JspOpts() jsp.Options
- func (c *Config) Lock()
- func (c *Config) Secret() cmn.Censored
- func (c *Config) SetSecret(val *string)
- func (c *Config) Unlock()
- func (c *Config) Verbose() bool
- type ConfigToUpdate
- type HTTPConf
- type LogConf
- type LoginMsg
- type NetConf
- type RegisteredClusters
- type Role
- type ServerConf
- type ServerConfToSet
- type TimeoutConf
- type TokenList
- type TokenMsg
- type User
Constants ¶
View Source
const (
AdminRole = "Admin"
)
Variables ¶
This section is empty.
Functions ¶
func DeleteRole ¶
func DeleteRole(bp api.BaseParams, role string) error
func DeleteUser ¶
func DeleteUser(bp api.BaseParams, userID string) error
func LoadToken ¶
LoadToken retrieves the authentication token from the specified tokenFile, environment variables, or default location (CLI config).
func RegisterCluster ¶
func RegisterCluster(bp api.BaseParams, cluSpec CluACL) error
func RevokeToken ¶
func RevokeToken(bp api.BaseParams, token string) error
func SetConfig ¶
func SetConfig(bp api.BaseParams, conf *ConfigToUpdate) error
func UnregisterCluster ¶
func UnregisterCluster(bp api.BaseParams, spec CluACL) error
func UpdateCluster ¶
func UpdateCluster(bp api.BaseParams, cluSpec CluACL) error
func UpdateRole ¶
func UpdateRole(bp api.BaseParams, roleSpec *Role) error
func UpdateUser ¶
func UpdateUser(bp api.BaseParams, user *User) error
Types ¶
type BckACL ¶
type BckACL struct {
Bck cmn.Bck `json:"bck"`
Access apc.AccessAttrs `json:"perm,string"`
}
type CluACL ¶
type CluACL struct {
ID string `json:"id"`
Alias string `json:"alias,omitempty"`
URLs []string `json:"urls,omitempty"`
Access apc.AccessAttrs `json:"perm,string,omitempty"`
}
func GetRegisteredClusters ¶
func GetRegisteredClusters(bp api.BaseParams, spec CluACL) ([]*CluACL, error)
type Config ¶
type Config struct {
Server ServerConf `json:"auth"`
Log LogConf `json:"log"`
Net NetConf `json:"net"`
Timeout TimeoutConf `json:"timeout"`
// contains filtered or unexported fields
}
func (*Config) ApplyUpdate ¶
func (c *Config) ApplyUpdate(cu *ConfigToUpdate) error
type ConfigToUpdate ¶
type ConfigToUpdate struct {
Server *ServerConfToSet `json:"auth"`
}
type RegisteredClusters ¶
type Role ¶
type Role struct {
Name string `json:"name"`
Description string `json:"desc"`
ClusterACLs []*CluACL `json:"clusters"`
BucketACLs []*BckACL `json:"buckets"`
IsAdmin bool `json:"admin"`
}
func GetAllRoles ¶
func GetAllRoles(bp api.BaseParams) ([]*Role, error)
type ServerConf ¶
type ServerConfToSet ¶ added in v1.3.21
type TimeoutConf ¶
type TokenMsg ¶
type TokenMsg struct {
Token string `json:"token"`
}
func LoginUser ¶
func LoginUser(bp api.BaseParams, userID, pass string, expire *time.Duration) (token *TokenMsg, err error)
Authorize a user and return a user token in case of success. The token expires in `expire` time. If `expire` is `nil` the expiration time is set by AuthN (default AuthN expiration time is 24 hours)
Click to show internal directories.
Click to hide internal directories.