Require token for GET subscription endpoint (#28765) (#28778)

Backport #28765 for 1.21
pull/28780/head
Jack Hay 1 year ago committed by GitHub
parent 80e564087d
commit 56e722f825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      tests/integration/api_user_watch_test.go

@ -63,7 +63,10 @@ func TestAPIWatch(t *testing.T) {
t.Run("IsWatching", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo, tokenWithRepoScope))
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription", repo))
MakeRequest(t, req, http.StatusUnauthorized)
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo, tokenWithRepoScope))
MakeRequest(t, req, http.StatusOK)
req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/subscription?token=%s", repo+"notexisting", tokenWithRepoScope))

Loading…
Cancel
Save