Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Create(ctx context.Context, req CreateRequest) error
- func (c *Client) Delete(ctx context.Context, req DeleteRequest) error
- func (c *Client) Find(ctx context.Context, req FindRequest) (FindResponse, error)
- func (c *Client) Index(ctx context.Context, req IndexRequest) ([]IndexResponse, error)
- func (c *Client) ReadUserTfaTypeTfa(ctx context.Context, req ReadUserTfaTypeTfaRequest) (ReadUserTfaTypeTfaResponse, error)
- func (c *Client) Update(ctx context.Context, req UpdateRequest) error
- type CreateRequest
- type DeleteRequest
- type FindRequest
- type FindResponse
- type HTTPClient
- type IndexRequest
- type IndexResponse
- type ReadUserTfaTypeTfaRequest
- type ReadUserTfaTypeTfaResponse
- type Realm
- type Tokens
- type UpdateRequest
- type User
Constants ¶
View Source
const ( Realm_OATH Realm = "oath" Realm_YUBICO Realm = "yubico" User_OATH User = "oath" User_U2F User = "u2f" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(c HTTPClient) *Client
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, req CreateRequest) error
Create Create new user.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, req DeleteRequest) error
Delete Delete user.
func (*Client) Find ¶
func (c *Client) Find(ctx context.Context, req FindRequest) (FindResponse, error)
Find Get user configuration.
func (*Client) Index ¶
func (c *Client) Index(ctx context.Context, req IndexRequest) ([]IndexResponse, error)
Index User index.
func (*Client) ReadUserTfaTypeTfa ¶
func (c *Client) ReadUserTfaTypeTfa(ctx context.Context, req ReadUserTfaTypeTfaRequest) (ReadUserTfaTypeTfaResponse, error)
ReadUserTfaTypeTfa Get user TFA types (Personal and Realm).
type CreateRequest ¶
type CreateRequest struct { Userid string `url:"userid" json:"userid"` // Full User ID, in the `name@realm` format. // The following parameters are optional Comment *string `url:"comment,omitempty" json:"comment,omitempty"` Email *string `url:"email,omitempty" json:"email,omitempty"` Enable *util.PVEBool `url:"enable,omitempty" json:"enable,omitempty"` // Enable the account (default). You can set this to '0' to disable the account Expire *int `url:"expire,omitempty" json:"expire,omitempty"` // Account expiration date (seconds since epoch). '0' means no expiration date. Firstname *string `url:"firstname,omitempty" json:"firstname,omitempty"` Groups *string `url:"groups,omitempty" json:"groups,omitempty"` Keys *string `url:"keys,omitempty" json:"keys,omitempty"` // Keys for two factor auth (yubico). Lastname *string `url:"lastname,omitempty" json:"lastname,omitempty"` Password *string `url:"password,omitempty" json:"password,omitempty"` // Initial password. }
type DeleteRequest ¶
type DeleteRequest struct {
Userid string `url:"userid" json:"userid"` // Full User ID, in the `name@realm` format.
}
type FindRequest ¶
type FindRequest struct {
Userid string `url:"userid" json:"userid"` // Full User ID, in the `name@realm` format.
}
type FindResponse ¶
type FindResponse struct { // The following parameters are optional Comment *string `url:"comment,omitempty" json:"comment,omitempty"` Email *string `url:"email,omitempty" json:"email,omitempty"` Enable *util.PVEBool `url:"enable,omitempty" json:"enable,omitempty"` // Enable the account (default). You can set this to '0' to disable the account Expire *int `url:"expire,omitempty" json:"expire,omitempty"` // Account expiration date (seconds since epoch). '0' means no expiration date. Firstname *string `url:"firstname,omitempty" json:"firstname,omitempty"` Groups *[]string `url:"groups,omitempty" json:"groups,omitempty"` Keys *string `url:"keys,omitempty" json:"keys,omitempty"` // Keys for two factor auth (yubico). Lastname *string `url:"lastname,omitempty" json:"lastname,omitempty"` Tokens *map[string]interface{} `url:"tokens,omitempty" json:"tokens,omitempty"` }
type HTTPClient ¶
type IndexRequest ¶
type IndexResponse ¶
type IndexResponse struct { Userid string `url:"userid" json:"userid"` // Full User ID, in the `name@realm` format. // The following parameters are optional Comment *string `url:"comment,omitempty" json:"comment,omitempty"` Email *string `url:"email,omitempty" json:"email,omitempty"` Enable *util.PVEBool `url:"enable,omitempty" json:"enable,omitempty"` // Enable the account (default). You can set this to '0' to disable the account Expire *int `url:"expire,omitempty" json:"expire,omitempty"` // Account expiration date (seconds since epoch). '0' means no expiration date. Firstname *string `url:"firstname,omitempty" json:"firstname,omitempty"` Groups *string `url:"groups,omitempty" json:"groups,omitempty"` Keys *string `url:"keys,omitempty" json:"keys,omitempty"` // Keys for two factor auth (yubico). Lastname *string `url:"lastname,omitempty" json:"lastname,omitempty"` RealmType *string `url:"realm-type,omitempty" json:"realm-type,omitempty"` // The type of the users realm Tokens *[]Tokens `url:"tokens,omitempty" json:"tokens,omitempty"` }
type ReadUserTfaTypeTfaResponse ¶
type ReadUserTfaTypeTfaResponse struct { // The following parameters are optional Realm *Realm `url:"realm,omitempty" json:"realm,omitempty"` // The type of TFA the users realm has set, if any. Types *[]string `url:"types,omitempty" json:"types,omitempty"` // Array of the user configured TFA types, if any. Only available if 'multiple' was not passed. User *User `url:"user,omitempty" json:"user,omitempty"` // The type of TFA the user has set, if any. Only set if 'multiple' was not passed. }
type Tokens ¶ added in v0.0.10
type Tokens struct { Tokenid string `url:"tokenid" json:"tokenid"` // User-specific token identifier. // The following parameters are optional Comment *string `url:"comment,omitempty" json:"comment,omitempty"` Expire *int `url:"expire,omitempty" json:"expire,omitempty"` // API token expiration date (seconds since epoch). '0' means no expiration date. Privsep *util.PVEBool `url:"privsep,omitempty" json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user. }
type UpdateRequest ¶
type UpdateRequest struct { Userid string `url:"userid" json:"userid"` // Full User ID, in the `name@realm` format. // The following parameters are optional Append *util.PVEBool `url:"append,omitempty" json:"append,omitempty"` Comment *string `url:"comment,omitempty" json:"comment,omitempty"` Email *string `url:"email,omitempty" json:"email,omitempty"` Enable *util.PVEBool `url:"enable,omitempty" json:"enable,omitempty"` // Enable the account (default). You can set this to '0' to disable the account Expire *int `url:"expire,omitempty" json:"expire,omitempty"` // Account expiration date (seconds since epoch). '0' means no expiration date. Firstname *string `url:"firstname,omitempty" json:"firstname,omitempty"` Groups *string `url:"groups,omitempty" json:"groups,omitempty"` Keys *string `url:"keys,omitempty" json:"keys,omitempty"` // Keys for two factor auth (yubico). Lastname *string `url:"lastname,omitempty" json:"lastname,omitempty"` }
Click to show internal directories.
Click to hide internal directories.