1 type derived from AuthorizationFilterContext
Microsoft.AspNetCore.Mvc.Core (1)
Infrastructure\ResourceInvoker.cs (1)
1596
private sealed class AuthorizationFilterContextSealed :
AuthorizationFilterContext
17 instantiations of AuthorizationFilterContext
Microsoft.AspNetCore.Mvc.Core.Test (7)
Authorization\AuthorizeFilterTest.cs (3)
524
var context = new
AuthorizationFilterContext
(ActionContext, new[] { filter1, filter2 });
560
var context = new
AuthorizationFilterContext
(ActionContext, new[] { filter, });
631
var authorizationContext = new
AuthorizationFilterContext
(
Filters\DisableRequestSizeLimitFilterTest.cs (1)
117
return new
AuthorizationFilterContext
(CreateActionContext(), filters);
Filters\RequestFormLimitsFilterTest.cs (1)
132
return new
AuthorizationFilterContext
(CreateActionContext(), filters);
Filters\RequestSizeLimitFilterTest.cs (1)
123
return new
AuthorizationFilterContext
(CreateActionContext(), filters);
RequireHttpsAttributeTests.cs (1)
230
return new
AuthorizationFilterContext
(actionContext, new IFilterMetadata[0]);
Microsoft.AspNetCore.Mvc.Cors.Test (4)
CorsAuthorizationFilterTest.cs (1)
157
var authorizationContext = new
AuthorizationFilterContext
(
DisableCorsAuthorizationFilterTest.cs (3)
23
var authorizationFilterContext = new
AuthorizationFilterContext
(
42
var authorizationFilterContext = new
AuthorizationFilterContext
(
64
var authorizationFilterContext = new
AuthorizationFilterContext
(
Microsoft.AspNetCore.Mvc.IntegrationTests (4)
AuthorizeFilterIntegrationTest.cs (4)
42
var authorizationFilterContext = new
AuthorizationFilterContext
(actionContext, new[] { authorizeFilter });
70
var authorizationFilterContext = new
AuthorizationFilterContext
(actionContext, new[] { authorizeFilter });
101
var authorizationFilterContext = new
AuthorizationFilterContext
(actionContext, action.Filters);
137
var authorizationFilterContext = new
AuthorizationFilterContext
(actionContext, action.Filters);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
Filters\AutoValidateAntiforgeryTokenAuthorizationFilterTest.cs (1)
86
var context = new
AuthorizationFilterContext
(actionContext, new IFilterMetadata[]
Filters\ValidateAntiforgeryTokenAuthorizationFilterTest.cs (1)
62
var context = new
AuthorizationFilterContext
(actionContext, new IFilterMetadata[]
158 references to AuthorizationFilterContext
CorsWebSite (1)
Filters\AllRequestsBlockingAuthorizationFilter.cs (1)
12
public void OnAuthorization(
AuthorizationFilterContext
context)
Microsoft.AspNetCore.Mvc.Abstractions (5)
Filters\AuthorizationFilterContext.cs (1)
13
/// Instantiates a new <see cref="
AuthorizationFilterContext
"/> instance.
Filters\IAsyncAuthorizationFilter.cs (2)
14
/// <param name="context">The <see cref="
AuthorizationFilterContext
"/>.</param>
18
Task OnAuthorizationAsync(
AuthorizationFilterContext
context);
Filters\IAuthorizationFilter.cs (2)
14
/// <param name="context">The <see cref="
AuthorizationFilterContext
"/>.</param>
15
void OnAuthorization(
AuthorizationFilterContext
context);
Microsoft.AspNetCore.Mvc.Core (32)
Authorization\AuthorizeFilter.cs (3)
119
internal async Task<AuthorizationPolicy> GetEffectivePolicyAsync(
AuthorizationFilterContext
context)
159
public virtual async Task OnAuthorizationAsync(
AuthorizationFilterContext
context)
210
private static bool HasAllowAnonymous(
AuthorizationFilterContext
context)
Diagnostics\MvcDiagnostics.cs (8)
114
/// An <see cref="EventData"/> that occurs before <see cref="IAuthorizationFilter.OnAuthorization(
AuthorizationFilterContext
)"/>.
127
/// <param name="authorizationContext">The <see cref="
AuthorizationFilterContext
"/>.</param>
129
public BeforeAuthorizationFilterOnAuthorizationEventData(ActionDescriptor actionDescriptor,
AuthorizationFilterContext
authorizationContext, IFilterMetadata filter)
144
public
AuthorizationFilterContext
AuthorizationContext { get; }
165
/// An <see cref="EventData"/> that occurs after <see cref="IAuthorizationFilter.OnAuthorization(
AuthorizationFilterContext
)"/>.
178
/// <param name="authorizationContext">The <see cref="
AuthorizationFilterContext
"/>.</param>
180
public AfterAuthorizationFilterOnAuthorizationEventData(ActionDescriptor actionDescriptor,
AuthorizationFilterContext
authorizationContext, IFilterMetadata filter)
195
public
AuthorizationFilterContext
AuthorizationContext { get; }
Filters\DisableRequestSizeLimitFilter.cs (2)
29
/// <param name="context">The <see cref="
AuthorizationFilterContext
"/>.</param>
32
public void OnAuthorization(
AuthorizationFilterContext
context)
Filters\RequestFormLimitsFilter.cs (1)
23
public void OnAuthorization(
AuthorizationFilterContext
context)
Filters\RequestSizeLimitFilter.cs (2)
31
/// <param name="context">The <see cref="
AuthorizationFilterContext
"/>.</param>
34
public void OnAuthorization(
AuthorizationFilterContext
context)
MvcCoreDiagnosticListenerExtensions.cs (8)
78
AuthorizationFilterContext
authorizationContext,
92
private static void BeforeOnAuthorizationAsyncImpl(DiagnosticListener diagnosticListener,
AuthorizationFilterContext
authorizationContext, IAsyncAuthorizationFilter filter)
108
AuthorizationFilterContext
authorizationContext,
122
private static void AfterOnAuthorizationAsyncImpl(DiagnosticListener diagnosticListener,
AuthorizationFilterContext
authorizationContext, IAsyncAuthorizationFilter filter)
138
AuthorizationFilterContext
authorizationContext,
152
private static void BeforeOnAuthorizationImpl(DiagnosticListener diagnosticListener,
AuthorizationFilterContext
authorizationContext, IAuthorizationFilter filter)
168
AuthorizationFilterContext
authorizationContext,
182
private static void AfterOnAuthorizationImpl(DiagnosticListener diagnosticListener,
AuthorizationFilterContext
authorizationContext, IAuthorizationFilter filter)
RequireHttpsAttribute.cs (8)
36
/// <see cref="
AuthorizationFilterContext
.Result"/> to a result which will redirect the client to the HTTPS
37
/// version of the request URI. Otherwise, sets <see cref="
AuthorizationFilterContext
.Result"/> to a result
41
public virtual void OnAuthorization(
AuthorizationFilterContext
filterContext)
53
/// <see cref="
AuthorizationFilterContext
.Result"/> will not be <c>null</c> after this method returns.
55
/// <param name="filterContext">The <see cref="
AuthorizationFilterContext
"/> to update.</param>
57
/// If it was a GET request, default implementation sets <see cref="
AuthorizationFilterContext
.Result"/> to a
59
/// implementation sets <see cref="
AuthorizationFilterContext
.Result"/> to a result which will set the status
62
protected virtual void HandleNonHttpsRequest(
AuthorizationFilterContext
filterContext)
Microsoft.AspNetCore.Mvc.Core.Test (53)
ApplicationModels\DefaultApplicationModelProviderTest.cs (1)
1813
public void OnAuthorization(
AuthorizationFilterContext
context)
Authorization\AuthorizeFilterTest.cs (26)
26
var
authorizationContext = GetAuthorizationContext();
34
var
authorizationContext = GetAuthorizationContext(anonymous: true);
57
var
authorizationContext = GetAuthorizationContext();
73
var
authorizationContext = GetAuthorizationContext();
89
var
authorizationContext = GetAuthorizationContext(anonymous: true);
108
var
authorizationContext = GetAuthorizationContext();
133
var
authorizationContext = GetAuthorizationContext(anonymous: true);
147
var
authorizationContext = GetAuthorizationContext();
161
var
authorizationContext = GetAuthorizationContext(anonymous: true);
176
var
authorizationContext = GetAuthorizationContext(anonymous: true);
192
var
authorizationContext = GetAuthorizationContext();
208
var
authorizationContext = GetAuthorizationContext();
222
var
authorizationContext = GetAuthorizationContext();
262
var
authorizationContext = GetAuthorizationContext(anonymous: false);
286
var
authorizationContext = GetAuthorizationContext(anonymous: false);
316
var
authorizationContext = GetAuthorizationContext(anonymous: false);
334
var
authorizationContext = GetAuthorizationContext(anonymous: false);
352
var
authorizationContext = GetAuthorizationContext(anonymous: false);
377
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAssertion(c => c.Resource is
AuthorizationFilterContext
).Build());
378
var
authorizationContext = GetAuthorizationContext();
392
var
authorizationContext = GetAuthorizationContext();
409
var
authorizationContext = GetAuthorizationContext();
524
var
context = new AuthorizationFilterContext(ActionContext, new[] { filter1, filter2 });
560
var
context = new AuthorizationFilterContext(ActionContext, new[] { filter, });
571
private
AuthorizationFilterContext
GetAuthorizationContext(
631
var
authorizationContext = new AuthorizationFilterContext(
Filters\DisableRequestSizeLimitFilterTest.cs (6)
20
var
authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
38
var
authorizationFilterContext = CreateAuthorizationFilterContext(
61
var
authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
80
var
authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
102
var
authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
115
private static
AuthorizationFilterContext
CreateAuthorizationFilterContext(IFilterMetadata[] filters)
Filters\RequestFormLimitsFilterTest.cs (6)
22
var
authorizationFilterContext = CreateAuthorizationFilterContext(
41
var
authorizationFilterContext = CreateAuthorizationFilterContext(
64
var
authorizationFilterContext = CreateAuthorizationFilterContext(
88
var
authorizationFilterContext = CreateAuthorizationFilterContext(
113
var
authorizationFilterContext = CreateAuthorizationFilterContext(
130
private static
AuthorizationFilterContext
CreateAuthorizationFilterContext(IFilterMetadata[] filters)
Filters\RequestSizeLimitFilterTest.cs (6)
21
var
authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
41
var
authorizationFilterContext = CreateAuthorizationFilterContext(
65
var
authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
85
var
authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
108
var
authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
121
private static
AuthorizationFilterContext
CreateAuthorizationFilterContext(IFilterMetadata[] filters)
RequireHttpsAttributeTests.cs (8)
22
var
authContext = CreateAuthorizationContext(requestContext);
90
var
authContext = CreateAuthorizationContext(requestContext);
116
var
authContext = CreateAuthorizationContext(requestContext);
136
var
authContext = CreateAuthorizationContext(requestContext);
179
var
authContext = CreateAuthorizationContext(requestContext);
204
var
authContext = CreateAuthorizationContext(requestContext);
221
protected override void HandleNonHttpsRequest(
AuthorizationFilterContext
filterContext)
227
private static
AuthorizationFilterContext
CreateAuthorizationContext(HttpContext ctx)
Microsoft.AspNetCore.Mvc.Core.TestCommon (29)
CommonResourceInvokerTest.cs (29)
579
filter.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>())).Verifiable();
587
filter.Verify(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()), Times.Once());
596
.Setup(f => f.OnAuthorizationAsync(It.IsAny<
AuthorizationFilterContext
>()))
597
.Returns<
AuthorizationFilterContext
>(context => Task.FromResult(true))
607
f => f.OnAuthorizationAsync(It.IsAny<
AuthorizationFilterContext
>()),
623
.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()))
624
.Callback<
AuthorizationFilterContext
>(c => Task.FromResult(true))
629
.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()))
630
.Callback<
AuthorizationFilterContext
>(c => c.Result = challenge.Object)
642
filter1.Verify(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()), Times.Once());
657
.Setup(f => f.OnAuthorizationAsync(It.IsAny<
AuthorizationFilterContext
>()))
658
.Returns<
AuthorizationFilterContext
>((context) =>
666
.Setup(f => f.OnAuthorizationAsync(It.IsAny<
AuthorizationFilterContext
>()))
667
.Returns<
AuthorizationFilterContext
>((context) =>
683
f => f.OnAuthorizationAsync(It.IsAny<
AuthorizationFilterContext
>()),
705
.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()))
706
.Callback<
AuthorizationFilterContext
>(c => { throw expected; })
729
authorizationFilter1.Verify(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()), Times.Once());
744
.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()))
745
.Callback<
AuthorizationFilterContext
>(c => c.Result = challenge.Object)
756
authorizationFilter.Verify(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()), Times.Once());
1714
.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()))
1715
.Callback<
AuthorizationFilterContext
>((c) =>
1745
.Setup(f => f.OnAuthorizationAsync(It.IsAny<
AuthorizationFilterContext
>()))
1746
.Returns<
AuthorizationFilterContext
>((c) =>
1776
.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()))
1777
.Callback<
AuthorizationFilterContext
>((c) =>
1808
.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()))
1809
.Callback<
AuthorizationFilterContext
>((c) =>
Microsoft.AspNetCore.Mvc.Cors (2)
CorsAuthorizationFilter.cs (1)
63
public async Task OnAuthorizationAsync(
AuthorizationFilterContext
context)
DisableCorsAuthorizationFilter.cs (1)
22
public Task OnAuthorizationAsync(
AuthorizationFilterContext
context)
Microsoft.AspNetCore.Mvc.Cors.Test (10)
CorsApplicationModelProviderTest.cs (1)
294
public Task OnAuthorizationAsync(
AuthorizationFilterContext
context)
CorsAuthorizationFilterTest.cs (6)
29
var
authorizationContext = GetAuthorizationContext(
59
var
authorizationContext = GetAuthorizationContext(
80
var
authorizationContext = GetAuthorizationContext(
103
var
authorizationContext = GetAuthorizationContext(
129
private
AuthorizationFilterContext
GetAuthorizationContext(
157
var
authorizationContext = new AuthorizationFilterContext(
DisableCorsAuthorizationFilterTest.cs (3)
23
var
authorizationFilterContext = new AuthorizationFilterContext(
42
var
authorizationFilterContext = new AuthorizationFilterContext(
64
var
authorizationFilterContext = new AuthorizationFilterContext(
Microsoft.AspNetCore.Mvc.IntegrationTests (4)
AuthorizeFilterIntegrationTest.cs (4)
42
var
authorizationFilterContext = new AuthorizationFilterContext(actionContext, new[] { authorizeFilter });
70
var
authorizationFilterContext = new AuthorizationFilterContext(actionContext, new[] { authorizeFilter });
101
var
authorizationFilterContext = new AuthorizationFilterContext(actionContext, action.Filters);
137
var
authorizationFilterContext = new AuthorizationFilterContext(actionContext, action.Filters);
Microsoft.AspNetCore.Mvc.RazorPages.Test (6)
Infrastructure\PageActionInvokerTest.cs (6)
559
.Setup(f => f.OnAuthorizationAsync(It.IsAny<
AuthorizationFilterContext
>()))
560
.Returns<
AuthorizationFilterContext
>((context) =>
575
f => f.OnAuthorizationAsync(It.IsAny<
AuthorizationFilterContext
>()),
594
.Setup(f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()))
595
.Callback<
AuthorizationFilterContext
>((context) =>
609
f => f.OnAuthorization(It.IsAny<
AuthorizationFilterContext
>()),
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
Filters\AntiforgeryMiddlewareAuthorizationFilter.cs (1)
15
public Task OnAuthorizationAsync(
AuthorizationFilterContext
context)
Filters\AutoValidateAntiforgeryTokenAuthorizationFilter.cs (1)
18
protected override bool ShouldValidate(
AuthorizationFilterContext
context)
Filters\ValidateAntiforgeryTokenAuthorizationFilter.cs (2)
23
public async Task OnAuthorizationAsync(
AuthorizationFilterContext
context)
47
protected virtual bool ShouldValidate(
AuthorizationFilterContext
context)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (10)
Filters\AntiforgeryMiddlewareAuthorizationFilterTest.cs (4)
23
var
context = new AuthorizationFilterContext(actionContext, new[] { filter });
41
var
context = new AuthorizationFilterContext(actionContext, new[] { filter });
58
var
context = new AuthorizationFilterContext(actionContext, new[] { filter });
75
var
context = new AuthorizationFilterContext(actionContext, new[] { filter });
Filters\AutoValidateAntiforgeryTokenAuthorizationFilterTest.cs (3)
34
var
context = new AuthorizationFilterContext(actionContext, new[] { filter });
62
var
context = new AuthorizationFilterContext(actionContext, new[] { filter });
86
var
context = new AuthorizationFilterContext(actionContext, new IFilterMetadata[]
Filters\ValidateAntiforgeryTokenAuthorizationFilterTest.cs (3)
38
var
context = new AuthorizationFilterContext(actionContext, new[] { filter });
62
var
context = new AuthorizationFilterContext(actionContext, new IFilterMetadata[]
90
var
context = new AuthorizationFilterContext(actionContext, new[] { filter });
RazorPagesWebSite (2)
Pages\ShortCircuitPageAtAuthFilter.cshtml.cs (2)
27
public Task OnAuthorizationAsync(
AuthorizationFilterContext
context)
39
public void OnAuthorization(
AuthorizationFilterContext
context)