-
-
Notifications
You must be signed in to change notification settings - Fork 523
Description
Summary
The min
& max
options for the wizard attributes of gopass create
appear to be unimplemented and seem to have no effect.
gopass/internal/create/wizard.go
Lines 35 to 42 in 16c071a
type Attribute struct { | |
Name string `yaml:"name"` | |
Type string `yaml:"type"` | |
Prompt string `yaml:"prompt"` | |
Charset string `yaml:"charset"` | |
Min int `yaml:"min"` | |
Max int `yaml:"max"` | |
} |
Steps To Reproduce
- Invoke
gopass create
- Select the stock "PIN Code (numerical)" template when prompted
- When prompted for "Authority (Issuer)" press enter without providing any input
- Observe that the template attribute's minimum length requirement was not respected
gopass/internal/create/wizard.go
Lines 99 to 106 in 16c071a
Welcome: "🔑 Creating PIN Code", | |
Attributes: []Attribute{ | |
{ | |
Name: "authority", | |
Type: "string", | |
Prompt: "Authority (Issuer)", | |
Min: 1, | |
}, |
Expected behavior
Because the authority attribute specifies a minimum length of 1, the wizard should immediately abort when given an input value that is too short (and vice versa for the max attribute).
The ergonomics and implementation should essentially be the same as the current wizard behavior for when a hostname cannot be extracted on an attribute of the hostname
type
gopass/internal/create/wizard.go
Lines 234 to 237 in 16c071a
hostname = extractHostname(sv) | |
if hostname == "" { | |
return fmt.Errorf("can not parse URL %s", sv) | |
} |
Environment
- OS: Manjaro Linux (Stable)
- OS version:
Linux chao-desktop 5.15.55-1-MANJARO #1 SMP PREEMPT Fri Jul 15 09:45:39 UTC 2022 x86_64 GNU/Linux
- gopass Version:
gopass 1.14.3 go1.18.3 linux amd64
- Installation method: Arch community repository via pacman