login

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CILogin

func CILogin(config *config.Config, apiKey string, name string) error

func GuestLogin

func GuestLogin(config *config.Config) (string, error)

func InteractiveLogin

func InteractiveLogin(config *config.Config) error

InteractiveLogin lets the user set configuration on the command line

func Login

func Login(config *config.Config, input io.Reader) error

Login function is used to obtain credentials via hookdeck dashboard.

func SuccessMessage

func SuccessMessage(displayName string, teamName string, isConsole bool) string

SuccessMessage returns the display message for a successfully authenticated user

Types

type Links struct {
	BrowserURL string `json:"browser_url"`
	PollURL    string `json:"poll_url"`
}

Links provides the URLs for the CLI to continue the login flow

type PollAPIKeyResponse

type PollAPIKeyResponse struct {
	Claimed  bool   `json:"claimed"`
	UserID   string `json:"user_id"`
	UserName string `json:"user_name"`
	TeamID   string `json:"team_id"`
	TeamName string `json:"team_name"`
	TeamMode string `json:"team_mode"`
	APIKey   string `json:"key"`
	ClientID string `json:"client_id"`
}

PollAPIKeyResponse returns the data of the polling client login

func PollForKey

func PollForKey(pollURL string, interval time.Duration, maxAttempts int) (*PollAPIKeyResponse, error)

PollForKey polls Hookdeck at the specified interval until either the API key is available or we've reached the max attempts.

type ValidateAPIKeyResponse

type ValidateAPIKeyResponse struct {
	UserID   string `json:"user_id"`
	UserName string `json:"user_name"`
	TeamID   string `json:"team_id"`
	TeamName string `json:"team_name"`
	TeamMode string `json:"team_mode"`
	ClientID string `json:"client_id"`
}

ValidateAPIKeyResponse returns the user and team associated with a key

func ValidateKey

func ValidateKey(baseURL string, key string, teamId string) (*ValidateAPIKeyResponse, error)

Jump to

Keyboard shortcuts

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