Skip to content

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
akhilgusain:fix-allowed-users-trim-lowercase
Aug 11, 2025
Merged

chore : Fix allowed users check by trimming spaces, ignoring case and improve cache restore message for clarity#7570
martinjagodic merged 2 commits intodecaporg:mainfrom
akhilgusain:fix-allowed-users-trim-lowercase

Conversation

@akhilgusain
Copy link
Copy Markdown
Contributor

@akhilgusain akhilgusain commented Aug 9, 2025

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

:)

image

@akhilgusain akhilgusain requested a review from a team as a code owner August 9, 2025 16:59
@akhilgusain akhilgusain changed the title Fix allowed users check by trimming spaces and ignoring case chore : Fix allowed users check by trimming spaces and ignoring case Aug 9, 2025
Copy link
Copy Markdown
Member

@martinjagodic martinjagodic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR includes the change from #7569, which is ok. Please update this PR's description to include info about the change in #7569, and close #7569.

@akhilgusain akhilgusain changed the title chore : Fix allowed users check by trimming spaces and ignoring case chore : Fix allowed users check by trimming spaces, ignoring case and improve cache restore message for clarity Aug 11, 2025
@akhilgusain
Copy link
Copy Markdown
Contributor Author

done. Thanks

@martinjagodic martinjagodic enabled auto-merge (squash) August 11, 2025 07:37
@martinjagodic martinjagodic merged commit 9a75cfc into decaporg:main Aug 11, 2025
11 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants