credential

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 4 Imported by: ? modules, 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 credential resolves secret values in the config, such as channel tokens and tool API keys.

Supported formats:

  • Plaintext: "sk-abc123" → returned as-is
  • File ref: "file://filename.key" → content read from configDir/filename.key
  • Empty: "" → returned as-is (a provider that needs no key)

Index

Constants

View Source
const FileScheme = "file://"

FileScheme prefixes a reference to a file, beside the config, that holds the value.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

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

Resolver resolves raw credential strings from config secret fields. File references are resolved relative to the directory of the config file.

func NewResolver

func NewResolver(configDir string) *Resolver

NewResolver returns a Resolver that resolves file:// references relative to configDir (typically filepath.Dir of the config file path).

func (*Resolver) Resolve

func (r *Resolver) Resolve(raw string) (string, error)

Resolve returns the actual credential value for raw:

  • "" → "" (no error; a provider that needs no key)
  • "file://name.key" → trimmed content of configDir/name.key
  • anything else → raw unchanged (plaintext credential)

Jump to

Keyboard shortcuts

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