Documentation
¶
Overview ¶
Package configsvc renders, checks, and shows the SSH config. All three modes drive the ONE renderer, so the verifier and the writer can never disagree; check changes nothing.
Index ¶
Constants ¶
const ShadowFix = "delete or rename that block, or remove those lines from it " +
"(authama does not edit content outside its managed block)"
ShadowFix says how to resolve a shadow. authama never edits content outside its managed block, so the fix is the user's to make.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckResult ¶
type CheckResult struct {
FileDiffs map[string]string
Missing []string
Orphan []string
// SSHErrors is filled only when Check ran with validateSSH; callers that
// skip the ssh leg get an empty map and an InSync that ignores it.
SSHErrors map[string]string
// Shadowed lists managed aliases that foreign content above the managed
// block takes over, so ssh does not do what the manifest says for them.
Shadowed []Shadow
// Duplicates lists Host patterns the managed files define more than once.
Duplicates []Duplicate
}
CheckResult reports config drift. InSync is the gate.
func (*CheckResult) BlockInSync ¶
func (r *CheckResult) BlockInSync() bool
BlockInSync reports whether every managed file on disk matches the manifest byte for byte - the part `config render` can fix.
func (*CheckResult) InSync ¶
func (r *CheckResult) InSync() bool
InSync reports whether the on-disk config matches the manifest and, when it was asked, whether ssh can parse it. A config ssh refuses breaks every host, so it is never in sync even when every managed byte matches. Nor is one where a foreign block ssh reads first overrides a managed alias: the bytes match, but ssh resolves something else.
type Duplicate ¶
Duplicate is a Host pattern that authama's managed files define more than once. ssh uses only the first, so the later blocks are dead weight that reads as if it applied.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service renders/checks/writes the managed config under an ~/.ssh dir.
func (*Service) Check ¶
func (s *Service) Check(validateSSH bool) (*CheckResult, error)
Check verifies the on-disk config against the manifest (read-only).
type Shadow ¶
type Shadow struct {
Alias string
File string // the config file, as a path on disk
Line int // 1-based line of the Host line (or of the first top-level option)
Header string // the Host line as written, or "(top level)"
Keywords []string
}
Shadow is a foreign block above the managed block that ssh reads first for a managed alias. ssh keeps the first value it obtains for each keyword, so every keyword in Keywords comes from the user's block, not from the manifest.