Skip to content

Commit 213d53a

Browse files
fix(scopes): require workflow scope opt-in
Keep workflow and codespace in protected-resource discovery while excluding both from the default OAuth grant alongside delete_repo. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4b04480c-c2e9-483e-9b0f-34830b76a2f8
1 parent 1dd5f33 commit 213d53a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

pkg/scopes/scopes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ var oauthScopeDefinitions = []oauthScopeDefinition{
8686
{scope: Project, byDefault: true},
8787
{scope: Gist, byDefault: true},
8888
{scope: Notifications, byDefault: true},
89-
{scope: Workflow, byDefault: true},
90-
{scope: Codespace, byDefault: true},
89+
{scope: Workflow},
90+
{scope: Codespace},
9191
}
9292

9393
// SupportedOAuthScopes returns every OAuth scope the server may request.

pkg/scopes/scopes_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ func TestOAuthScopeCatalog(t *testing.T) {
127127
assert.Subset(t, supported, defaults)
128128
assert.Contains(t, supported, string(DeleteRepo))
129129
assert.NotContains(t, defaults, string(DeleteRepo))
130-
assert.Contains(t, defaults, string(Workflow))
131-
assert.Contains(t, defaults, string(Codespace))
130+
assert.Contains(t, supported, string(Workflow))
131+
assert.NotContains(t, defaults, string(Workflow))
132+
assert.Contains(t, supported, string(Codespace))
133+
assert.NotContains(t, defaults, string(Codespace))
132134
}
133135

134136
func TestToStringSlice(t *testing.T) {

0 commit comments

Comments
 (0)