login

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CILogin added in v0.6.8

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, email string, organizationName 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"`
	UserEmail        string `json:"user_email"`
	OrganizationName string `json:"organization_name"`
	OrganizationID   string `json:"organization_id"`
	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 added in v0.6.1

type ValidateAPIKeyResponse struct {
	UserID           string `json:"user_id"`
	UserName         string `json:"user_name"`
	UserEmail        string `json:"user_email"`
	OrganizationName string `json:"organization_name"`
	OrganizationID   string `json:"organization_id"`
	TeamID           string `json:"team_id"`
	TeamName         string `json:"team_name_no_org"`
	TeamMode         string `json:"team_mode"`
	ClientID         string `json:"client_id"`
}

ValidateAPIKeyResponse returns the user and team associated with a key

func ValidateKey added in v0.6.1

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