Skip to content

Ambiguous wording in docs on the parameters for RandomPassword, eg "numeric: true" can still generate a password without numerics. #434

@Sheffer

Description

@Sheffer

What happened?

Generate a password that includes upper, lower and numerics.

For numeric in the docs:
"Include numeric characters in the result. Default value is true."

I interpret this as: Passwords generated will inlude at least one numeric.

The reality seems to be that numerics are now included in the pool of available characters.

It is not guaranteed to actually be a number in the resulting password.

We had at least one case of a failed deploy due to the 30 character password was completely missing numbers.
The probability is low at 30, but increases significantly at lower length.

We mitigated this by including: minLower: 1, minNumeric: 1, minUpper: 1

Proposed change:

A: Either make the docs clear on that "true" does just add to pool and do not guarantee a char of that type.
OR
B: Change the code to always include at least one of the types (lower, upper, special, numeric) set to true.

Example

new random.RandomPassword("some-password",
{ length: 30, special: false }
)

Output of pulumi about

Version 3.87.0
Go Version go1.21.1

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docsImprovements or additions to documentationawaiting-upstreamThe issue cannot be resolved without action in another repository (may be owned by Pulumi).kind/enhancementImprovements or new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions