@@ -436,7 +436,18 @@ func TestHandleProtectedResource(t *testing.T) {
436436 host : "api.example.com" ,
437437 method : http .MethodGet ,
438438 expectedStatusCode : http .StatusOK ,
439- expectedScopes : SupportedScopes ,
439+ expectedScopes : []string {
440+ "repo" ,
441+ "read:org" ,
442+ "read:user" ,
443+ "user:email" ,
444+ "read:packages" ,
445+ "write:packages" ,
446+ "read:project" ,
447+ "project" ,
448+ "gist" ,
449+ "notifications" ,
450+ },
440451 validateResponse : func (t * testing.T , body map [string ]any ) {
441452 t .Helper ()
442453 assert .Equal (t , "GitHub MCP Server" , body ["resource_name" ])
@@ -573,7 +584,12 @@ func TestHandleProtectedResource(t *testing.T) {
573584 if tc .expectedScopes != nil {
574585 scopes , ok := body ["scopes_supported" ].([]any )
575586 require .True (t , ok )
576- assert .Len (t , scopes , len (tc .expectedScopes ))
587+ actualScopes := make ([]string , len (scopes ))
588+ for i , scope := range scopes {
589+ actualScopes [i ], ok = scope .(string )
590+ require .True (t , ok )
591+ }
592+ assert .Equal (t , tc .expectedScopes , actualScopes )
577593 }
578594 }
579595 })
@@ -671,10 +687,20 @@ func TestSupportedScopes(t *testing.T) {
671687 assert .Equal (t , expectedScopes , SupportedScopes )
672688}
673689
674- func TestDefaultScopesRequiresExplicitDeleteRepoOptIn (t * testing.T ) {
690+ func TestDefaultScopesRequireExplicitOptIn (t * testing.T ) {
675691 assert .Subset (t , SupportedScopes , DefaultScopes )
676692 assert .Contains (t , SupportedScopes , "delete_repo" )
677693 assert .NotContains (t , DefaultScopes , "delete_repo" )
694+ assert .Contains (t , SupportedScopes , "workflow" )
695+ assert .NotContains (t , DefaultScopes , "workflow" )
696+ assert .Contains (t , SupportedScopes , "codespace" )
697+ assert .NotContains (t , DefaultScopes , "codespace" )
698+ assert .Contains (t , SupportedScopes , "admin:org" )
699+ assert .NotContains (t , DefaultScopes , "admin:org" )
700+ assert .Contains (t , SupportedScopes , "read:enterprise" )
701+ assert .NotContains (t , DefaultScopes , "read:enterprise" )
702+ assert .Contains (t , SupportedScopes , "admin:enterprise" )
703+ assert .NotContains (t , DefaultScopes , "admin:enterprise" )
678704 assert .Contains (t , DefaultScopes , "repo" )
679705}
680706
0 commit comments