-
Notifications
You must be signed in to change notification settings - Fork 119
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
Random string generator #5
Conversation
Hi @ryan-dyer-sp! Thanks for working on this. This looks good to me from an implementation standpoint. I have a question about the use-case, though: if generating random passwords is the goal, shouldn't it be able to guarantee at least one of each requested class of character in order to comply with password requirements? Otherwise this resource would not necessarily generate policy-compatible passwords, I think. Looking at this I also notice that the tests in this provider are all using Thanks again! |
In regards to the use case, you're right. I'm just looking to get something that's close and generic. Given a high enough length, its extremely unlikely you would encounter a string which wouldn't contain at least one lower, upper, num, and special. The use case of passwords and exact compliance would be a significantly more difficult undertaking imo. And in regards to the test, I just mimiced what the random_id was doing for tests. I cant say I'm familiar with the proper way of doing this. |
This can be used, for example, for generating passwords. Other random_ resources may not suffice due to policy reasons, such as requiring special characters.
Since this provider does not interact with external services, it's safe to run its tests as part of a normal unit testing pass, rather than requiring acceptance testing mode.
1cb63af
to
5432b98
Compare
Thanks again for this, @ryan-dyer-sp! Before merging I made a couple tweaks:
I also added the commit I made to make the tests run as unit tests, which means that they get included in the travis runs we do here for PRs. That's not directly related to your change, but it made it easier for me to verify it before merging. |
@apparentlymart Awesome. When/How is this made available? I've built it locally and using that for now, but others on team use macs (ubuntu here) and so we're dealing with how to distribute multiple compiled versions. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Random string generator which can be used in places where other random_ resources do not suffice. ie for passwords where due to compliance reasons, alphanumeric and special characters are required.