provider/random: Add b64_std to random_id #9903
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit makes three related changes to the
random_id
resource:b64
attribute.b64_url
attribut which functions in the same manner as the originalb64
attribute.b64_std
attribute which uses standard base64 encoding for the value rather than URL encoding.Resource identifiers continue to use URL encoded base 64.
The reason for adding standard encoding of the base 64 value is to allow the use of generated values as a Serf Encryption Key for separating Consul clusters - these rely on standard encoding and do not permit some characters which are allowed by URL encoding.
b64_url
is introduced in order that there is consistency in specifying the desired encoding during interpolation.We also clean up the code for the random provider and move to using the more recent schema-provided Noop functions in preference to custom functions in the provider.
cc @sean-, @stack72