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 integration tests for signin #2363

Merged
merged 1 commit into from
Aug 23, 2017
Merged

Conversation

daviian
Copy link
Member

@daviian daviian commented Aug 23, 2017

As title.

Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
@lafriks
Copy link
Member

lafriks commented Aug 23, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Aug 23, 2017
@lafriks lafriks added this to the 1.x.x milestone Aug 23, 2017
@lunny
Copy link
Member

lunny commented Aug 23, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 23, 2017
@lafriks lafriks merged commit 8aadf79 into go-gitea:master Aug 23, 2017
@lafriks lafriks modified the milestones: 1.2.0, 1.x.x Aug 23, 2017
@daviian daviian deleted the signin-tests branch August 23, 2017 07:31
"user_name": username,
"password": password,
})
resp := session.MakeRequest(t, req, http.StatusOK)
Copy link
Member

Choose a reason for hiding this comment

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

@daviian For future reference, you can just use the MakeRequest(..) function, you don't need an empty session 😄

Copy link
Member

Choose a reason for hiding this comment

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

@ethantkoenig it is for reusing GetCSRF

Copy link
Member

Choose a reason for hiding this comment

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

@lafriks You don't need a CSRF if you're unauthenticated 😄

Copy link
Member

Choose a reason for hiding this comment

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

@ethantkoenig you need otherwise login post will fail, at least it should fail

Copy link
Member

Choose a reason for hiding this comment

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

@daviian No, you don't need a CSRF for a sign-in post, since you aren't authenticated when you are making the request.

You can try it out for yourself! Comment out line 21, and run the integration tests locally; they should still pass (they passed for me)

Copy link
Member

Choose a reason for hiding this comment

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

@ethantkoenig first of all to prevent CSRF attack ;)
http://pico.ninja/gitea-login.html - try entering your try.gitea.io username/password :P (don't worry it's not logged just to demonstrate idea)

Copy link
Member Author

Choose a reason for hiding this comment

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

But the CSRF attack will not succeed because noone's logged in yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@daviian but you will get logged in and if this is used in combination with other vulnerability it can be dangerous

Copy link
Member

Choose a reason for hiding this comment

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

@lafriks @daviian If not requiring CSRF tokens for login is a problem, let's open a issue and continue the discussion there

@daviian daviian mentioned this pull request Aug 24, 2017
7 tasks
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Feb 26, 2024
- When a event is caused by `Ctrl+Enter` jQuery might not wrap the event
and in that case `originalEvent` is not defined. Check for this case.
- Log the error along with showing an toast.
- Resolves go-gitea#2363
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants