config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCertificateValidityMinutes is the default duration for ephemeral certificates
	DefaultCertificateValidityMinutes = 5
)

Variables

This section is empty.

Functions

func DefaultHome

func DefaultHome() string

DefaultHome is an alias for GetDefaultHome for backward compatibility

func GetDefaultHome

func GetDefaultHome() string

GetDefaultHome returns the default path for the .signet directory

Types

type Config

type Config struct {
	// Home is the path to the .signet directory
	Home string

	// IssuerDID is the DID of the signer
	IssuerDID string

	// CertificateValidityMinutes is the duration for ephemeral certificates
	CertificateValidityMinutes int

	// Algorithm is the signing algorithm to use (default: "ed25519").
	// Supported values: "ed25519", "ml-dsa-44".
	Algorithm string
}

Config holds the configuration for Signet CLI

func Default

func Default() *Config

Default returns the default configuration

func Load

func Load() (*Config, error)

Load loads configuration from environment variables and defaults Priority: env vars > defaults

func New

func New(home string) *Config

New creates a new Config with the given home directory

func (*Config) EnsureHome

func (c *Config) EnsureHome() error

EnsureHome creates the .signet directory if it doesn't exist

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid

func (*Config) ValidateHomePathRuntime

func (c *Config) ValidateHomePathRuntime() error

ValidateHomePathRuntime performs runtime validation of the home directory path. This should be called before any operation that uses the home directory to prevent TOCTOU (Time-of-Check-Time-of-Use) attacks where a path could be changed after initial validation but before use.

Jump to

Keyboard shortcuts

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