88 references to WithScope
Aspire.Hosting.Azure.EntraId (4)
EntraIdResourceExtensions.cs (4)
1969/// <see cref="WithScope"/> uses this URI unless <see cref="WithApplicationIdUri(IResourceBuilder{EntraIdApplicationResource}, string)"/> sets another one. 2143return builder.WithScope(name, description, scope => 2192/// <param name="scopeNames">The names of the scopes, added with <see cref="WithScope"/>, that the client may request.</param> 2240/// <param name="scopeNames">The names of the scopes, added with <see cref="WithScope"/> to <paramref name="api"/>.</param>
Aspire.Hosting.Azure.EntraId.Tests (84)
EntraIdApiProvisioningTests.cs (80)
32.WithScope("access_as_user", ScopeDescription); 53.WithScope("orders.read", "Read orders.", scope => 60.WithScope("orders.write", "Write orders.", scope => scope.IsEnabled = false); 82var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription); 98var api = builder.AddEntraIdApplication(resourceName).WithScope(scopeName, ScopeDescription); 118var first = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", "Original description."); 119var second = builder.AddEntraIdApplication("entra-api2").WithScope("access_as_user", "Changed description."); 133var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription, scope => scope.Id = id); 150Assert.ThrowsAny<ArgumentException>(() => api.WithScope(name, ScopeDescription)); 160api.WithScope(new string('a', 120), ScopeDescription); 161Assert.Throws<ArgumentException>(() => api.WithScope(new string('b', 121), ScopeDescription)); 169var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription, scope => scope.Id = id); 171Assert.Throws<ArgumentException>(() => api.WithScope("ACCESS_AS_USER", ScopeDescription)); 172Assert.Throws<ArgumentException>(() => api.WithScope("other", ScopeDescription, scope => scope.Id = id)); 184var api = builder.AddEntraIdApplication("entra-api").WithScope(name, ScopeDescription); 223.WithScope("access_as_user", ScopeDescription) 227.WithScope("access_as_user", ScopeDescription) 345var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription); 366.WithScope("access_as_user", ScopeDescription) 367.WithScope("other", "Another scope."); 392.WithScope("orders.read", "Read orders.", scope => scope.Id = Guid.Parse("11112222-aaaa-3333-bbbb-4444cccc5555")); 394.WithScope("items.read", "Read items.", scope => scope.Id = Guid.Parse("22223333-aaaa-4444-bbbb-5555cccc6666")); 409.WithScope("orders.read", "Read orders.", scope => scope.Id = Guid.NewGuid()); 420.WithScope("orders.read", "Read orders."); 438.WithScope("access_as_user", ScopeDescription) 439.WithScope("retired", "Retired.", scope => scope.IsEnabled = false); 454var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription); 477.WithScope("access_as_user", ScopeDescription) 496.WithScope("items.read", "Read items.", scope => scope.Id = Guid.NewGuid()); 604var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription); 623.WithScope("access_as_user", ScopeDescription) 624.WithScope("other", "Another scope.") 639.WithScope("access_as_user", ScopeDescription) 640.WithScope("retired", "Retired.", scope => scope.IsEnabled = false); 652var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription); 659var other = builder.AddEntraIdApplication("other-api").WithScope("access_as_user", ScopeDescription); 670var a = builder.AddEntraIdApplication("a").WithScope("scope", ScopeDescription); 671var b = builder.AddEntraIdApplication("b").WithScope("scope", ScopeDescription); 672var c = builder.AddEntraIdApplication("c").WithScope("scope", ScopeDescription); 686.WithScope("access_as_user", ScopeDescription) 698var created = builder.AddEntraIdApplication("created-api").WithScope("access_as_user", ScopeDescription); 699var custom = builder.AddEntraIdApplication("custom-api").WithApplicationIdUri("api://contoso-orders").WithScope("orders.read", "Read orders."); 701existing.WithScope("items.read", "Read items.", scope => scope.Id = Guid.NewGuid()); 703existingWithoutUri.WithScope("items.read", "Read items.", scope => scope.Id = Guid.NewGuid()); 718.WithScope("access_as_user", ScopeDescription); 747var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription); 815.WithScope("orders.read", "Read orders.", scope => scope.Id = Guid.NewGuid()); 818.WithScope("items.read", "Read items.", scope => scope.Id = Guid.NewGuid()); 841.WithScope("items.read", "Read items.", scope => scope.Id = Guid.NewGuid()); 867var api = builder.AddEntraIdApplication("api-entra").WithScope("access_as_user", ScopeDescription); 895var orders = builder.AddEntraIdApplication("orders-entra").WithScope("orders.read", "Read orders."); 896var items = builder.AddEntraIdApplication("items-entra").WithScope("items.read", "Read items."); 925.WithApplicationIdUri("api://orders").WithScope("orders.read", "Read orders.", s => s.Id = Guid.NewGuid()); 927.WithApplicationIdUri("api://items").WithScope("items.read", "Read items.", s => s.Id = Guid.NewGuid()); 971.WithScope("access_as_user", ScopeDescription, scope => scope.Id = Guid.NewGuid()) 972.WithScope("retired", "Retired.", scope => { scope.Id = Guid.NewGuid(); scope.IsEnabled = false; }) 973.WithScope("other", "Another scope.", scope => scope.Id = Guid.NewGuid()); 1040.WithScope("access_as_user", ScopeDescription, scope => scope.Id = Guid.NewGuid()); 1062.WithScope("access_as_user", ScopeDescription, scope => scope.Id = Guid.NewGuid()); 1080.WithScope("access_as_user", ScopeDescription, scope => scope.Id = Guid.NewGuid()); 1100.WithScope("access_as_user", ScopeDescription, scope => scope.Id = Guid.NewGuid()); 1130.WithApplicationIdUri("api://orders").WithScope("orders.read", "Read orders.", s => s.Id = Guid.NewGuid()); 1132.WithApplicationIdUri("api://items").WithScope("items.read", "Read items.", s => s.Id = Guid.NewGuid()); 1152.WithScope("items.read", "Read items.", s => s.Id = Guid.NewGuid()); 1168.WithApplicationIdUri("api://items").WithScope("items.read", "Read items.", s => s.Id = Guid.NewGuid()); 1187var hyphenated = builder.AddEntraIdApplication("orders-api").WithScope("read", "Read"); 1188var camel = builder.AddEntraIdApplication("ordersApi").WithScope("read", "Read"); 1274var api = builder.AddEntraIdApplication("orders-api").WithScope("read", "Read"); 1297.WithScope("read", "Read"); 1312.WithScope("read", "Read", scope => scope.Id = Guid.NewGuid()); 1314.WithScope("read", "Read") 1341.WithScope("read", "Read", scope => scope.Id = Guid.NewGuid()) 1342.WithScope("write", "Write", scope => scope.Id = Guid.NewGuid()); 1394.WithScope("read", "Read", scope => scope.Id = Guid.NewGuid()); 1397.WithScope("read", "Read", scope => scope.Id = Guid.NewGuid()); 1514.WithScope("access_as_user", ScopeDescription) 1515.WithScope("other", "Another scope."); 1543.WithScope("orders.read", "Read orders.", scope => scope.Id = firstId); 1559.WithScope("orders.read", "Read orders.", scope => scope.Id = Guid.NewGuid()); 1572var api = builder.AddEntraIdApplication("entra-api").WithScope("access_as_user", ScopeDescription);
EntraIdPolyglotTests.cs (3)
364.WithScope("access_as_user", "Allows the app to call the API.") 365.WithScope("admin", "Administer the API.", scope => 413.WithScope("orders.read", "Read orders.", scope => scope.Id = scopeId);
EntraIdStarterScenarioPublishTests.cs (1)
36.WithScope("access_as_user", "Access the weather API on behalf of the signed-in user");