128 references to Build
Aspire.Dashboard (4)
DashboardWebApplication.cs (4)
772
.
Build
());
781
.
Build
());
788
.
Build
());
795
.
Build
());
Aspire.Hosting (1)
Dashboard\DashboardServiceHost.cs (1)
102
.
Build
());
CustomPolicyProvider (1)
Authorization\MinimumAgePolicyProvider.cs (1)
46
return Task.FromResult(policy.
Build
());
Microsoft.AspNetCore.Authorization (6)
AuthorizationBuilder.cs (2)
115
return AddDefaultPolicy(name, policyBuilder.
Build
());
142
return AddFallbackPolicy(name, policyBuilder.
Build
());
AuthorizationOptions.cs (2)
32
public AuthorizationPolicy DefaultPolicy { get; set; } = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
69
PolicyMap[name] = Task.FromResult<AuthorizationPolicy?>(policyBuilder.
Build
());
AuthorizationPolicy.cs (2)
86
return builder.
Build
();
199
return policyBuilder?.
Build
();
Microsoft.AspNetCore.Authorization.Policy (3)
AuthorizationEndpointConventionBuilderExtensions.cs (1)
115
RequirePolicyCore(builder, policyBuilder.
Build
());
AuthorizationMiddleware.cs (2)
136
? reqPolicy.
Build
()
137
: AuthorizationPolicy.Combine(policy, reqPolicy.
Build
());
Microsoft.AspNetCore.Authorization.Test (72)
AuthorizationBuilderTests.cs (4)
16
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
31
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
47
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
78
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
AuthorizationEndpointConventionBuilderExtensionsTests.cs (2)
125
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
199
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
AuthorizationMiddlewareResultHandlerTests.cs (7)
19
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
33
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
47
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
68
.
Build
();
86
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
107
.
Build
();
125
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
AuthorizationMiddlewareTests.cs (36)
27
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
46
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
66
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
85
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
106
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
108
policyProvider.Setup(p => p.GetDefaultPolicyAsync()).ReturnsAsync(new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
());
128
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
150
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
172
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().AddAuthenticationSchemes("schema1", "schema2").
Build
();
194
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
236
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
278
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
344
return Task.FromResult(new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
());
356
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
388
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
427
}).
Build
();
430
policyProvider.Setup(p => p.GetDefaultPolicyAsync()).ReturnsAsync(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
510
policyProvider.Setup(p => p.GetDefaultPolicyAsync()).ReturnsAsync(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
532
policyProvider.Setup(p => p.GetDefaultPolicyAsync()).ReturnsAsync(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
547
var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").
Build
();
566
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
587
var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
();
608
var policy = new AuthorizationPolicyBuilder("Fails").RequireAuthenticatedUser().
Build
();
632
var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewComment", "CanViewPage").
Build
();
656
}).
Build
();
685
}).
Build
();
705
var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").
Build
();
727
var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("Basic", "Bearer").
Build
();
750
.
Build
();
772
var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").
Build
();
795
var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("NotImplemented").
Build
();
818
var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("Basic", "Bearer").
Build
();
859
var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").
Build
();
885
var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").
Build
();
917
var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").AddAuthenticationSchemes("Bearer").
Build
();
951
var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").
Build
();
AuthorizationPolicyFacts.cs (2)
55
var policies = new[] { new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
() };
78
options.DefaultPolicy = new AuthorizationPolicyBuilder("default").RequireClaim("default").
Build
();
DefaultAuthorizationServiceTests.cs (13)
361
var allowed = await authorizationService.AuthorizeAsync(user, policy.
Build
());
382
var allowed = await authorizationService.AuthorizeAsync(user, policy.
Build
());
399
var allowed = await authorizationService.AuthorizeAsync(user, policy.
Build
());
416
var allowed = await authorizationService.AuthorizeAsync(user, null, policy.
Build
());
432
var allowed = await authorizationService.AuthorizeAsync(user, policy.
Build
());
453
var allowed = await authorizationService.AuthorizeAsync(user, policy.
Build
());
725
var basePolicy = new AuthorizationPolicyBuilder().RequireClaim("Base", "Value").
Build
();
753
var basePolicy = new AuthorizationPolicyBuilder().RequireClaim("Base", "Value").
Build
();
780
var basePolicy = new AuthorizationPolicyBuilder().RequireClaim("Base", "Value").
Build
();
999
return Task.FromResult(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
1009
return Task.FromResult(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
1038
return Task.FromResult(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
1048
return Task.FromResult(new AuthorizationPolicyBuilder().RequireClaim(policyName).
Build
());
PolicyEvaluatorTests.cs (8)
21
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
38
var policy = new AuthorizationPolicyBuilder().AddAuthenticationSchemes("A", "B", "C").RequireAssertion(_ => true).
Build
();
57
var policy = new AuthorizationPolicyBuilder().AddAuthenticationSchemes("A").RequireAssertion(_ => true).
Build
();
74
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
91
var policy = new AuthorizationPolicyBuilder().RequireAssertion(c => c.Resource != null).
Build
();
109
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => false).
Build
();
126
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => false).
Build
();
146
.
Build
();
Microsoft.AspNetCore.Http.Connections.Tests (1)
MapConnectionHandlerTests.cs (1)
37
var policy1 = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\FunctionalTestsServiceCollectionExtensions.cs (1)
49
.
Build
();
Microsoft.AspNetCore.Mvc.Core (1)
Authorization\AuthorizeFilter.cs (1)
155
return builder.
Build
();
Microsoft.AspNetCore.Mvc.Core.Test (29)
Authorization\AuthorizeFilterTest.cs (29)
88
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
());
105
policyProvider.Setup(p => p.GetPolicyAsync(It.IsAny<string>())).ReturnsAsync(new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
())
132
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
());
146
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").
Build
());
160
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
175
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
191
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().
Build
());
207
.
Build
());
221
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewComment", "CanViewPage").
Build
());
234
new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
236
new AuthorizationPolicyBuilder().RequireAssertion(_ => false).
Build
();
265
var secondFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => true).
Build
());
289
var secondFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => true).
Build
());
315
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => false).
Build
());
319
var secondFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => true).
Build
());
333
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => false).
Build
());
337
var secondFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => false).
Build
());
351
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => true).
Build
());
369
public DerivedAuthorizeFilter() : base(new AuthorizationPolicyBuilder().RequireAssertion(a => false).
Build
())
377
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(c => c.Resource is AuthorizationFilterContext).
Build
());
391
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireRole("Wut").
Build
());
408
.
Build
());
425
.
Build
());
441
.
Build
());
475
.
Build
();
516
.
Build
();
520
.
Build
();
541
.
Build
();
545
.
Build
();
Microsoft.AspNetCore.Mvc.IntegrationTests (4)
AuthorizeFilterIntegrationTest.cs (4)
58
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
89
var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();
105
var secondFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => true).
Build
());
141
var secondFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(a => true).
Build
());
Microsoft.AspNetCore.Routing.FunctionalTests (4)
EndpointRoutingIntegrationTest.cs (4)
111
services.AddAuthorization(options => options.DefaultPolicy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
());
143
services.AddAuthorization(options => options.DefaultPolicy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
());
204
services.AddAuthorization(options => options.DefaultPolicy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
());
235
services.AddAuthorization(options => options.DefaultPolicy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
());
Microsoft.AspNetCore.SignalR.Tests (1)
MapSignalRTests.cs (1)
106
var policy1 = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).
Build
();