56 references to RequireAssertion
BasicTestApp (1)
Program.cs (1)
39
policy.
RequireAssertion
(ctx => ctx.User.Identity.Name?.StartsWith('B') ?? false));
Microsoft.AspNetCore.Authorization.Test (27)
AuthorizationBuilderTests.cs (1)
95
.AddPolicy("name", p => p.
RequireAssertion
(_ => true));
AuthorizationEndpointConventionBuilderExtensionsTests.cs (2)
125
var policy = new AuthorizationPolicyBuilder().
RequireAssertion
(_ => true).Build();
199
var policy = new AuthorizationPolicyBuilder().
RequireAssertion
(_ => true).Build();
AuthorizationMiddlewareTests.cs (10)
108
policyProvider.Setup(p => p.GetDefaultPolicyAsync()).ReturnsAsync(new AuthorizationPolicyBuilder().
RequireAssertion
(_ => true).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();
423
var policy = new AuthorizationPolicyBuilder().
RequireAssertion
(_ =>
652
var policy = new AuthorizationPolicyBuilder().
RequireAssertion
(c =>
681
var policy = new AuthorizationPolicyBuilder().
RequireAssertion
(c =>
AuthorizationPolicyFacts.cs (1)
55
var policies = new[] { new AuthorizationPolicyBuilder().
RequireAssertion
(_ => true).Build() };
DefaultAuthorizationServiceTests.cs (5)
964
options.AddPolicy("Basic", policy => policy.
RequireAssertion
(context => true));
1022
options.AddPolicy("Basic", policy => policy.
RequireAssertion
(context => true));
1085
services.AddAuthorization(options => options.AddPolicy("Fail", p => p.
RequireAssertion
(c => false)));
1126
services.AddAuthorization(options => options.AddPolicy("Success", p => p.
RequireAssertion
(c => true)));
1145
services.AddAuthorization(options => options.AddPolicy("Success", p => p.
RequireAssertion
(c => true)));
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();
145
.
RequireAssertion
(_ => false)
Microsoft.AspNetCore.Http.Connections.Tests (1)
MapConnectionHandlerTests.cs (1)
37
var policy1 = new AuthorizationPolicyBuilder().
RequireAssertion
(_ => true).Build();
Microsoft.AspNetCore.Mvc.Core.Test (17)
Authorization\AuthorizeFilterTest.cs (17)
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());
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());
424
.
RequireAssertion
(_ => true)
440
.
RequireAssertion
(_ => true)
474
.
RequireAssertion
(_ => true)
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();
StaticFilesAuth (1)
Startup.cs (1)
37
builder.RequireAuthenticatedUser().
RequireAssertion
(context =>