auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAuthenticated = errors.New("not authenticated")

ErrNotAuthenticated is returned when user is not authenticated

Functions

func CheckAuth added in v0.1.11

func CheckAuth() error

CheckAuth checks if user is authenticated and prompts to login if not

func GetToken

func GetToken() (string, error)

GetToken returns the stored GitHub token

func Login

func Login() (string, error)

Login performs GitHub OAuth device flow login

func Logout

func Logout() error

Logout removes stored credentials

func RemoveToken added in v0.1.11

func RemoveToken() error

RemoveToken removes the token from keyring

func SaveToken added in v0.1.11

func SaveToken(username, token string) error

SaveToken saves the token to keyring

Types

type Status added in v0.1.3

type Status struct {
	Username     string
	Token        string
	TokenDisplay string
	StorageType  string
	IsKeyring    bool
	Scopes       []string
	Active       bool
}

Status represents the current authentication status

func GetStatus added in v0.1.3

func GetStatus() ([]*Status, error)

GetStatus returns the current authentication status

Jump to

Keyboard shortcuts

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