auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDir string

ConfigDir overrides the config directory for testing. If empty, os.UserConfigDir() is used.

Functions

func ResolveToken

func ResolveToken(host string) (token, source string)

ResolveToken tries to find a GitHub token for the given host. It checks in order: env vars (GH_TOKEN/GITHUB_TOKEN), gh CLI config, jip config. Returns the token and a human-readable source description.

func SaveToken

func SaveToken(host, token string) error

SaveToken stores an OAuth token for the given host.

Types

type Config

type Config map[string]HostConfig

Config maps hostnames to their auth config.

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig reads the jip config file.

type HostConfig

type HostConfig struct {
	OAuthToken string `json:"oauth_token"`
}

HostConfig holds auth credentials for a single GitHub host.

Jump to

Keyboard shortcuts

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