access

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 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 ChangePasswordRequest

type ChangePasswordRequest struct {
	Password string `url:"password",json:"password"` // The new password.
	Userid   string `url:"userid",json:"userid"`     // User ID

}

type ChangePasswordResponse

type ChangePasswordResponse map[string]interface{}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c HTTPClient) *Client

func (*Client) ChangePassword

func (c *Client) ChangePassword(ctx context.Context, req *ChangePasswordRequest) (*ChangePasswordResponse, error)

ChangePassword Change user password.

func (*Client) CreateTicket

func (c *Client) CreateTicket(ctx context.Context, req *CreateTicketRequest) (*CreateTicketResponse, error)

CreateTicket Create or verify authentication ticket.

func (*Client) GetTicket

func (c *Client) GetTicket(ctx context.Context) (*GetTicketResponse, error)

GetTicket Dummy. Useful for formatters which want to provide a login page.

func (*Client) Index

func (c *Client) Index(ctx context.Context) (*IndexResponse, error)

Index Directory index.

func (*Client) Permissions

func (c *Client) Permissions(ctx context.Context, req *PermissionsRequest) (*PermissionsResponse, error)

Permissions Retrieve effective permissions of given user/token.

func (*Client) ReadAcl

func (c *Client) ReadAcl(ctx context.Context) (*ReadAclResponse, error)

ReadAcl Get Access Control List (ACLs).

func (*Client) UpdateAcl

func (c *Client) UpdateAcl(ctx context.Context, req *UpdateAclRequest) (*UpdateAclResponse, error)

UpdateAcl Update Access Control List (add or remove permissions).

type CreateTicketRequest

type CreateTicketRequest struct {
	Password string `url:"password",json:"password"` // The secret password. This can also be a valid ticket.
	Username string `url:"username",json:"username"` // User name

	// The following parameters are optional
	NewFormat    *bool   `url:"new-format,omitempty",json:"new-format,omitempty"`       // With webauthn the format of half-authenticated tickts changed. New clients should pass 1 here and not worry about the old format. The old format is deprecated and will be retired with PVE-8.0
	Otp          *string `url:"otp,omitempty",json:"otp,omitempty"`                     // One-time password for Two-factor authentication.
	Path         *string `url:"path,omitempty",json:"path,omitempty"`                   // Verify ticket, and check if user have access 'privs' on 'path'
	Privs        *string `url:"privs,omitempty",json:"privs,omitempty"`                 // Verify ticket, and check if user have access 'privs' on 'path'
	Realm        *string `url:"realm,omitempty",json:"realm,omitempty"`                 // You can optionally pass the realm using this parameter. Normally the realm is simply added to the username <username>@<relam>.
	TfaChallenge *string `url:"tfa-challenge,omitempty",json:"tfa-challenge,omitempty"` // The signed TFA challenge string the user wants to respond to.
}

type CreateTicketResponse

type CreateTicketResponse struct {
	Username string `url:"username",json:"username"`

	// The following parameters are optional
	Clustername         *string `url:"clustername,omitempty",json:"clustername,omitempty"`
	Csrfpreventiontoken *string `url:"CSRFPreventionToken,omitempty",json:"CSRFPreventionToken,omitempty"`
	Ticket              *string `url:"ticket,omitempty",json:"ticket,omitempty"`
}

type GetTicketResponse

type GetTicketResponse map[string]interface{}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexResponse

type IndexResponse []*struct {
	Subdir string `url:"subdir",json:"subdir"`
}

type PermissionsRequest

type PermissionsRequest map[string]interface{}

type PermissionsResponse

type PermissionsResponse map[string]interface{}

type ReadAclResponse

type ReadAclResponse []*struct {
	Path   string `url:"path",json:"path"` // Access control path
	Roleid string `url:"roleid",json:"roleid"`
	Type   string `url:"type",json:"type"`
	Ugid   string `url:"ugid",json:"ugid"`

	// The following parameters are optional
	Propagate *bool `url:"propagate,omitempty",json:"propagate,omitempty"` // Allow to propagate (inherit) permissions.
}

type UpdateAclRequest

type UpdateAclRequest struct {
	Path  string `url:"path",json:"path"`   // Access control path
	Roles string `url:"roles",json:"roles"` // List of roles.

	// The following parameters are optional
	Delete    *bool   `url:"delete,omitempty",json:"delete,omitempty"`       // Remove permissions (instead of adding it).
	Groups    *string `url:"groups,omitempty",json:"groups,omitempty"`       // List of groups.
	Propagate *bool   `url:"propagate,omitempty",json:"propagate,omitempty"` // Allow to propagate (inherit) permissions.
	Tokens    *string `url:"tokens,omitempty",json:"tokens,omitempty"`       // List of API tokens.
	Users     *string `url:"users,omitempty",json:"users,omitempty"`         // List of users.
}

type UpdateAclResponse

type UpdateAclResponse map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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