graphite

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package graphite implements a credential provider for the Graphite CLI (gt).

Graphite is a stacked-PR workflow tool. The CLI stores its auth token in ~/.config/graphite/user_config and sends it as "Authorization: token <token>" to api.graphite.com. All GitHub operations are proxied through Graphite's server.

At container startup, moat-init.sh writes a config file with a placeholder token. The proxy intercepts requests to api.graphite.com and replaces the placeholder with the real token.

Index

Constants

View Source
const (
	SourceEnv    = "env"    // From GRAPHITE_TOKEN or GT_TOKEN env var
	SourceManual = "manual" // Interactive prompt entry
)

Token source values stored in Credential.Metadata[provider.MetaKeyTokenSource].

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{}

Provider implements provider.CredentialProvider for Graphite.

func (*Provider) Cleanup

func (p *Provider) Cleanup(cleanupPath string)

Cleanup is a no-op — no temp files are created.

func (*Provider) ConfigureProxy

func (p *Provider) ConfigureProxy(proxy provider.ProxyConfigurer, cred *provider.Credential)

ConfigureProxy sets up proxy headers for Graphite API requests. The Graphite CLI uses "Authorization: token <token>" (not Bearer).

func (*Provider) ContainerEnv

func (p *Provider) ContainerEnv(cred *provider.Credential) []string

ContainerEnv returns environment variables for the container.

func (*Provider) ContainerInitFiles

func (p *Provider) ContainerInitFiles(cred *provider.Credential, containerHome string) map[string]string

ContainerInitFiles returns config files to write into the container at startup. The Graphite CLI reads its auth token from ~/.config/graphite/user_config.

func (*Provider) ContainerMounts

func (p *Provider) ContainerMounts(cred *provider.Credential, containerHome string) ([]provider.MountConfig, string, error)

ContainerMounts returns no mounts — config is written via moat-init.sh.

func (*Provider) Grant

func (p *Provider) Grant(ctx context.Context) (*provider.Credential, error)

Grant acquires Graphite credentials interactively or from environment.

Token acquisition order:

  1. GRAPHITE_TOKEN or GT_TOKEN environment variable
  2. Interactive token prompt

func (*Provider) ImpliedDependencies

func (p *Provider) ImpliedDependencies() []string

ImpliedDependencies returns dependencies implied by this provider.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider identifier.

Jump to

Keyboard shortcuts

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