This repository was archived by the owner on Jan 26, 2025. It is now read-only.
Changing createCacheKey to replace _any_ characters that violate file naming standards#135
Open
shazaman23 wants to merge 1 commit intookta:developfrom
Open
Changing createCacheKey to replace _any_ characters that violate file naming standards#135shazaman23 wants to merge 1 commit intookta:developfrom
shazaman23 wants to merge 1 commit intookta:developfrom
Conversation
…e file naming standards instead of just the handful of characters that were being replaced by default.
Contributor
|
Thank you for the PR! This looks great. Just to cover our bases, could you please send in a CLA? you can find it over at developer.okta.com/cla. This MAY fall into "Obvious Fix" category, but I would like to have one anyway. |
bretterer
approved these changes
Nov 4, 2021
Author
|
I sent an email with an attached PDF of the CLA to this email address earlier today: Did it not come through? |
Author
|
Just got confirmation on my signed CLA. @robertdamphousse-okta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
By default this tool uses a cache pool that creates local files for caching. The existing implementation covers PSR-6 requirements, but there are some issues that can occur when using the defaults if some bad characters are in the URI used to form the cache key (which is used as the filename).
For example, assume an Okta instance of testing.oktapreview.com with a user of
test**7@test.com. By making a get for that user with this library, the URI will betesting.oktapreview.com/api/v1/users/test**7@test.com. Based off of the existing code, this name will get transformed to a cache key oftesting_oktapreview_com_api_v1_users_test**7_test_comwhich is an invalid file name.The change I propose would use the regex for valid filenames by default to create cache keys. Under this setup, the cache key would instead be
testing_oktapreview_com_api_v1_users_test__7_test_comwhich would be valid.Note: There are still going to be some problems if people include lots of the invalid characters in their usernames because you could have collisions. For example, user of
test**7@test.comandtest++7@test.comwould both hit the same cache keytesting_oktapreview_com_api_v1_users_test__7_test_com