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.
gitea/modules
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>
4 years ago
..
analyze Speed up `enry.IsVendor` (#15213) 4 years ago
auth Prevent double-login for Git HTTP and LFS and simplify login (#15303) 4 years ago
avatar Use single shared random string generation function (#15741) 4 years ago
base fix truncate utf8 string (#15828) 4 years ago
cache [Vendor] Update go-redis to v8.5.0 (#13749) 4 years ago
charset Refactor renders (#15175) 4 years ago
context Prevent double-login for Git HTTP and LFS and simplify login (#15303) 4 years ago
convert Fix individual tests (addition to #15802) (#15818) 4 years ago
cron add cron job to delete old actions from database (#15688) 4 years ago
csv Refactor renders (#15175) 4 years ago
doctor Add err to log (#15813) 4 years ago
emoji Fix several render issues (#14986) 4 years ago
eventsource Migrate to use jsoniter instead of encoding/json (#14841) 4 years ago
generate Use single shared random string generation function (#15741) 4 years ago
git Fix LFS commit finder not working (#15856) 4 years ago
gitgraph Fix bug on commit graph (#15517) 4 years ago
graceful Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue, reduce goroutines etc (#15693) 4 years ago
hcaptcha hCaptcha Support (#12594) 4 years ago
highlight Allow custom highlight mapping beyond file extensions (#15808) 4 years ago
httpcache Add ETag header (#15370) 4 years ago
httplib fix webhook timeout bug (#15613) 4 years ago
indexer Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue, reduce goroutines etc (#15693) 4 years ago
lfs Fix lfs management find (#15537) 4 years ago
log Migrate to use jsoniter instead of encoding/json (#14841) 4 years ago
markup Fixed individual markdown tests. (#15802) 4 years ago
matchlist Add Allow-/Block-List for Migrate & Mirrors (#13610) 4 years ago
metrics
migrations Close the gitrepo when deleting the repository (#15876) 4 years ago
nosql Fix setting redis db path (#15698) 4 years ago
notification Refactor renders (#15175) 4 years ago
options Add StatDir and replace com.StatDir (#14099) 4 years ago
password Check passwords against HaveIBeenPwned (#12716) 5 years ago
pprof
private Move restore repo to internal router and invoke from command to avoid open the same db file or queues files (#15790) 4 years ago
process Code Formats, Nits & Unused Func/Var deletions (#15286) 4 years ago
public add `/assets` as root dir of public files (#15219) 4 years ago
queue Multiple Queue improvements: LevelDB Wait on empty, shutdown empty shadow level queue, reduce goroutines etc (#15693) 4 years ago
recaptcha Migrate to use jsoniter instead of encoding/json (#14841) 4 years ago
references Respect default merge message syntax when parsing item references (#15772) 4 years ago
repofiles Code Formats, Nits & Unused Func/Var deletions (#15286) 4 years ago
repository Set GIT_DIR correctly if it is not set (#15751) 4 years ago
secret Use single shared random string generation function (#15741) 4 years ago
session Migrate to use jsoniter instead of encoding/json (#14841) 4 years ago
setting Add mimetype mapping settings (#15133) 4 years ago
ssh Make internal SSH server host key path configurable (#14918) 4 years ago
storage Code Formats, Nits & Unused Func/Var deletions (#15286) 4 years ago
structs Add Active and ProhibitLogin to API (#15689) 4 years ago
svg
sync
task Migrate to use jsoniter instead of encoding/json (#14841) 4 years ago
templates Fix incorrect asset URL (#15805) 4 years ago
test Move middlewares to web/middleware (#14480) 4 years ago
timeutil Fix display since time round (#14226) 4 years ago
translation Use index of the supported tags to choose user lang (#15452) 4 years ago
upload Update golangci-lint to version 1.31.0 (#13102) 4 years ago
uri Dump github/gitlab/gitea repository data to a local directory and restore to gitea (#12244) 4 years ago
user
util Use single shared random string generation function (#15741) 4 years ago
validation Move macaron to chi (#14293) 4 years ago
web Defer closing the gitrepo until the end of the wrapped context functions (#15653) 4 years ago