auth

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthHeader

func GetAuthHeader() (string, error)

GetAuthHeader returns the authorization header value. Precedence: LINCTL_API_KEY env var > pass (when LINCTL_PASS_NAME set) > config file.

func Login

func Login(plaintext, jsonOut bool) error

Login handles the authentication flow

func Logout

func Logout() error

Logout clears stored credentials. When LINCTL_PASS_NAME is set, the pass entry is removed; the legacy JSON file is also removed if present so a future re-login starts from a clean slate.

Types

type AuthConfig

type AuthConfig struct {
	APIKey string `json:"api_key,omitempty"`
}

type User

type User struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Email     string `json:"email"`
	AvatarURL string `json:"avatarUrl,omitempty"`
}

func GetCurrentUser

func GetCurrentUser() (*User, error)

GetCurrentUser returns the current authenticated user

Jump to

Keyboard shortcuts

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