Documentation
¶
Index ¶
- Constants
- Variables
- func ContextWithClient(ctx context.Context) context.Context
- func NewKratosClient() (*cloud.APIClient, error)
- func ReadConfigFiles(files []string) ([]json.RawMessage, error)
- func RegisterConfigFlag(f *pflag.FlagSet)
- func RegisterProjectFlag(f *flag.FlagSet)
- func RegisterYesFlag(f *pflag.FlagSet)
- type AuthContext
- type AuthIdentity
- type AuthProject
- type CommandHelper
- func (h *CommandHelper) Authenticate() (*AuthContext, error)
- func (h *CommandHelper) CreateProject(name string) (*cloud.Project, error)
- func (h *CommandHelper) EnsureContext() (*AuthContext, error)
- func (h *CommandHelper) GetProject(id string) (*cloud.Project, error)
- func (h *CommandHelper) ListProjects() ([]cloud.ProjectMetadata, error)
- func (h *CommandHelper) PatchProject(id string, raw []json.RawMessage, add, replace, del []string) (*cloud.SuccessfulProjectUpdate, error)
- func (h *CommandHelper) PrintUpdateProjectWarnings(p *client.SuccessfulProjectUpdate) error
- func (h *CommandHelper) SetDefaultProject(id string) error
- func (h *CommandHelper) SignOut() error
- func (h *CommandHelper) UpdateProject(id string, name string, configs []json.RawMessage) (*cloud.SuccessfulProjectUpdate, error)
- func (h *CommandHelper) WriteConfig(c *AuthContext) error
Constants ¶
View Source
const ( ConfigFlag = "config" Version = "v0alpha0" )
View Source
const PasswordReader = "password_reader"
Variables ¶
View Source
var ErrNoConfig = stderrs.New("no ory configuration file present")
View Source
var ErrNoConfigQuiet = stderrs.New("please run `ory auth` to initialize your configuration or remove the `--quiet` flag")
Functions ¶
func NewKratosClient ¶
func ReadConfigFiles ¶
func ReadConfigFiles(files []string) ([]json.RawMessage, error)
func RegisterConfigFlag ¶
func RegisterProjectFlag ¶
func RegisterYesFlag ¶
Types ¶
type AuthContext ¶
type AuthContext struct {
Version string `json:"version"`
SessionToken string `json:"session_token"`
SelectedProject uuid.UUID `json:"selected_project"`
IdentityTraits AuthIdentity `json:"session_identity_traits"`
}
func (*AuthContext) Columns ¶
func (i *AuthContext) Columns() []string
func (*AuthContext) Header ¶
func (*AuthContext) Header() []string
func (*AuthContext) ID ¶
func (i *AuthContext) ID() string
func (*AuthContext) Interface ¶
func (i *AuthContext) Interface() interface{}
type AuthIdentity ¶
type AuthIdentity struct {
ID uuid.UUID
Email string `json:"email"`
}
type AuthProject ¶
type AuthProject struct {
ID uuid.UUID `json:"id"`
Slug string `json:"slug"`
}
type CommandHelper ¶
type CommandHelper struct {
Ctx context.Context
VerboseWriter io.Writer
VerboseErrWriter io.Writer
ConfigLocation string
NoConfirm bool
IsQuiet bool
APIDomain *url.URL
Stdin *bufio.Reader
PwReader passwordReader
}
func NewCommandHelper ¶
func NewCommandHelper(cmd *cobra.Command) (*CommandHelper, error)
NewCommandHelper creates a new CommandHelper instance which handles cobra CLI commands.
func (*CommandHelper) Authenticate ¶
func (h *CommandHelper) Authenticate() (*AuthContext, error)
func (*CommandHelper) CreateProject ¶
func (h *CommandHelper) CreateProject(name string) (*cloud.Project, error)
func (*CommandHelper) EnsureContext ¶
func (h *CommandHelper) EnsureContext() (*AuthContext, error)
func (*CommandHelper) GetProject ¶
func (h *CommandHelper) GetProject(id string) (*cloud.Project, error)
func (*CommandHelper) ListProjects ¶
func (h *CommandHelper) ListProjects() ([]cloud.ProjectMetadata, error)
func (*CommandHelper) PatchProject ¶
func (h *CommandHelper) PatchProject(id string, raw []json.RawMessage, add, replace, del []string) (*cloud.SuccessfulProjectUpdate, error)
func (*CommandHelper) PrintUpdateProjectWarnings ¶
func (h *CommandHelper) PrintUpdateProjectWarnings(p *client.SuccessfulProjectUpdate) error
func (*CommandHelper) SetDefaultProject ¶
func (h *CommandHelper) SetDefaultProject(id string) error
func (*CommandHelper) SignOut ¶
func (h *CommandHelper) SignOut() error
func (*CommandHelper) UpdateProject ¶
func (h *CommandHelper) UpdateProject(id string, name string, configs []json.RawMessage) (*cloud.SuccessfulProjectUpdate, error)
func (*CommandHelper) WriteConfig ¶
func (h *CommandHelper) WriteConfig(c *AuthContext) error
Click to show internal directories.
Click to hide internal directories.