Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the top-level bubbletea model for the init TUI.
func (Model) Enrollments ¶
func (m Model) Enrollments() []enrollment.Enrollment
Enrollments returns the completed enrollments.
type RekeyAppExit ¶
type RekeyAppExit int
RekeyAppExit is what the parent command needs after RekeyAppModel finishes.
const ( RekeyAppExitSuccess RekeyAppExit = iota // new profile written RekeyAppExitCanceled // user dismissed without writing RekeyAppExitFallbackCLI // unsupported provider for TUI unlock; run CLI flow with Plan RekeyAppExitError // something blew up; see Err() )
type RekeyAppModel ¶
type RekeyAppModel struct {
// contains filtered or unexported fields
}
RekeyAppModel is the top-level bubbletea model for rekey. It owns the full lifecycle: plan → unlock → fill-in → enroll → write. Provider interactions compose the enroll*/unlock* sub-models. Unsupported providers (for example, FIDO2 in the unlock phase — its sub-model isn't written yet) cause the model to exit with RekeyAppExitFallbackCLI so the rekey command can run the tested line-based flow instead.
func NewRekeyApp ¶
NewRekeyApp constructs the top-level rekey TUI model.
func (RekeyAppModel) Err ¶
func (m RekeyAppModel) Err() error
Err returns any fatal error. Valid when Exit() == RekeyAppExitError.
func (RekeyAppModel) Exit ¶
func (m RekeyAppModel) Exit() RekeyAppExit
Exit is the post-run signal the command should branch on.
func (RekeyAppModel) Init ¶
func (m RekeyAppModel) Init() tea.Cmd
func (RekeyAppModel) Plan ¶
func (m RekeyAppModel) Plan() RekeyPlan
Plan returns the resolved plan from the planning phase. Useful when Exit() == RekeyAppExitFallbackCLI so the command can run the CLI flow with the same plan the user confirmed.
func (RekeyAppModel) View ¶
func (m RekeyAppModel) View() tea.View
type RekeyModel ¶
type RekeyModel struct {
// contains filtered or unexported fields
}
RekeyModel is the bubbletea model for the planning step of `cryptkey rekey`.
The model is intentionally limited to the *planning* phase: review the existing provider set, toggle keep/remove, choose a new threshold, and queue type-only adds. After the user confirms, the rekey command exits the TUI and runs the actual unlock + enroll + write phases through the regular terminal so the polished masked-prompt UX from `derive` carries over without being re-implemented inside bubbletea.
func NewRekey ¶
func NewRekey(profileName string, p *config.Profile) RekeyModel
NewRekey builds a rekey TUI model seeded from an existing profile.
func (RekeyModel) Canceled ¶
func (m RekeyModel) Canceled() bool
Canceled reports true if the user dismissed the TUI without confirming.
func (RekeyModel) Plan ¶
func (m RekeyModel) Plan() RekeyPlan
Plan returns the resolved rekey plan after Update has reached the done state. Calling Plan in any other state returns a zero value.
type RekeyPlan ¶
type RekeyPlan struct {
Threshold int // new threshold; always populated
Keep []string // providers (type:id) explicitly kept
Remove []string // providers (type:id) the user toggled off
Add []string // provider type names to enroll fresh
}
RekeyPlan is the planning result returned by the rekey TUI.