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
- type Provider
- func (p *Provider) Cleanup(cleanupPath string)
- func (p *Provider) ConfigureProxy(proxy provider.ProxyConfigurer, cred *provider.Credential)
- func (p *Provider) ContainerEnv(cred *provider.Credential) []string
- func (p *Provider) ContainerInitFiles(cred *provider.Credential, containerHome string) map[string]string
- func (p *Provider) ContainerMounts(cred *provider.Credential, containerHome string) ([]provider.MountConfig, string, error)
- func (p *Provider) Grant(ctx context.Context) (*provider.Credential, error)
- func (p *Provider) ImpliedDependencies() []string
- func (p *Provider) Name() string
Constants ¶
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) 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 ¶
Grant acquires Graphite credentials interactively or from environment.
Token acquisition order:
- GRAPHITE_TOKEN or GT_TOKEN environment variable
- Interactive token prompt
func (*Provider) ImpliedDependencies ¶
ImpliedDependencies returns dependencies implied by this provider.