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

Prevent creating empty sessions #6677

Merged
merged 13 commits into from Apr 20, 2019

Conversation

@zeripath
Copy link
Contributor

commented Apr 19, 2019

Signed-off-by: Andrew Thornton art27@cantab.net

Prevent creating empty sessions
Signed-off-by: Andrew Thornton <art27@cantab.net>

@zeripath zeripath requested review from go-gitea/maintainers Apr 19, 2019

@zeripath zeripath added this to the 1.9.0 milestone Apr 19, 2019

modules/setting/session.go Outdated Show resolved Hide resolved
modules/setting/session.go Outdated Show resolved Hide resolved

zeripath added some commits Apr 19, 2019

Remove unnecessary option
Signed-off-by: Andrew Thornton <art27@cantab.net>
Merge branch 'prevent-creating-empty-sessions' of github.com:zeripath…
…/gitea into prevent-creating-empty-sessions

@zeripath zeripath requested a review from lunny Apr 19, 2019

@codecov-io

This comment has been minimized.

Copy link

commented Apr 19, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@b74dc97). Click here to learn what that means.
The diff coverage is 56.14%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #6677   +/-   ##
=========================================
  Coverage          ?   40.87%           
=========================================
  Files             ?      420           
  Lines             ?    57454           
  Branches          ?        0           
=========================================
  Hits              ?    23486           
  Misses            ?    30841           
  Partials          ?     3127
Impacted Files Coverage Δ
modules/session/virtual.go 56.07% <56.07%> (ø)
modules/setting/session.go 85.71% <57.14%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b74dc97...901bd2a. Read the comment docs.

@lunny

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

Could you add some integration tests to confirm the unlogin page didn't create session but logined page did?

@zeripath

This comment has been minimized.

Copy link
Contributor Author

commented Apr 19, 2019

@lunny it seems that's not an easy thing to do. Our integration tests run with the memory session provider which does not appear to be interrogatable.

However, I've done it.

Add test to ensure that sessions are not created without being logged in
Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath

This comment has been minimized.

Copy link
Contributor Author

commented Apr 19, 2019

Tests are up. And they broke the rest of the tests... That'll teach me to just test the single tests themselves...

fix tests
Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath

This comment has been minimized.

Copy link
Contributor Author

commented Apr 19, 2019

Tests now working.

@GiteaBot GiteaBot added lgtm/need 1 and removed lgtm/need 2 labels Apr 19, 2019

@lunny

lunny approved these changes Apr 20, 2019

@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Apr 20, 2019

@lunny

This comment has been minimized.

Copy link
Member

commented Apr 20, 2019

@zeripath thanks

@zeripath zeripath merged commit b33f7f7 into go-gitea:master Apr 20, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr Build is passing
Details

@zeripath zeripath deleted the zeripath:prevent-creating-empty-sessions branch Apr 20, 2019

zeripath added a commit to zeripath/gitea that referenced this pull request Apr 20, 2019

Prevent creating empty sessions (go-gitea#6677)
* Prevent creating empty sessions

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update modules/setting/session.go

* Remove unnecessary option

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add destory to list of ignored misspellings

* rename cookie.go -> virtual.go

* Delete old file

* Add test to ensure that sessions are not created without being logged in

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix tests

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update integrations/create_no_session_test.go

zeripath added a commit that referenced this pull request Apr 20, 2019

Prevent creating empty sessions (#6677) (#6690)
Backport #6677 

Signed-off-by: Andrew Thornton <art27@cantab.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.