gitea/services
zeripath 17c5c654a5
Prevent double-login for Git HTTP and LFS and simplify login ()
* 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>
2021-05-15 17:32:09 +02:00
..
archiver migrate from com.* to alternatives () 2020-12-25 11:59:32 +02:00
comments Enhance Ghost comment mitigation Settings () 2021-01-21 21:56:19 -05:00
externalaccount Allow externalID to be UUID () 2019-10-17 10:06:28 +08:00
forms Restore PAM user autocreation functionality () 2021-05-13 23:11:47 +01:00
gitdiff Display specific message if diff is not displayed because of too long line () 2021-05-04 13:58:49 +01:00
issue label and milestone webhooks on issue/pull creation () 2021-01-17 16:15:57 +02:00
lfs Prevent double-login for Git HTTP and LFS and simplify login () 2021-05-15 17:32:09 +02:00
mailer Refactor renders () 2021-04-19 18:25:08 -04:00
mirror Add LFS Migration and Mirror () 2021-04-08 18:25:57 -04:00
pull Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue, reduce goroutines etc () 2021-05-15 16:22:26 +02:00
release Implement delete release attachments and update release attachments' name () 2021-03-23 00:09:51 +08:00
repository Repository transfer has to be confirmed, if user can not create repo for new owner () 2021-03-01 01:47:30 +01:00
webhook fix webhook timeout bug () 2021-04-25 21:48:12 +03:00
wiki Fix individual tests (addition to ) () 2021-05-12 00:13:42 -04:00