command

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Login = cli.Command{
	Name:  "login",
	Usage: "Log in to Common Fate",
	Flags: []cli.Flag{
		&cli.BoolFlag{Name: "lazy", Usage: "the lazy flag lets granted decide whether a new login flow should be initiated based on the token expiry"},
	},
	Action: defaultLoginFlow.LoginAction,
}
View Source
var Logout = cli.Command{
	Name:  "logout",
	Usage: "Log out of Common Fate",
	Action: func(c *cli.Context) error {
		cfg, err := config.Load()
		if err != nil {
			return err
		}

		ts := tokenstore.New(cfg.CurrentContext)
		err = ts.Clear()
		if err != nil {
			return err
		}

		clio.Success("logged out")

		return nil
	},
}

Functions

This section is empty.

Types

type LoginFlow

type LoginFlow struct {
	// Keyring optionally overrides the keyring that auth tokens are saved to.
	Keyring keyring.Keyring
	// ForceInteractive forces the survey prompt to appear
	ForceInteractive bool
}

func (LoginFlow) LoginAction

func (lf LoginFlow) LoginAction(c *cli.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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