Skip to content

[BUGFIX] Fixed max length check for strings in create/wizard #3056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

GLobyNew
Copy link
Contributor

My first real pull request for this project.

tldr: if you create a custom .yaml with max attribute for string, for example:

---
priority: 1
name: "Bank Card"
prefix: "cards"
name_from:
  - "bankname"
welcome: "🧪 Creating Bank Card entry"
attributes:
  - name: "bankname"
    type: "string"
    prompt: "Bank Name"
    min: 1
    max: 255

It will fail check for max length all the time:

🌟 Welcome to the secret creation wizard (gopass create)!
🧪 Hint: Use 'gopass edit -c' for more control!
[ 0] Website login
[ 1] Bank Card

Please select the type of secret you would like to create (q to abort) [0]: 1
1
🧪 Creating Bank Card entry
  [1] Bank Name                              []: Test
❌ bankname is too long (at most 255)

Turns out wizard was checking v.Min value instead of v.Max
Now works as expected.
All internal tests were passed.

@dominikschulz
Copy link
Member

Oh, that's a nice find. Thank you!

@dominikschulz dominikschulz merged commit cc901b8 into gopasspw:master Feb 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants