Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) AddUser(ctx context.Context, username, displayName, password string) (_ names.UserTag, secretKey []byte, _ error)
- func (c *Client) DisableUser(ctx context.Context, username string) error
- func (c *Client) EnableUser(ctx context.Context, username string) error
- func (c *Client) ModelUserInfo(ctx context.Context, modelUUID string) ([]params.ModelUserInfo, error)
- func (c *Client) RemoveUser(ctx context.Context, username string) error
- func (c *Client) ResetPassword(ctx context.Context, username string) ([]byte, error)
- func (c *Client) SetPassword(ctx context.Context, username, password string) error
- func (c *Client) UserInfo(ctx context.Context, usernames []string, all IncludeDisabled) ([]params.UserInfo, error)
- type IncludeDisabled
- type Option
Constants ¶
This section is empty.
Variables ¶
var WithTracer = base.WithTracer
WithTracer returns an Option that configures the Client to use the supplied tracer.
Functions ¶
This section is empty.
Types ¶
type Client ¶
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 ¶
func NewClient(st base.APICallCloser, options ...Option) *Client
NewClient creates a new `Client` based on an existing authenticated API connection.
func (*Client) AddUser ¶
func (c *Client) AddUser( ctx context.Context, 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 ¶
DisableUser disables a user. If the user is already disabled, the action is considered a success.
func (*Client) EnableUser ¶
EnableUser enables a users. If the user is already enabled, the action is considered a success.
func (*Client) ModelUserInfo ¶
func (c *Client) ModelUserInfo(ctx context.Context, modelUUID string) ([]params.ModelUserInfo, error)
ModelUserInfo returns information on all users in the model.
func (*Client) RemoveUser ¶
RemoveUser deletes a user. That is it permanently removes the user, while retaining the record of the user to maintain provenance.
func (*Client) ResetPassword ¶
ResetPassword resets password for the specified user.
func (*Client) SetPassword ¶
SetPassword changes the password for the specified user.
func (*Client) UserInfo ¶
func (c *Client) UserInfo(ctx context.Context, 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 ¶
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 )