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/services/auth
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>
1 year ago
..
source Use db.Find instead of writing methods for every object (#28084) 1 year ago
auth.go Fix attachment download bug (#27486) 1 year ago
auth_test.go Fix attachment download bug (#27486) 1 year ago
auth_token.go Enhanced auth token / remember me (#27606) 1 year ago
auth_token_test.go Enhanced auth token / remember me (#27606) 1 year ago
basic.go Unify two factor check (#27915) 1 year ago
group.go Remove `Named` interface (#26913) 1 year ago
httpsign.go Use db.Find instead of writing methods for every object (#28084) 1 year ago
interface.go Reduce usage of `db.DefaultContext` (#27073) 1 year ago
main_test.go Enhanced auth token / remember me (#27606) 1 year ago
oauth2.go Deprecate query string auth tokens (#28390) 1 year ago
reverseproxy.go Fix attachment download bug (#27486) 1 year ago
session.go Replace more db.DefaultContext (#27628) 1 year ago
signin.go Use db.Find instead of writing methods for every object (#28084) 1 year ago
source.go Final round of `db.DefaultContext` refactor (#27587) 1 year ago
sspi.go Use db.Find instead of writing methods for every object (#28084) 1 year ago
sspiauth_posix.go Make SSPI auth mockable (#27036) 1 year ago
sspiauth_windows.go Make SSPI auth mockable (#27036) 1 year ago
sync.go Use db.Find instead of writing methods for every object (#28084) 1 year ago