mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-24 09:00:02 +02:00
Revert "[GITEA] do not enforce misc scope tokens for public API endpoints"
This reverts commit 666f43fb64
.
This commit is contained in:
parent
7099ef15b6
commit
bbc3426c53
3 changed files with 32 additions and 13 deletions
|
@ -7,7 +7,6 @@ import (
|
|||
"net/http"
|
||||
"testing"
|
||||
|
||||
auth_model "code.gitea.io/gitea/models/auth"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
@ -25,15 +24,4 @@ func TestVersion(t *testing.T) {
|
|||
var version structs.ServerVersion
|
||||
DecodeJSON(t, resp, &version)
|
||||
assert.Equal(t, setting.AppVer, version.Version)
|
||||
|
||||
// Verify https://codeberg.org/forgejo/forgejo/pulls/1098 is fixed
|
||||
{
|
||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadActivityPub)
|
||||
req := NewRequestf(t, "GET", "/api/v1/version?token=%s", token)
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var version structs.ServerVersion
|
||||
DecodeJSON(t, resp, &version)
|
||||
assert.Equal(t, setting.AppVer, version.Version)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue