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

Signed-off-by: Andrew Thornton [email protected]

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath requested review from a team April 19, 2019 12:29
@zeripath zeripath added this to the 1.9.0 milestone Apr 19, 2019
modules/setting/session.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 19, 2019
modules/setting/session.go Outdated Show resolved Hide resolved
@zeripath zeripath requested a review from lunny April 19, 2019 15:00
@codecov-io
Copy link

codecov-io 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
Copy link
Member

lunny commented Apr 19, 2019

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

@zeripath
Copy link
Contributor Author

zeripath 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.

@zeripath
Copy link
Contributor Author

zeripath 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...

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath
Copy link
Contributor Author

Tests now working.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 19, 2019
@GiteaBot GiteaBot 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 Apr 20, 2019
@lunny
Copy link
Member

lunny commented Apr 20, 2019

@zeripath thanks

@zeripath zeripath merged commit b33f7f7 into go-gitea:master Apr 20, 2019
@zeripath zeripath deleted the prevent-creating-empty-sessions branch April 20, 2019 06:45
zeripath added a commit to zeripath/gitea that referenced this pull request Apr 20, 2019
* Prevent creating empty sessions

Signed-off-by: Andrew Thornton <[email protected]>

* Update modules/setting/session.go

* Remove unnecessary option

Signed-off-by: Andrew Thornton <[email protected]>

* 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 <[email protected]>

* fix tests

Signed-off-by: Andrew Thornton <[email protected]>

* Update integrations/create_no_session_test.go
zeripath added a commit that referenced this pull request Apr 20, 2019
@techknowlogick techknowlogick added the backport/done All backports for this PR have been created label May 6, 2019
techknowlogick added a commit that referenced this pull request Jun 5, 2020
* Dump: Use mholt/archive/v3 to support tar including many compressions

Signed-off-by: Philipp Homann <[email protected]>

* Dump: Allow dump output to stdout

Signed-off-by: Philipp Homann <[email protected]>

* Dump: Fixed bug present since #6677 where SessionConfig.Provider is never "file"

Signed-off-by: Philipp Homann <[email protected]>

* Dump: never pack RepoRootPath, LFS.ContentPath and LogRootPath when they are below AppDataPath

Signed-off-by: Philipp Homann <[email protected]>

* Dump: also dump LFS (fixes #10058)

Signed-off-by: Philipp Homann <[email protected]>

* Dump: never dump CustomPath if CustomPath is a subdir of or equal to AppDataPath (fixes #10365)

Signed-off-by: Philipp Homann <[email protected]>

* Use log.Info instead of fmt.Fprintf

Signed-off-by: Philipp Homann <[email protected]>

* import ordering

* make fmt

Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Matti R <[email protected]>
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
* Dump: Use mholt/archive/v3 to support tar including many compressions

Signed-off-by: Philipp Homann <[email protected]>

* Dump: Allow dump output to stdout

Signed-off-by: Philipp Homann <[email protected]>

* Dump: Fixed bug present since go-gitea#6677 where SessionConfig.Provider is never "file"

Signed-off-by: Philipp Homann <[email protected]>

* Dump: never pack RepoRootPath, LFS.ContentPath and LogRootPath when they are below AppDataPath

Signed-off-by: Philipp Homann <[email protected]>

* Dump: also dump LFS (fixes go-gitea#10058)

Signed-off-by: Philipp Homann <[email protected]>

* Dump: never dump CustomPath if CustomPath is a subdir of or equal to AppDataPath (fixes go-gitea#10365)

Signed-off-by: Philipp Homann <[email protected]>

* Use log.Info instead of fmt.Fprintf

Signed-off-by: Philipp Homann <[email protected]>

* import ordering

* make fmt

Co-authored-by: zeripath <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Matti R <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants