user

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const InfoCommandDoc = `` /* 958-byte string literal not displayed */
View Source
const ListCommandDoc = `
List all the current users in the Juju server.

See Also:
   juju help user info
`

Variables

This section is empty.

Functions

func LastConnection

func LastConnection(connectionTime *time.Time, now time.Time, exact bool) string

LastConnection turns the *time.Time returned from the API server into a user facing string with either exact time or a user friendly string based on the args.

func NewSuperCommand

func NewSuperCommand() cmd.Command

NewSuperCommand creates the user supercommand and registers the subcommands that it supports.

func UserFriendlyDuration

func UserFriendlyDuration(when, now time.Time) string

UserFriendlyDuration translates a time in the past into a user friendly string representation relative to the "now" time argument.

Types

type AddCommand

type AddCommand struct {
	UserCommandBase

	User        string
	DisplayName string
	OutPath     string
	// contains filtered or unexported fields
}

AddCommand adds new users into a Juju Server.

func (*AddCommand) Info

func (c *AddCommand) Info() *cmd.Info

Info implements Command.Info.

func (*AddCommand) Init

func (c *AddCommand) Init(args []string) error

Init implements Command.Init.

func (*AddCommand) Run

func (c *AddCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

func (*AddCommand) SetFlags

func (c *AddCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags implements Command.SetFlags.

type AddUserAPI

type AddUserAPI interface {
	AddUser(username, displayName, password string) (names.UserTag, error)
	Close() error
}

AddUserAPI defines the usermanager API methods that the add command uses.

type ChangePasswordAPI

type ChangePasswordAPI interface {
	SetPassword(username, password string) error
	Close() error
}

ChangePasswordAPI defines the usermanager API methods that the change password command uses.

type ChangePasswordCommand

type ChangePasswordCommand struct {
	UserCommandBase

	Generate bool
	OutPath  string
	User     string
	// contains filtered or unexported fields
}

ChangePasswordCommand changes the password for a user.

func (*ChangePasswordCommand) Info

func (c *ChangePasswordCommand) Info() *cmd.Info

Info implements Command.Info.

func (*ChangePasswordCommand) Init

func (c *ChangePasswordCommand) Init(args []string) error

Init implements Command.Init.

func (*ChangePasswordCommand) Run

func (c *ChangePasswordCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

func (*ChangePasswordCommand) SetFlags

func (c *ChangePasswordCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags implements Command.SetFlags.

type CredentialsCommand

type CredentialsCommand struct {
	UserCommandBase
	OutPath string
}

CredentialsCommand changes the password for a user.

func (*CredentialsCommand) Info

func (c *CredentialsCommand) Info() *cmd.Info

Info implements Command.Info.

func (*CredentialsCommand) Run

func (c *CredentialsCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

func (*CredentialsCommand) SetFlags

func (c *CredentialsCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags implements Command.SetFlags.

type DisableCommand

type DisableCommand struct {
	DisenableUserBase
}

DisableCommand disables users.

func (*DisableCommand) Info

func (c *DisableCommand) Info() *cmd.Info

Info implements Command.Info.

func (*DisableCommand) Run

func (c *DisableCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

type DisenableUserAPI

type DisenableUserAPI interface {
	EnableUser(username string) error
	DisableUser(username string) error
	Close() error
}

DisenableUserAPI defines the API methods that the disable and enable commands use.

type DisenableUserBase

type DisenableUserBase struct {
	UserCommandBase

	User string
	// contains filtered or unexported fields
}

DisenableUserBase common code for enable/disable user commands

func (*DisenableUserBase) Init

func (c *DisenableUserBase) Init(args []string) error

Init implements Command.Init.

func (*DisenableUserBase) Username

func (c *DisenableUserBase) Username() string

Username is here entirely for testing purposes to allow both the DisableCommand and EnableCommand to support a common interface that is able to ask for the command line supplied username.

type EnableCommand

type EnableCommand struct {
	DisenableUserBase
}

EnableCommand enables users.

func (*EnableCommand) Info

func (c *EnableCommand) Info() *cmd.Info

Info implements Command.Info.

func (*EnableCommand) Run

func (c *EnableCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

type EndpointProvider

type EndpointProvider interface {
	ConnectionEndpoint() (configstore.APIEndpoint, error)
}

EndpointProvider defines the method used by the writeServerFile in order to get the addresses and ca-cert of the juju server.

type EnvironInfoCredsWriter

type EnvironInfoCredsWriter interface {
	Write() error
	APICredentials() configstore.APICredentials
	SetAPICredentials(creds configstore.APICredentials)
}

EnvironInfoCredsWriter defines methods of the configstore API info that are used to change the password.

type InfoCommand

type InfoCommand struct {
	InfoCommandBase
	Username string
}

InfoCommand retrieves information about a single user.

func (*InfoCommand) Info

func (c *InfoCommand) Info() *cmd.Info

Info implements Command.Info.

func (*InfoCommand) Init

func (c *InfoCommand) Init(args []string) (err error)

Init implements Command.Init.

func (*InfoCommand) Run

func (c *InfoCommand) Run(ctx *cmd.Context) (err error)

Run implements Command.Run.

func (*InfoCommand) SetFlags

func (c *InfoCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags implements Command.SetFlags.

type InfoCommandBase

type InfoCommandBase struct {
	UserCommandBase
	// contains filtered or unexported fields
}

InfoCommandBase is a common base for 'juju user info' and 'juju user list'.

func (*InfoCommandBase) SetFlags

func (c *InfoCommandBase) SetFlags(f *gnuflag.FlagSet)

type ListCommand

type ListCommand struct {
	InfoCommandBase
	// contains filtered or unexported fields
}

ListCommand shows all the users in the Juju server.

func (*ListCommand) Info

func (c *ListCommand) Info() *cmd.Info

Info implements Command.Info.

func (*ListCommand) Run

func (c *ListCommand) Run(ctx *cmd.Context) (err error)

Run implements Command.Run.

func (*ListCommand) SetFlags

func (c *ListCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags implements Command.SetFlags.

type UserCommandBase

type UserCommandBase struct {
	envcmd.SysCommandBase
}

UserCommandBase is a helper base structure that has a method to get the user manager client.

type UserInfo

type UserInfo struct {
	Username       string `yaml:"user-name" json:"user-name"`
	DisplayName    string `yaml:"display-name" json:"display-name"`
	DateCreated    string `yaml:"date-created" json:"date-created"`
	LastConnection string `yaml:"last-connection" json:"last-connection"`
	Disabled       bool   `yaml:"disabled,omitempty" json:"disabled,omitempty"`
}

UserInfo defines the serialization behaviour of the user information.

type UserInfoAPI

type UserInfoAPI interface {
	UserInfo([]string, usermanager.IncludeDisabled) ([]params.UserInfo, error)
	Close() error
}

UserInfoAPI defines the API methods that the info command uses.

Jump to

Keyboard shortcuts

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