Skip to content
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

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

Open
Sheffer opened this issue Oct 9, 2023 · 2 comments
Labels
area/docs Improvements or additions to documentation awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/enhancement Improvements or new features

Comments

@Sheffer
Copy link

Sheffer commented Oct 9, 2023

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).

@Sheffer Sheffer added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 9, 2023
@Sheffer Sheffer changed the title Ambiguous wording on the parameters for RandomPassword, ex numeric: true can still generate a password without numerics. Ambiguous wording in docs on the parameters for RandomPassword, ex numeric: true can still generate a password without numerics. Oct 9, 2023
@Sheffer Sheffer changed the title Ambiguous wording in docs on the parameters for RandomPassword, ex numeric: true can still generate a password without numerics. Ambiguous wording in docs on the parameters for RandomPassword, eg "numeric: true" can still generate a password without numerics. Oct 9, 2023
@mikhailshilkov mikhailshilkov added kind/enhancement Improvements or new features area/docs Improvements or additions to documentation and removed kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 9, 2023
@mikhailshilkov
Copy link
Member

Hi @Sheffer thank you for reporting this issue.

The Pulumi Random provider is a bridged provider based on https://github.com/hashicorp/terraform-provider-random/issues. Do you mind opening an issue upstream? If they change the wording, we will automatically inherit it from there.

@mikhailshilkov mikhailshilkov added the awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). label Oct 9, 2023
@Sheffer
Copy link
Author

Sheffer commented Oct 10, 2023

Done
hashicorp/terraform-provider-random#475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Improvements or additions to documentation awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants