From 23df01e826232626629c76c79efcc5502020012a Mon Sep 17 00:00:00 2001 From: urgerestraint Date: Sun, 22 Feb 2026 20:15:05 +1100 Subject: [PATCH] add test for requested scope presence --- pkg/auth/oauth_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/auth/oauth_test.go b/pkg/auth/oauth_test.go index 0cb589069..3679e765f 100644 --- a/pkg/auth/oauth_test.go +++ b/pkg/auth/oauth_test.go @@ -242,6 +242,11 @@ func TestRefreshAccessToken(t *testing.T) { return } + if r.FormValue("scope") != "test-scope" { + http.Error(w, "invalid scope", http.StatusBadRequest) + return + } + resp := map[string]any{ "access_token": "refreshed-access-token", "refresh_token": "refreshed-refresh-token", @@ -254,6 +259,7 @@ func TestRefreshAccessToken(t *testing.T) { cfg := OAuthProviderConfig{ Issuer: server.URL, ClientID: "test-client", + Scopes: "test-scope", } cred := &AuthCredential{