gitea/services
Jack Hay 4e879fed90
Deprecate query string auth tokens (#28390)
## Changes
- Add deprecation warning to `Token` and `AccessToken` authentication
methods in swagger.
- Add deprecation warning header to API response. Example: 
  ```
  HTTP/1.1 200 OK
  ...
  Warning: token and access_token API authentication is deprecated
  ...
  ```
- Add setting `DISABLE_QUERY_AUTH_TOKEN` to reject query string auth
tokens entirely. Default is `false`

## Next steps
- `DISABLE_QUERY_AUTH_TOKEN` should be true in a subsequent release and
the methods should be removed in swagger
- `DISABLE_QUERY_AUTH_TOKEN` should be removed and the implementation of
the auth methods in question should be removed

## Open questions
- Should there be further changes to the swagger documentation?
Deprecation is not yet supported for security definitions (coming in
[OpenAPI Spec version
3.2.0](https://github.com/OAI/OpenAPI-Specification/issues/2506))
- Should the API router logger sanitize urls that use `token` or
`access_token`? (This is obviously an insufficient solution on its own)

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-12-12 03:48:53 +00:00
..
actions
agit
asymkey
attachment
auth Deprecate query string auth tokens (#28390) 2023-12-12 03:48:53 +00:00
automerge
context
convert
cron Actually recover from a panic in cron task (#28409) 2023-12-10 20:15:06 +00:00
externalaccount
feed
forms
gitdiff
indexer Fix missing issue search index update when changing status (#28325) 2023-12-03 12:22:44 +01:00
issue
lfs Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
mailer
markup
migrations Second part of refactor `db.Find` (#28194) 2023-12-11 16:56:48 +08:00
mirror
notify
org
packages Fix RPM/Debian signature key creation (#28352) 2023-12-05 00:48:01 +00:00
pull Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
release
repository Second part of refactor `db.Find` (#28194) 2023-12-11 16:56:48 +08:00
secrets
task
uinotification
user
webhook
wiki