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

Never allow an empty password to validate #9682

Merged
merged 1 commit into from Jan 11, 2020

Conversation

@zeripath
Copy link
Contributor

zeripath commented Jan 9, 2020

#6023 caused a regression.

@6543
6543 approved these changes Jan 9, 2020
@GiteaBot GiteaBot added the lgtm/need 1 label Jan 9, 2020
@6543
6543 approved these changes Jan 9, 2020
@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Jan 9, 2020
@zeripath zeripath force-pushed the zeripath:no-empty-password branch from 3be7ac1 to d6d897b Jan 9, 2020
@silverwind

This comment has been minimized.

Copy link
Member

silverwind commented Jan 9, 2020

Maybe add a test?

@zeripath zeripath changed the title No empty password Never allow an empty password to validate Jan 9, 2020
@lafriks

This comment has been minimized.

Copy link
Member

lafriks commented Jan 10, 2020

Does not seem to work, all tests fail

@zeripath zeripath force-pushed the zeripath:no-empty-password branch from d6d897b to 465caef Jan 11, 2020
@zeripath

This comment has been minimized.

Copy link
Contributor Author

zeripath commented Jan 11, 2020

Yeah, so the reason tests failed is because I wrote:

// IsPasswordSet checks if the password is set or left empty
func (u *User) IsPasswordSet() bool {
       return u.ValidatePassword("")
}

instead of:

// IsPasswordSet checks if the password is set or left empty
func (u *User) IsPasswordSet() bool {
       return !u.ValidatePassword("")
}

yes, I'm an eejit.

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 11, 2020

Codecov Report

Merging #9682 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #9682      +/-   ##
=========================================
- Coverage    42.2%   42.2%   -0.01%     
=========================================
  Files         591     591              
  Lines       78085   78085              
=========================================
- Hits        32959   32953       -6     
- Misses      41080   41085       +5     
- Partials     4046    4047       +1
Impacted Files Coverage Δ
models/user.go 50.77% <100%> (ø) ⬆️
models/unit.go 62.16% <0%> (-5.41%) ⬇️
modules/process/manager.go 74.69% <0%> (-3.62%) ⬇️
services/pull/temp_repo.go 31.62% <0%> (-2.57%) ⬇️
modules/queue/workerpool.go 39.91% <0%> (-1.29%) ⬇️
modules/log/event.go 64.61% <0%> (-1.03%) ⬇️
services/pull/check.go 53.37% <0%> (+4.72%) ⬆️

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 32fb813...465caef. Read the comment docs.

@lunny lunny merged commit eadb45e into go-gitea:master Jan 11, 2020
2 checks passed
2 checks passed
approvals/lgtm this commit looks good
continuous-integration/drone/pr Build is passing
Details
lafriks added a commit that referenced this pull request Jan 11, 2020
* Restore IsPasswordSet previous value

* Update models/user.go
@zeripath zeripath deleted the zeripath:no-empty-password branch Jan 11, 2020
6543 added a commit to 6543-forks/gitea that referenced this pull request Jan 11, 2020
lafriks added a commit that referenced this pull request Jan 11, 2020
* Restore IsPasswordSet previous value

* Update models/user.go

Co-authored-by: Lauris BH <lauris@nix.lv>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.