chore : Fix allowed users check by trimming spaces, ignoring case and improve cache restore message for clarity#7570
Merged
martinjagodic merged 2 commits intodecaporg:mainfrom Aug 11, 2025
Conversation
1 task
Contributor
Author
|
done. Thanks |
martinjagodic
approved these changes
Aug 11, 2025
martinjagodic
pushed a commit
to poslovnimediji/decap-cms
that referenced
this pull request
Sep 4, 2025
… improve cache restore message for clarity (decaporg#7570) * chore: improve cache restore message for clarity * Ensure allowed users check is case-insensitive and trims spaces
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This change ensures that when ALLOWED_USERS is split, each user ID is trimmed of whitespace and compared in a case-insensitive manner.
Previously, extra spaces or mismatched casing in the environment variable could prevent valid users from being recognized.
Improved the cache restore log message in the build configuration.
Replaced echo noop with a more descriptive message:
echo "No operation needed — cache intact".
This makes CI/CD logs clearer, helping developers quickly understand that the cache step was executed successfully but no rebuild was needed.
Test plan
Set ALLOWED_USERS=" U12345 ,u67890 " in .env.
Trigger a request with user_id="U12345" and user_id="u67890" — both should match successfully.
Trigger a request with an unauthorized user_id and confirm it is blocked.
Verify no change in functionality for already matching, correctly formatted user IDs.
Ran the build process with the updated message.
Verified that the new log text appears in the build output without affecting cache functionality.
Confirmed no side effects on cache restore behavior.
Checklist
:)