(MODULES-1715) Add FQDN-based random string generator#405
(MODULES-1715) Add FQDN-based random string generator#405hunner merged 1 commit intopuppetlabs:masterfrom
Conversation
|
As a side note, the performance of these (especially |
|
I have added acceptance tests for the new functions. Let me know if I should squash some/all of these commits. |
f0d23c0 to
cafdad5
Compare
|
It occurred to me that I didn't document the functions in the README, so I fixed that. I squashed it into the first commit and squashed the two test commits together as well. |
7b4d900 to
2c9da0f
Compare
|
The test failures are due to the release of rspec 3.2.0, which breaks some things. |
93406c7 to
d670665
Compare
|
Rebased onto master, so tests should pass soon. |
d670665 to
52bfccb
Compare
|
I went ahead and squashed this down into one commit. |
|
I can see random numbers and strings... but why base64? |
|
Among other things, it can be used to generate password salts. The POSIX spec says that the valid character set for password hash salts is a slightly-modified base64 ( |
|
But now you're asking us to include a base64 implementation which cannot be used for the salts according to the POSIX spec. You're countering your own point here. |
|
I'd actually rather have |
|
Good points. I'll modify |
c6a0f1b to
c00d221
Compare
c00d221 to
a82266c
Compare
(MODULES-1715) Add FQDN-based random string generator
This fixes the acceptance tests by: - Ensuring the fqdn_rand spec is passed undef as the second parameter so that the seed is not used as the charset - Ensuring the pw_hash spec is passed the key specifying the type of hash, rather than the value that will be used to generate the password - Removing the fqdn_rand_base64 test because there is no such function
This fixes the acceptance tests by: - Ensuring the fqdn_rand_string spec is passed undef as the second parameter so that the seed is not used as the charset - Ensuring the pw_hash spec is passed the key specifying the type of hash, rather than the value that will be used to generate the password - Expecting puppet to report nil instead of empty string for undef passwords - Removing the fqdn_rand_base64 test because there is no such function
As requested in MODULES-1715, this PR provides
fqdn_rand_string(), which generates random alphanumeric strings of the desired length. It also providesfqdn_rand_base64(), which generates random base64 strings of the desired length.