command

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ParamListSep = ","

ParamListSep is the string separating individual values in a raw string representing a list of parameter values.

Variables

This section is empty.

Functions

func Coalesce

func Coalesce(args ...string) string

Coalesce returns the first non-empty string it encounters amongst the arguments supplied to the function.

func FillTemplateMessage

func FillTemplateMessage(msg string, filler map[string]interface{}) (string, error)

FillTemplateMessage interpolates data into a complex string and makes it more polished. It abstracts away the nuances of templating from the user.

func ValidateEmailID

func ValidateEmailID(email string) error

ValidateEmailID returns an error if the parameter supplied to it is not a valid Email ID.

func ValidateUrl

func ValidateUrl(u string) error

ValidateUrl returns an error if the parameter supplied to it is not a valid URL. Because this function is only a wrapper around a standard library function, it doesn't need to be tested.

Types

type AssignUserGroupsCommand

type AssignUserGroupsCommand struct {
	*Command
}

func (*AssignUserGroupsCommand) Help

func (c *AssignUserGroupsCommand) Help() string

func (*AssignUserGroupsCommand) ParseArgs

func (*AssignUserGroupsCommand) Run

func (c *AssignUserGroupsCommand) Run(args []string) int

func (*AssignUserGroupsCommand) Synopsis

func (c *AssignUserGroupsCommand) Synopsis() string

type AssignUserGroupsCommandConfig

type AssignUserGroupsCommandConfig struct {
	EmailID    string
	GroupNames []string
}

type Command

type Command struct {
	Meta   *Metadata
	Logger *log.Logger
	// contains filtered or unexported fields
}

Command contains objects passed to all CLI commands

func (*Command) OktaClient

func (c *Command) OktaClient() (*okta.Client, error)

OktaClient returns an instance of Okta Client initialized with organization-specific API credentials. This method only creates the client the first time it is called. Subsequent calls return the cached client. This method should only be called after api credentials have been populated in the metadata.

type Config

type Config struct {
	OrgUrl, ApiToken string
}

Config contains cli options that are made available to all commands. It is used to pass down global configuration.

type CreateUserCommand

type CreateUserCommand struct {
	*Command
}

func (*CreateUserCommand) Help

func (c *CreateUserCommand) Help() string

func (*CreateUserCommand) ParseArgs

func (c *CreateUserCommand) ParseArgs(args []string) (*CreateUserCommandConfig, error)

func (*CreateUserCommand) Run

func (c *CreateUserCommand) Run(args []string) int

func (*CreateUserCommand) Synopsis

func (c *CreateUserCommand) Synopsis() string

type CreateUserCommandConfig

type CreateUserCommandConfig struct {
	EmailID             string
	Team                string
	FirstName, LastName string
}

type DeactivateUserCommand

type DeactivateUserCommand struct {
	*Command
}

func (*DeactivateUserCommand) Help

func (c *DeactivateUserCommand) Help() string

func (*DeactivateUserCommand) ParseArgs

func (*DeactivateUserCommand) Run

func (c *DeactivateUserCommand) Run(args []string) int

func (*DeactivateUserCommand) Synopsis

func (c *DeactivateUserCommand) Synopsis() string

type DeactivateUserCommandConfig

type DeactivateUserCommandConfig struct {
	EmailID string
}

type ListGroupsCommand

type ListGroupsCommand struct {
	*Command
}

func (*ListGroupsCommand) Help

func (c *ListGroupsCommand) Help() string

func (*ListGroupsCommand) ParseArgs

func (c *ListGroupsCommand) ParseArgs(args []string) (*ListGroupsCommandConfig, error)

func (*ListGroupsCommand) Run

func (c *ListGroupsCommand) Run(args []string) int

func (*ListGroupsCommand) Synopsis

func (c *ListGroupsCommand) Synopsis() string

type ListGroupsCommandConfig

type ListGroupsCommandConfig struct {
	Detailed   bool
	GroupNames []string
}

type Metadata

type Metadata struct {
	FlagSet               *flag.FlagSet
	GlobalOptions         *Config
	GlobalOptionsHelpText string
}

Metadata contains data passed to all CLI commands

type OktaGroups

type OktaGroups []*okta.Group

func (OktaGroups) GetID

func (groups OktaGroups) GetID(name string) string

GetID returns the ID of the Group whose name is specified. If the Group with that name doesn't exist, this method simply returns an empty string.

type ResetUserMultifactorsCommand

type ResetUserMultifactorsCommand struct {
	*Command
}

func (*ResetUserMultifactorsCommand) Help

func (*ResetUserMultifactorsCommand) ParseArgs

func (*ResetUserMultifactorsCommand) Run

func (c *ResetUserMultifactorsCommand) Run(args []string) int

func (*ResetUserMultifactorsCommand) Synopsis

func (c *ResetUserMultifactorsCommand) Synopsis() string

type ResetUserMultifactorsCommandConfig

type ResetUserMultifactorsCommandConfig struct {
	EmailID string
}

type ResetUserPasswordCommand

type ResetUserPasswordCommand struct {
	*Command
}

func (*ResetUserPasswordCommand) Help

func (c *ResetUserPasswordCommand) Help() string

func (*ResetUserPasswordCommand) ParseArgs

func (*ResetUserPasswordCommand) Run

func (c *ResetUserPasswordCommand) Run(args []string) int

func (*ResetUserPasswordCommand) Synopsis

func (c *ResetUserPasswordCommand) Synopsis() string

type ResetUserPasswordCommandConfig

type ResetUserPasswordCommandConfig struct {
	EmailID string
}

Jump to

Keyboard shortcuts

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