Documentation
¶
Overview ¶
Package checklist answers, for anything authama can revoke (an SSH key, an auth token), where it is used and what is left to do to rotate or revoke it completely. Steps authama can see for itself (a key file on disk, a target it was removed from, a token still in a tool's file) are worked out each time; the ones it cannot see (the token's issuer, a copy in Termius, a CI secret) are ticked by hand, and those ticks are kept in the state directory.
An item is a key or a token. A key's checklist follows its life: while in use it lists where the key is, and once revoked or replaced by a rotation it lists what still has to go. A token has no revoked state of its own, so its revocation checklist starts when you say you are revoking it.
Index ¶
Constants ¶
const ( // InUse lists where an item is, and that each place is sound. InUse = "in-use" // Revoking is a token whose revocation has been started. Revoking = "revoking" // Revoked is a key revoked with `authama ssh key revoke`. Revoked = "revoked" // Retired is a key a rotation replaced, kept in old/ for rollback. Retired = "retired" )
Modes an item's checklist is in.
const ( KindKey = "key" KindToken = "token" )
Kinds of item.
Variables ¶
var ErrNotFound = errors.New("no key or token by that name")
ErrNotFound is an item id that names nothing authama knows.
Functions ¶
Types ¶
type Checklist ¶
type Checklist struct {
Kind string `json:"kind"`
ID string `json:"id"` // key:<fingerprint or profile/key>, token:<target>/<host>
Name string `json:"name"` // profile/key, or "<target> <host>"
Mode string `json:"mode"`
Fingerprint string `json:"fingerprint,omitempty"`
Since string `json:"since,omitempty"` // when it was revoked, retired or its revocation started
Steps []Step `json:"steps"`
}
Checklist is one item's steps.
type Service ¶
type Service struct {
P paths.Paths
// Now is the clock, for expiry and for the date a step is ticked.
Now func() time.Time
// AgentFingerprints lists the fingerprints ssh-agent holds; ok is false
// when there is no agent to ask. Replaced in tests.
AgentFingerprints func() (fps map[string]bool, ok bool)
// Getenv reads the environment, for whether a token's variable is set.
Getenv func(string) string
}
Service builds checklists for one authama home.
func (*Service) All ¶
All is every key's and token's checklist: keys in manifest order, then retired and revoked keys, then tokens by target and host.
func (*Service) SetRevoking ¶
SetRevoking starts (on) or stops a token's revocation checklist. A key's follows its own state, so this is for tokens only.
type Step ¶
type Step struct {
ID string `json:"id"`
Group string `json:"group"` // the heading it is shown under
Title string `json:"title"`
Detail string `json:"detail,omitempty"`
State State `json:"state"`
// Manual steps are ones authama cannot see: the person ticks them.
Manual bool `json:"manual,omitempty"`
// Ticked is when a manual step was ticked, "" when it was not.
Ticked string `json:"ticked,omitempty"`
// Fix is the authama (or other) command that does the step.
Fix string `json:"fix,omitempty"`
// Link is where the step is done by hand.
Link string `json:"link,omitempty"`
}
Step is one thing to check or do.