Revert "[GITEA] do not enforce misc scope tokens for public API endpoints"

This reverts commit 666f43fb64.
This commit is contained in:
Earl Warren 2023-07-26 13:51:06 +02:00
parent 7099ef15b6
commit bbc3426c53
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 32 additions and 13 deletions

View file

@ -141,6 +141,26 @@ func TestAPIDeniesPermissionBasedOnTokenScope(t *testing.T) {
},
},
},
{
"/api/v1/markdown",
"POST",
[]permission{
{
auth_model.AccessTokenScopeCategoryMisc,
auth_model.Write,
},
},
},
{
"/api/v1/markdown/raw",
"POST",
[]permission{
{
auth_model.AccessTokenScopeCategoryMisc,
auth_model.Write,
},
},
},
{
"/api/v1/notifications",
"GET",
@ -327,6 +347,16 @@ func TestAPIDeniesPermissionBasedOnTokenScope(t *testing.T) {
},
},
},
{
"/api/v1/settings/api",
"GET",
[]permission{
{
auth_model.AccessTokenScopeCategoryMisc,
auth_model.Read,
},
},
},
{
"/api/v1/user",
"GET",