api/v1/users/[:user]/tokens is too special. Make it less special? #4315
Labels
modifies/api
This PR adds API routes or modifies them
type/proposal
The new feature has not been accepted yet but needs to be discussed first.
[x]
):Description
If you are using gitea with any auth which disables basic user/pw login, the tokens API is effectively disabled. This breaks drone (and other token-handling) integrations if you are using anything but direct username/pw auth. See at least #2743, and #3843.
As is mentioned in #3843, the implementation of
/tokens
uses a couple hacks to minimize its logic, it only allows usage if a the call is authenticated through BasicAuth, and it also ignores the:user
argument, only accessing tokens for the authenticated user.If you are trying to build a system around gitea using any external login provider, this pretty much breaks all integrations.
A longer term fix for this sort of setup is probably having a full oauth consumer / ask for permissons workflow etc, but as a shorter term fix, I propose implementing the following:
Related to these, there's another question to answer I think: in the presence of a token vs alternate auth (reverse proxy web header, oauth bearer etc), should the priority of those be configurable? Does it matter? Is there a long term authentication roadmap for Gitea?
I have the beginnings of a fix for number 2 here that I need to use Drone in my current org's setup (Mutual TLS auth everywhere), and think I have a good idea for basically doing 1, but I want to float the idea of mergability of these features.
Thoughts?
The text was updated successfully, but these errors were encountered: