Skip to content

[FR] Support strict character class enforcement in create templates #3350

Closed

Description

@3dyuval

Problem

The gopass generate --strict flag ensures generated passwords contain at least one character from each enabled class (uppercase, lowercase, digit, symbol). However, there's no equivalent option in gopass create templates.

Currently, template password attributes support charset and min/max, but there's no way to guarantee that each character class within the charset is actually represented in the generated password.

Take this for example:

- name: "password"
  type: "password"
  charset: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&*"
  min: 10

it may generate a password with no uppercase, no digit, or no symbol - which would fail most real-world password validation forms.

Proposed solution!

Add a strict: true option for password attributes in .gopass/create/*.yml templates:

- name: "password"
  type: "password"
  charset: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&*"
  min: 10
  strict: true

This would match the behavior of gopass generate --strict, ensuring at least one character from each character class (uppercase, lowercase, digit, symbol) is present in the generated password.

Activity

  1. self-assigned this
    on Mar 3, 2026
  2. added 3 commits that reference this issue on Mar 3, 2026
    4947185
    2559641
    25b10c1
  3. added a commit that references this issue on Mar 11, 2026
    0529c84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址