CSRF Protection Added#24
Open
Sharath-a26 wants to merge 5 commits intoEvolutionary-Algorithms-On-Click:mainfrom
Open
CSRF Protection Added#24Sharath-a26 wants to merge 5 commits intoEvolutionary-Algorithms-On-Click:mainfrom
Sharath-a26 wants to merge 5 commits intoEvolutionary-Algorithms-On-Click:mainfrom
Conversation
Sharath-a26
commented
Oct 29, 2025
- A 32-bit CSRF Token will be generated when logged in. Added to both response X-CSRF-Token header and to the cookie.
- Requests that are not authenticated i.e Login, Register etc. need not pass the token in header
- Created a middleware CSRFMiddleWare in util to check whether cookie and header token matches.
added 2 commits
October 29, 2025 22:40
Author
|
@Ashrockzzz2003 Please review and let me know If I need to make any changes |
Ashrockzzz2003
requested changes
Oct 29, 2025
Author
|
Sure, so if that var is set to false, the whole CSRF is disabled. Something like that right? |
Member
|
Yes |
Author
|
Done with that change @Ashrockzzz2003 |
Ashrockzzz2003
requested changes
Oct 31, 2025
Member
Ashrockzzz2003
left a comment
There was a problem hiding this comment.
Thanks Sharath
But you need to add csrf to controller/grpc/authenticate.go too as this is the function that'll be called via grpc by other microservices to authenticate requests.
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.