credential

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package credential handles env template parsing and credential resolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEnv

func BuildEnv(resolved []Resolved, base []string) []string

BuildEnv converts resolved credentials into environment variable assignments.

Types

type Entry

type Entry struct {
	EnvVar   string // e.g., "GITHUB_TOKEN"
	Provider string // e.g., "github"
	Resource string // e.g., "readonly" (optional, after /)
	Raw      string // e.g., "{{kontext:github}}"
}

Entry represents a single credential placeholder from the env template.

func ParseTemplate

func ParseTemplate(path string) ([]Entry, error)

ParseTemplate reads an env template file and extracts credential placeholders.

func (Entry) Target

func (e Entry) Target() string

Target returns the full provider target used for token exchange.

type Resolved

type Resolved struct {
	Entry
	Value string // The resolved credential value
}

Resolved is a credential entry with its resolved value.

Jump to

Keyboard shortcuts

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