auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OpenBrowser = browser.OpenURL

Functions

func Challenge

func Challenge(verifier string) string

func Delete

func Delete() error

func LoginURL

func LoginURL(uiBase, redirectURI, state, challenge string) (string, error)

func NewState

func NewState() (string, error)

func NewVerifier

func NewVerifier() (string, error)

func Save

func Save(creds Credentials) error

func SaveTo

func SaveTo(dir string, creds Credentials) error

Types

type Credentials

type Credentials struct {
	EdgeURL      string   `json:"edge_url,omitempty"`
	SessionToken string   `json:"session_token"`
	UserToken    string   `json:"user_token,omitempty"`
	UserID       string   `json:"user_id,omitempty"`
	Email        string   `json:"email,omitempty"`
	DisplayName  string   `json:"display_name,omitempty"`
	Permissions  []string `json:"permissions,omitempty"`
	Groups       []string `json:"groups,omitempty"`
	SuperUser    bool     `json:"super_user,omitempty"`
	IdleTimeout  int64    `json:"idle_timeout,omitempty"`
	ExpiryDate   string   `json:"expiry_date,omitempty"`
}

func Load

func Load() (Credentials, error)

func LoadFrom

func LoadFrom(dir string) (Credentials, error)

type Login

type Login struct {
	EdgeURL   string
	UIURL     string
	Open      func(string) error
	Stdout    io.Writer
	Stderr    io.Writer
	NoBrowser bool
}

func (Login) Run

func (l Login) Run(ctx context.Context) (Credentials, error)

Jump to

Keyboard shortcuts

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