26 references to EntraIdAppRole
Aspire.Hosting.Azure.EntraId (1)
EntraIdResourceExtensions.cs (1)
1825
return 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));
65
var entra = builder.AddEntraIdApplication("entra-api").WithAppRole(new
EntraIdAppRole
("Admin", "Admin", "Admin role."));
67
Assert.Throws<ArgumentException>(() => entra.WithAppRole(new
EntraIdAppRole
("Admin", "Other", "Duplicate value.")));
68
Assert.Throws<ArgumentException>(() => entra.WithAppRole(new
EntraIdAppRole
("Has Space", "Name", "Description.")));
69
Assert.Throws<ArgumentException>(() => entra.WithAppRole(new
EntraIdAppRole
("Other", "Name", "Description.", [])));
70
Assert.Throws<ArgumentException>(() => entra.WithAppRole(new
EntraIdAppRole
("Other", "Name", "Description.", id: Guid.Empty)));
71
Assert.Throws<ArgumentException>(() => entra.WithAppRole(new
EntraIdAppRole
("Other", " ", "Description.")));
83
Assert.Throws<ArgumentException>(() => new
EntraIdAppRole
(value, "Name", "Description."));
92
Assert.Equal(value, new
EntraIdAppRole
(value, "Name", "Description.").Value);
98
Assert.Throws<ArgumentException>(() => new
EntraIdAppRole
(new string('a', 121), "Name", "Description."));
99
Assert.Equal(120, new
EntraIdAppRole
(new string('a', 120), "Name", "Description.").Value.Length);
106
var entra = builder.AddEntraIdApplication("entra-api").WithAppRole(new
EntraIdAppRole
("Admin", "Admin", "Admin role."));
109
Assert.Throws<NotSupportedException>(() => roles.Add(new
EntraIdAppRole
("Other", "Other", "Other role.")));
119
var entra = builder.AddEntraIdApplication("entra-api").WithAppRole(new
EntraIdAppRole
("A", "A", "A role.", id: id));
121
Assert.Throws<ArgumentException>(() => entra.WithAppRole(new
EntraIdAppRole
("B", "B", "B role.", id: id)));
130
Assert.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."));