@@ -232,8 +232,8 @@ func TestToolboxHelpDocumentsLocalCommandSurface(t *testing.T) {
232232 "sync <resource-server>" ,
233233 "get|head|post|put|patch|delete <resource-server>/<path>" ,
234234 "<resource-server> context" ,
235- "<resource-server> context show <name >" ,
236- "<resource-server> context [use <name >|clear]" ,
235+ "<resource-server> context show <context-id >" ,
236+ "<resource-server> context [use <context-id >|clear]" ,
237237 } {
238238 if ! strings .Contains (output , expected ) {
239239 t .Fatalf ("help omitted %q:\n %s" , expected , output )
@@ -313,7 +313,7 @@ func TestParseExecFlagsConsumesLogLevelBeforeNativeSeparator(t *testing.T) {
313313func TestResourceServerContextUsesDisplayContractWithoutRawDetails (t * testing.T ) {
314314 // [spec: cli/resource-server-context]
315315 details := []catalog.AuthorizationDetail {{
316- Name : "realmroot" , Description : "Organization GitHub App installation" ,
316+ ID : "ctx_github_realmroot" , Name : "realmroot" , Description : "Organization GitHub App installation" ,
317317 AuthorizationDetail : map [string ]any {"type" : "github_installation" , "installation_id" : "42" },
318318 Metadata : map [string ]string {"accountType" : "Organization" },
319319 AccountAuthorizationStatus : "authorized" , AuthorizedScopes : []string {"issues:read" },
@@ -325,7 +325,7 @@ func TestResourceServerContextUsesDisplayContractWithoutRawDetails(t *testing.T)
325325 t .Fatal (err )
326326 }
327327 output := string (encoded )
328- if ! summaries [0 ].Current || ! strings .Contains (output , `"name":"realmroot"` ) ||
328+ if ! summaries [0 ].Current || ! strings .Contains (output , `"id":"ctx_github_realmroot"` ) || ! strings . Contains ( output , `" name":"realmroot"` ) ||
329329 strings .Contains (output , "installation_id" ) || strings .Contains (output , "authorizationDetail" ) {
330330 t .Fatalf ("Context summaries = %s" , output )
331331 }
@@ -859,7 +859,7 @@ func TestSmallResourceServerOverviewIncludesCompleteInventory(t *testing.T) {
859859 details := []catalog.AuthorizationDetail {{Name : "wallet" }}
860860 operations := []restish.OperationInspection {{ID : "showWallet" , Command : []string {"wallet" , "show" }, Method : "GET" }}
861861
862- overview := buildResourceServerOverview (server , details , operations , discoveryOptions {})
862+ overview := buildResourceServerOverview (server , details , operations , discoveryOptions {}, nil )
863863
864864 if overview .Mode != overviewModeExpanded || len (overview .Scopes ) != 1 || len (overview .Contexts ) != 1 || len (overview .Operations ) != 1 {
865865 t .Fatalf ("overview = %#v" , overview )
@@ -870,7 +870,7 @@ func TestLargeResourceServerOverviewIsCompact(t *testing.T) {
870870 server := catalog.ResourceServer {CommandName : "cloudflare" , ConnectionScopes : []string {"zone.read" }, Scopes : make ([]catalog.Scope , 252 )}
871871 operations := makeOperations (2652 )
872872
873- overview := buildResourceServerOverview (server , nil , operations , discoveryOptions {})
873+ overview := buildResourceServerOverview (server , nil , operations , discoveryOptions {}, nil )
874874
875875 if overview .Mode != overviewModeCompact || len (overview .Scopes ) != 0 || len (overview .Operations ) != 0 {
876876 t .Fatalf ("overview = %#v" , overview )
@@ -887,7 +887,7 @@ func TestCompactOverviewKeepsBoundedAuthorizationDetails(t *testing.T) {
887887 details [index ] = catalog.AuthorizationDetail {Name : "account" , AuthorizationDetail : map [string ]any {"type" : "cloudflare_account" }}
888888 }
889889
890- overview := buildResourceServerOverview (server , details , makeOperations (80 ), discoveryOptions {})
890+ overview := buildResourceServerOverview (server , details , makeOperations (80 ), discoveryOptions {}, nil )
891891
892892 if overview .Mode != overviewModeCompact || len (overview .Contexts ) != maxCompactAuthorization || ! overview .ContextTruncated {
893893 t .Fatalf ("overview = %#v" , overview )
@@ -902,7 +902,7 @@ func TestResourceServerSearchIsBoundedAndKeepsOperationSecurity(t *testing.T) {
902902 operations [index ].CredentialAlternatives = [][]restish.CredentialRequirementInspection {{{ID : "oauth2" , Needs : []string {"workers-routes.read" }}}}
903903 }
904904
905- overview := buildResourceServerOverview (server , nil , operations , discoveryOptions {Search : "worker routes" })
905+ overview := buildResourceServerOverview (server , nil , operations , discoveryOptions {Search : "worker routes" }, nil )
906906
907907 if overview .Mode != overviewModeFiltered || overview .MatchCount != 80 || len (overview .Operations ) != maxDiscoveryResults || ! overview .Truncated {
908908 t .Fatalf ("overview = %#v" , overview )
@@ -920,7 +920,7 @@ func TestScopeFilterKeepsOnlyMatchingScopeAlternativesAndHidesCredentialSchemes(
920920 {{ID : "realmrootOidc" , Kind : "oauth2" , Needs : []string {"metadata:read" }}},
921921 },
922922 }}
923- overview := buildResourceServerOverview (catalog.ResourceServer {CommandName : "github" }, nil , operations , discoveryOptions {Scope : "contents:read" })
923+ overview := buildResourceServerOverview (catalog.ResourceServer {CommandName : "github" }, nil , operations , discoveryOptions {Scope : "contents:read" }, nil )
924924
925925 if got := operationScopeSummary (overview .Operations [0 ]); got != "contents:read" {
926926 t .Fatalf ("scope summary = %q" , got )
@@ -966,7 +966,7 @@ func TestResourceServerAllExplicitlyExpandsLargeInventory(t *testing.T) {
966966 server := catalog.ResourceServer {CommandName : "cloudflare" , Scopes : make ([]catalog.Scope , 252 )}
967967 operations := makeOperations (80 )
968968
969- overview := buildResourceServerOverview (server , nil , operations , discoveryOptions {All : true })
969+ overview := buildResourceServerOverview (server , nil , operations , discoveryOptions {All : true }, nil )
970970
971971 if overview .Mode != overviewModeExpanded || len (overview .Scopes ) != 252 || len (overview .Operations ) != 80 || overview .Truncated {
972972 t .Fatalf ("overview = %#v" , overview )
0 commit comments