auth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthContextMissing = errors.New("auth context not present")

Functions

func NewClientFromContext

func NewClientFromContext(ctx context.Context) (*client.Client, error)

NewClientFromContext creates a new Jira client from the given context.

Types

type Command

type Command struct {
	Command *cobra.Command
}

Command is the parent command for all authentication related commands.

func NewCommand

func NewCommand() *Command

type Context

type Context struct {
	EmailAddress string `json:"emailAddress"`
	Subdomain    string `json:"subdomain"`
	Token        string `json:"token"`
	DisplayName  string `json:"displayName"`
}

Context encapsulates the details needed to authenticate with Jira and the user details, fetched after authentication.

func LoadUserContext

func LoadUserContext() (*Context, error)

Load loads the user context from the keyring.

func (*Context) Save

func (c *Context) Save() error

Save saves the user context to the keyring.

type ContextKey

type ContextKey string

ContextKey is the key used to store the auth context in the context.

const (
	DefaultContextKey ContextKey = "default-auth-context"
)

type InitCommand

type InitCommand struct {
	Command *cobra.Command
	// contains filtered or unexported fields
}

func NewInitCommand

func NewInitCommand() *InitCommand

func (*InitCommand) Execute

func (ac *InitCommand) Execute(cmd *cobra.Command, _ []string) error

type ShowCommand

type ShowCommand struct {
	Command *cobra.Command
	// contains filtered or unexported fields
}

func NewShowCommand

func NewShowCommand() *ShowCommand

func (*ShowCommand) Execute

func (cmd *ShowCommand) Execute(_ *cobra.Command, _ []string) error

Jump to

Keyboard shortcuts

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