credentialstore

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 22 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 credentialstore manages encrypted systemd credentials for ghalet.

Index

Constants

View Source
const SystemdDropInDirectory = "/etc/systemd/system/ghalet.service.d"

Variables

This section is empty.

Functions

func CheckPrivatePath added in v0.0.3

func CheckPrivatePath(path string, directory bool) error

CheckPrivatePath verifies an owner-only file or directory owned by this user.

func Directory added in v0.0.3

func Directory() (string, error)

Directory returns the ordinary credential directory for the current user/service.

func LockDirectory added in v0.0.3

func LockDirectory(directory string) (*os.File, error)

LockDirectory prevents ordinary credential replacement until the returned file is closed. Acquire it before a configuration lock when using both.

func PrepareDirectory added in v0.0.3

func PrepareDirectory() (string, error)

PrepareDirectory creates a private credential directory without making new state ancestors inaccessible to a separate runner execution user.

func PrepareSystemd added in v0.0.4

func PrepareSystemd(ctx context.Context) (string, error)

PrepareSystemd checks systemd support and prepares its private credential store.

func ProvisionSystemdAppKey added in v0.0.4

func ProvisionSystemdAppKey(ctx context.Context, name string) error

ProvisionSystemdAppKey loads an already saved key into the service definition. The caller must hold the credential directory lock until configuration commit.

func ReadSystemdAppKey added in v0.0.4

func ReadSystemdAppKey(ctx context.Context, name string) ([]byte, error)

ReadSystemdAppKey decrypts and validates an App key without printing it.

Types

type Options

type Options struct {
	Name, Type, File, Config, ClientID string
	InstallationID                     int64
	Prompt, Stdin, NoDefault           bool
	PromptOutput                       io.Writer
	NoReplace                          bool
}

Options selects a credential and its explicit secret input source.

func (Options) Validate

func (options Options) Validate() error

Validate checks the credential identity and input source selection.

type Result

type Result struct {
	EncryptedPath, DropInPath, RuntimePath, PreviousPath string
	ManagedPath                                          string
}

Result describes the files installed by a successful registration.

func SaveSystemdAppKey added in v0.0.4

func SaveSystemdAppKey(ctx context.Context, options Options, input io.Reader) (Result, error)

SaveSystemdAppKey exclusively persists a new encrypted App key without configuring or reloading the service, so setup can save its resume metadata.

func Set

func Set(ctx context.Context, options Options, input io.Reader) (Result, error)

Set encrypts and registers a credential for the system ghalet service. It reloads systemd configuration but never starts or restarts the service. input supplies the secret stream or, for Prompt, the caller's terminal.

func SetFile added in v0.0.3

func SetFile(ctx context.Context, options Options, input io.Reader) (Result, error)

SetFile registers an owner-only, unencrypted credential without changing a daemon.

Jump to

Keyboard shortcuts

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