fix: close Ticket 11 hardening review gaps
This commit is contained in:
+15
-7
@@ -63,9 +63,11 @@ func (p terminalPresentation) mainView(model presentationState, width, height in
|
||||
}
|
||||
page.dashboard = nil
|
||||
page.primary = dialog.view()
|
||||
page.primaryOffset = dialog.offset
|
||||
page.focusLine = -1
|
||||
page.wrapPrimary = true
|
||||
page.context = "Cancellation is selected by default."
|
||||
page.footer = "←/→/Tab: choose y: confirm Enter: choose\nn/q/Esc: cancel ?: help"
|
||||
page.footer = "←/→/Tab: choose PgUp/PgDn: scroll y: confirm Enter: choose\nn/q/Esc: cancel ?: help"
|
||||
}
|
||||
return page
|
||||
}
|
||||
@@ -177,11 +179,12 @@ func (p terminalPresentation) profilesView(model presentationState) terminalPage
|
||||
}
|
||||
if model.profileDelete != nil {
|
||||
return terminalPage{
|
||||
header: p.theme.title.Render("Proxy Profile management"),
|
||||
primary: model.profileDelete.dialog.view(),
|
||||
wrapPrimary: true,
|
||||
footer: "←/→/Tab: choose Enter: choose y: delete\nn/q/Esc: cancel ?: help",
|
||||
focusLine: -1,
|
||||
header: p.theme.title.Render("Proxy Profile management"),
|
||||
primary: model.profileDelete.dialog.view(),
|
||||
primaryOffset: model.profileDelete.dialog.offset,
|
||||
wrapPrimary: true,
|
||||
footer: "←/→/Tab: choose PgUp/PgDn: scroll Enter: choose y: delete\nn/q/Esc: cancel ?: help",
|
||||
focusLine: -1,
|
||||
}
|
||||
}
|
||||
return terminalPage{
|
||||
@@ -196,6 +199,10 @@ func (p terminalPresentation) profilesView(model presentationState) terminalPage
|
||||
}
|
||||
}
|
||||
|
||||
func sanitizeFormText(value string) string {
|
||||
return sanitizeUntrustedControls(profile.RedactUserinfoText(value))
|
||||
}
|
||||
|
||||
func selectedProfileDetails(p terminalPresentation, model presentationState) string {
|
||||
selected, ok := profileAt(model.snapshot, model.selected)
|
||||
if !ok {
|
||||
@@ -259,6 +266,7 @@ func (p terminalPresentation) formView(model presentationState) terminalPage {
|
||||
validation = conflict
|
||||
}
|
||||
}
|
||||
validation = sanitizeFormText(validation)
|
||||
if validation != "" {
|
||||
fmt.Fprintf(&fields, "\n Error: %s", validation)
|
||||
currentLine++
|
||||
@@ -270,7 +278,7 @@ func (p terminalPresentation) formView(model presentationState) terminalPage {
|
||||
bypassPreview.WriteString(" (none)")
|
||||
} else {
|
||||
for _, line := range analysis {
|
||||
bypassPreview.WriteString("\n " + line)
|
||||
bypassPreview.WriteString("\n " + sanitizeFormText(line))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user