[x]):Accessing the API with http header "Authorization" does not work.
curl \
--resolve gitea.net:3000:10.0.0.112 \
-X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
'http://gitea.net:3000/api/v1/repos/devs/tmv4/keys?token=4a40ddb4190802e39825f06ec8a04a4ba3af22bf'; echo
[]
The same for access_token=.
Using Authorization header:
curl \
--resolve gitea.net:3000:10.0.0.112 \
-X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: 4a40ddb4190802e39825f06ec8a04a4ba3af22bf' \
http://gitea.net:3000/api/v1/repos/devs/tmv4/keys; echo
{"message":"Only signed in user is allowed to call APIs."}
No helpfull information in Debug and Trace logs. (?)
Reviewing the code revealed that providing -H 'Authorization: token 4a40ddb4190802e39825f06ec8a04a4ba3af22bf seems to work. This would be something which really required some documentation, I guess.
Most helpful comment
Reviewing the code revealed that providing
-H 'Authorization: token 4a40ddb4190802e39825f06ec8a04a4ba3af22bfseems to work. This would be something which really required some documentation, I guess.