users

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

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) (*CreateResponse, error)

Create Create new user.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, 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).

func (*Client) Update

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

Update Update user configuration.

type CreateRequest

type CreateRequest struct {
	Userid string `url:"userid",json:"userid"` // User ID

	// The following parameters are optional
	Comment   *string `url:"comment,omitempty",json:"comment,omitempty"`
	Email     *string `url:"email,omitempty",json:"email,omitempty"`
	Enable    *bool   `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 CreateResponse

type CreateResponse map[string]interface{}

type DeleteRequest

type DeleteRequest struct {
	Userid string `url:"userid",json:"userid"` // User ID

}

type DeleteResponse

type DeleteResponse map[string]interface{}

type FindRequest

type FindRequest struct {
	Userid string `url:"userid",json:"userid"` // User ID

}

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    *bool                  `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 *bool `url:"enabled,omitempty",json:"enabled,omitempty"` // Optional filter for enable property.
	Full    *bool `url:"full,omitempty",json:"full,omitempty"`       // Include group and token information.
}

type IndexResponse

type IndexResponse []*struct {
	Userid string `url:"userid",json:"userid"` // User ID

	// The following parameters are optional
	Comment   *string `url:"comment,omitempty",json:"comment,omitempty"`
	Email     *string `url:"email,omitempty",json:"email,omitempty"`
	Enable    *bool   `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    []*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 *bool   `url:"privsep,omitempty",json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
	} `url:"tokens,omitempty",json:"tokens,omitempty"`
}

type ReadUserTfaTypeTfaRequest

type ReadUserTfaTypeTfaRequest struct {
	Userid string `url:"userid",json:"userid"` // User ID

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

type ReadUserTfaTypeTfaResponse

type ReadUserTfaTypeTfaResponse struct {

	// The following parameters are optional
	Realm *string  `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  *string  `url:"user,omitempty",json:"user,omitempty"`   // The type of TFA the user has set, if any. Only set if 'multiple' was not passed.
}

type UpdateRequest

type UpdateRequest struct {
	Userid string `url:"userid",json:"userid"` // User ID

	// The following parameters are optional
	Append    *bool   `url:"append,omitempty",json:"append,omitempty"`
	Comment   *string `url:"comment,omitempty",json:"comment,omitempty"`
	Email     *string `url:"email,omitempty",json:"email,omitempty"`
	Enable    *bool   `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 UpdateResponse

type UpdateResponse map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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