signin

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package signin signs in to model providers with each vendor's own tool (gcloud, ant, aws, az), for the Blitz service, so the credentials land where the service reads them. It adds to API keys, never replaces them: a provider set up with a key keeps it.

Index

Constants

View Source
const (
	Google    = "google"    // Gemini and Claude on Vertex AI (auth = "adc")
	Anthropic = "anthropic" // a Claude Console account (auth = "oauth")
	AWS       = "aws"       // Claude on Amazon Bedrock
	Azure     = "azure"     // Azure OpenAI and Claude on Azure (auth = "entra")
)

The providers Blitz signs in to.

Variables

View Source
var (
	// ErrUnknownProvider is a provider Blitz doesn't sign in to.
	ErrUnknownProvider = errors.New("unknown provider: use google, anthropic, aws or azure")
	// ErrBadProfile is a profile name that isn't one.
	ErrBadProfile = errors.New("a profile is letters, digits, '.', '_' and '-' (at most 64)")
	// ErrNoTool is a vendor tool that isn't installed.
	ErrNoTool = errors.New("isn't installed")
	// ErrRunning is a sign-in to a provider already under way.
	ErrRunning = errors.New("a sign-in to it is already under way")
)
View Source
var Providers = []string{Google, Anthropic, AWS, Azure}

Providers are the providers, in the order they're shown.

Functions

This section is empty.

Types

type Event

type Event struct {
	Line, URL, Code string
}

Event is a line the vendor's tool printed, with the sign-in page's URL and a device code when the line has them.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner runs sign-ins and sign-outs, one per provider at a time.

func (*Runner) SignIn

func (r *Runner) SignIn(ctx context.Context, name, profile string, on func(Event)) error

SignIn runs provider's sign-in (with profile, when given), calling on with each line its tool prints, until it ends, at most timeout. The tool opens the browser itself; the lines carry the URL (and a device code) for when it can't.

func (*Runner) SignOut

func (r *Runner) SignOut(ctx context.Context, name, profile string) error

SignOut runs provider's sign-out (with profile, when given).

type Status

type Status struct {
	Provider, Tool, Install string
	ToolFound, SignedIn     bool
	Detail                  string
}

Status is a provider's sign-in: its tool, whether it's installed (and where to get it), and whether its credentials work now, with a detail (the account, profile or file).

func StatusOf

func StatusOf(ctx context.Context, cfg *config.Config, name, profile string) (Status, error)

StatusOf checks provider's sign-in with cfg's settings (profile, when given, over the configured one). The check is local or brief: at most statusTimeout.

Jump to

Keyboard shortcuts

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