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

Respond with a 401 on git push when password isn't changed yet #20026

Merged
merged 3 commits into from
Jun 19, 2022

Conversation

42wim
Copy link
Member

@42wim 42wim commented Jun 18, 2022

Fixes #19090

If the user-agent starts with git and user must change password but
hasn't return a 401 with the message.

It must be a 401, git doesn't seem to show the contents of the error message
when we return a 403

Fixes go-gitea#19090

If the user-agent starts with git and user must change password but
hasn't return a 401 with the message.

It must be a 401, git doesn't seem to show the contents of the error message
when we return a 403
@42wim 42wim added the type/bug label Jun 18, 2022
@6543 6543 added this to the 1.18.0 milestone Jun 18, 2022
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jun 18, 2022
@6543 6543 added the backport/done All backports for this PR have been created label Jun 18, 2022
@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 Jun 18, 2022
@lunny
Copy link
Member

lunny commented Jun 19, 2022

But then he will confuse that his password is right but git always ask password?

@42wim
Copy link
Member Author

42wim commented Jun 19, 2022

@lunny the user gets to see something like below, an explicit message to update the password.

Username for 'http://localhost:3000': joske
Password for 'http://joske@localhost:3000':
remote: Update your password
fatal: Authentication failed for 'http://localhost:3000/wim/joske23.git/'

@zeripath zeripath merged commit e91229e into go-gitea:main Jun 19, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 21, 2022
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Catch the error before the response is processed by goth. (go-gitea#20000)
  Adjust transaction handling via db.Context (go-gitea#20031)
  Add more linters to improve code readability (go-gitea#19989)
  [skip ci] Updated translations via Crowdin
  Disable federation by default (go-gitea#20045)
  Respond with a 401 on git push when password isn't changed yet (go-gitea#20026)
  Alter hook_task TEXT fields to LONGTEXT (go-gitea#20038)
  Simplify and fix migration 216 (go-gitea#20035)
  use quoted regexp instead of git fixed-value (go-gitea#20029)
  fix delete pull head ref for DeleteIssue (go-gitea#20032)
  User keypairs and HTTP signatures for ActivityPub federation using go-ap (go-gitea#19133)
  Backtick table name in generic orphan check (go-gitea#20019)
  Update document to clarify that ALLOWED_DOMAINS/BLOCKED_DOMAINS support wildcard (go-gitea#20016)
  Return 404 when tag is broken (go-gitea#20017)
  Dump should only copy regular files and symlink regular files (go-gitea#20015)
vsysoev pushed a commit to IntegraSDL/gitea that referenced this pull request Aug 10, 2022
…tea#20026)

If the user-agent starts with git and user must change password but
hasn't return a 401 with the message.

It must be a 401, git doesn't seem to show the contents of the error message
when we return a 403

Fixes go-gitea#19090
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 24, 2022
…tea#20026)

If the user-agent starts with git and user must change password but
hasn't return a 401 with the message.

It must be a 401, git doesn't seem to show the contents of the error message
when we return a 403

Fixes go-gitea#19090
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
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
6 participants