26 references to EntraIdAppRole
Aspire.Hosting.Azure.EntraId (1)
EntraIdResourceExtensions.cs (1)
1825return builder.WithAppRole(new EntraIdAppRole(value, displayName, description, allowedMemberTypes, roleId, isEnabled ?? true));
Aspire.Hosting.Azure.EntraId.Tests (23)
EntraIdPolyglotTests.cs (4)
298.WithAppRole(new EntraIdAppRole("User", "User", "Can use the API.")) 299.WithAppRole(new EntraIdAppRole("Admin", "Administrator", "Can administer the API.", ["User", "Application"])) 300.WithAppRole(new EntraIdAppRole("Reader", "Reader", "Can read data.", ["Application"], roleId)) 301.WithAppRole(new EntraIdAppRole("Retired", "Retired", "Being removed.", isEnabled: false));
EntraIdProvisioningTests.cs (19)
49.WithAppRole(new EntraIdAppRole("User", "User", "Can use the API.")) 50.WithAppRole(new EntraIdAppRole("Admin", "Administrator", "Can administer the API.", ["User", "Application"])) 51.WithAppRole(new EntraIdAppRole("Reader", "Reader", "Can read data.", ["Application"], new Guid("11112222-aaaa-3333-bbbb-4444cccc5555"))) 52.WithAppRole(new EntraIdAppRole("Retired", "Retired", "Being removed.", isEnabled: false)); 65var entra = builder.AddEntraIdApplication("entra-api").WithAppRole(new EntraIdAppRole("Admin", "Admin", "Admin role.")); 67Assert.Throws<ArgumentException>(() => entra.WithAppRole(new EntraIdAppRole("Admin", "Other", "Duplicate value."))); 68Assert.Throws<ArgumentException>(() => entra.WithAppRole(new EntraIdAppRole("Has Space", "Name", "Description."))); 69Assert.Throws<ArgumentException>(() => entra.WithAppRole(new EntraIdAppRole("Other", "Name", "Description.", []))); 70Assert.Throws<ArgumentException>(() => entra.WithAppRole(new EntraIdAppRole("Other", "Name", "Description.", id: Guid.Empty))); 71Assert.Throws<ArgumentException>(() => entra.WithAppRole(new EntraIdAppRole("Other", " ", "Description."))); 83Assert.Throws<ArgumentException>(() => new EntraIdAppRole(value, "Name", "Description.")); 92Assert.Equal(value, new EntraIdAppRole(value, "Name", "Description.").Value); 98Assert.Throws<ArgumentException>(() => new EntraIdAppRole(new string('a', 121), "Name", "Description.")); 99Assert.Equal(120, new EntraIdAppRole(new string('a', 120), "Name", "Description.").Value.Length); 106var entra = builder.AddEntraIdApplication("entra-api").WithAppRole(new EntraIdAppRole("Admin", "Admin", "Admin role.")); 109Assert.Throws<NotSupportedException>(() => roles.Add(new EntraIdAppRole("Other", "Other", "Other role."))); 119var entra = builder.AddEntraIdApplication("entra-api").WithAppRole(new EntraIdAppRole("A", "A", "A role.", id: id)); 121Assert.Throws<ArgumentException>(() => entra.WithAppRole(new EntraIdAppRole("B", "B", "B role.", id: id))); 130Assert.Throws<InvalidOperationException>(() => entra.WithAppRole(new EntraIdAppRole("Admin", "Admin", "Admin role.")));
EntraId.AppHost (2)
AppHost.cs (2)
33.WithAppRole(new EntraIdAppRole("User", "User", "Can sign in and view the playground.")) 34.WithAppRole(new EntraIdAppRole("Admin", "Administrator", "Can administer the playground."));