users

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

ReadUserTfaTypeTfa Get user TFA types (Personal and Realm).

func (*Client) Update

func (c *Client) Update(ctx context.Context, req UpdateRequest) error

Update Update user configuration.

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 HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexRequest

type IndexRequest struct {

	// The following parameters are optional
	Enabled *util.PVEBool `url:"enabled,omitempty" json:"enabled,omitempty"` // Optional filter for enable property.
	Full    *util.PVEBool `url:"full,omitempty" json:"full,omitempty"`       // Include group and token information.
}

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 ReadUserTfaTypeTfaRequest

type ReadUserTfaTypeTfaRequest struct {
	Userid string `url:"userid" json:"userid"` // Full User ID, in the `name@realm` format.

	// The following parameters are optional
	Multiple *util.PVEBool `url:"multiple,omitempty" json:"multiple,omitempty"` // Request all entries as an array.
}

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 Realm added in v0.0.15

type Realm string

func PtrRealm added in v0.0.15

func PtrRealm(i Realm) *Realm

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"`
}

type User added in v0.0.15

type User string

func PtrUser added in v0.0.15

func PtrUser(i User) *User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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