Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add exception to protect_from_forgery method and add skip verify_auth… #29

Merged
merged 1 commit into from
Jan 18, 2017

Conversation

GAKINDUSTRIES
Copy link
Contributor

@GAKINDUSTRIES GAKINDUSTRIES commented Jan 18, 2017

Modify the way csrf requests are handled

Trello board reference:


Description:

  • This PR intends to modify the way CSRF token is being handled for API's. I have been researching about this topic, and some argued that CSRF token should be set to null if is being used with API. Other ones argued that this modification is the correct way to handle CSRF token for API. This modification intends to ensure that the request fails to execute and trunk the workflow.

Reviewers:


Notes:


Tasks:

  • Change protect_from_forgery from null_session to exception in all API controllers

  • Add skip for verify_authenticity_token if the request format is json


Risk:

  • Medium

@matiasmansilla1989
Copy link
Contributor

@GAKINDUSTRIES Great Job!

Copy link
Contributor

@MaicolBen MaicolBen left a comment

Choose a reason for hiding this comment

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

Can't you use a concern to avoid repeated code?

@MaicolBen MaicolBen merged commit 0d6791b into master Jan 18, 2017
@MaicolBen MaicolBen deleted the enhacement/csrf_protection_for_api branch January 18, 2017 21:09
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.

3 participants