juju: github.com/juju/juju/api/usermanager Index | Files

package usermanager

import "github.com/juju/juju/api/usermanager"

Index

Package Files

client.go

type Client Uses

type Client struct {
    base.ClientFacade
    // contains filtered or unexported fields
}

Client provides methods that the Juju client command uses to interact with users stored in the Juju Server.

func NewClient Uses

func NewClient(st base.APICallCloser) *Client

NewClient creates a new `Client` based on an existing authenticated API connection.

func (*Client) AddUser Uses

func (c *Client) AddUser(
    username, displayName, password string,
) (_ names.UserTag, secretKey []byte, _ error)

AddUser creates a new local user in the controller, sharing with that user any specified models.

func (*Client) DisableUser Uses

func (c *Client) DisableUser(username string) error

DisableUser disables a user. If the user is already disabled, the action is considered a success.

func (*Client) EnableUser Uses

func (c *Client) EnableUser(username string) error

EnableUser enables a users. If the user is already enabled, the action is considered a success.

func (*Client) RemoveUser Uses

func (c *Client) RemoveUser(username string) error

RemoveUser deletes a user. That is it permanently removes the user, while retaining the record of the user to maintain provenance.

func (*Client) ResetPassword Uses

func (c *Client) ResetPassword(username string) ([]byte, error)

ResetPassword resets password for the specified user.

func (*Client) SetPassword Uses

func (c *Client) SetPassword(username, password string) error

SetPassword changes the password for the specified user.

func (*Client) UserInfo Uses

func (c *Client) UserInfo(usernames []string, all IncludeDisabled) ([]params.UserInfo, error)

UserInfo returns information about the specified users. If no users are specified, the call should return all users. If includeDisabled is set to ActiveUsers, only enabled users are returned.

type IncludeDisabled Uses

type IncludeDisabled bool

IncludeDisabled is a type alias to avoid bare true/false values in calls to the client method.

var (
    // ActiveUsers indicates to only return active users.
    ActiveUsers IncludeDisabled = false
    // AllUsers indicates that both enabled and disabled users should be
    // returned.
    AllUsers IncludeDisabled = true
)

Package usermanager imports 7 packages (graph) and is imported by 78 packages. Updated 2019-08-23. Refresh now. Tools for package owners.