You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/services
zeripath 17c5c654a5
Prevent double-login for Git HTTP and LFS and simplify login (#15303)
* Prevent double-login for Git HTTP and LFS and simplify login

There are a number of inconsistencies with our current methods for
logging in for git and lfs. The first is that there is a double login
process. This is particularly evident in 1.13 where there are no less
than 4 hash checks for basic authentication due to the previous
IsPasswordSet behaviour.

This duplicated code had individual inconsistencies that were not
helpful and caused confusion.

This PR does the following:

* Remove the specific login code from the git and lfs handlers except
for the lfs special bearer token
* Simplify the meaning of DisableBasicAuthentication to allow Token and
Oauth2 sign-in.
* The removal of the specific code from git and lfs means that these
both now have the same login semantics and can - if not
DisableBasicAuthentication - login from external services. Further it
allows Oauth2 token authentication as per our standard mechanisms.
* The change in the recovery handler prevents the service from
re-attempting to login - primarily because this could easily cause a
further panic and it is wasteful.

* add test

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years ago
..
archiver migrate from com.* to alternatives (#14103) 4 years ago
comments Enhance Ghost comment mitigation Settings (#14392) 3 years ago
externalaccount Allow externalID to be UUID (#8551) 5 years ago
forms Restore PAM user autocreation functionality (#15825) 3 years ago
gitdiff Display specific message if diff is not displayed because of too long line (#15611) 3 years ago
issue label and milestone webhooks on issue/pull creation (#14363) 3 years ago
lfs Prevent double-login for Git HTTP and LFS and simplify login (#15303) 3 years ago
mailer Refactor renders (#15175) 3 years ago
mirror Add LFS Migration and Mirror (#14726) 3 years ago
pull Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue, reduce goroutines etc (#15693) 3 years ago
release Implement delete release attachments and update release attachments' name (#14130) 3 years ago
repository Repository transfer has to be confirmed, if user can not create repo for new owner (#14792) 3 years ago
webhook fix webhook timeout bug (#15613) 3 years ago
wiki Fix individual tests (addition to #15802) (#15818) 3 years ago