Documentation
¶
Overview ¶
Package credentialstore manages encrypted systemd credentials for ghalet.
Index ¶
- Constants
- func CheckPrivatePath(path string, directory bool) error
- func Directory() (string, error)
- func LockDirectory(directory string) (*os.File, error)
- func PrepareDirectory() (string, error)
- func PrepareSystemd(ctx context.Context) (string, error)
- func ProvisionSystemdAppKey(ctx context.Context, name string) error
- func ReadSystemdAppKey(ctx context.Context, name string) ([]byte, error)
- type Options
- type Result
Constants ¶
const SystemdDropInDirectory = "/etc/systemd/system/ghalet.service.d"
Variables ¶
This section is empty.
Functions ¶
func CheckPrivatePath ¶ added in v0.0.3
CheckPrivatePath verifies an owner-only file or directory owned by this user.
func Directory ¶ added in v0.0.3
Directory returns the ordinary credential directory for the current user/service.
func LockDirectory ¶ added in v0.0.3
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
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
PrepareSystemd checks systemd support and prepares its private credential store.
func ProvisionSystemdAppKey ¶ added in v0.0.4
ProvisionSystemdAppKey loads an already saved key into the service definition. The caller must hold the credential directory lock until configuration commit.
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.
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
SaveSystemdAppKey exclusively persists a new encrypted App key without configuring or reloading the service, so setup can save its resume metadata.