Skip to content

Commit

Permalink
Require token for GET subscription endpoint (#28765) (#28778)
Browse files Browse the repository at this point in the history
Backport #28765 for 1.21
  • Loading branch information
jackHay22 authored Jan 13, 2024
1 parent 80e5640 commit 56e722f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/integration/api_user_watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 56e722f

Please sign in to comment.