Skip to content

Commit 7ee75a2

Browse files
committed
2 parents abca00e + f6e95a1 commit 7ee75a2

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

src/WeihanLi.Web.Extensions/AccessControlHelper/AccessControlAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public override void OnAuthorization(AuthorizationFilterContext filterContext)
2020
var isDefinedNoControl = filterContext.ActionDescriptor.IsDefined(typeof(NoAccessControlAttribute), true);
2121

2222
if (isDefinedNoControl) return;
23-
23+
2424
var accessStrategy = filterContext.HttpContext.RequestServices.GetService<IResourceAccessStrategy>();
2525
if (accessStrategy is null)
2626
throw new InvalidOperationException("IResourceAccessStrategy not initialized,please register your ResourceAccessStrategy");

src/WeihanLi.Web.Extensions/AccessControlHelper/AccessControlHelperExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static IAccessControlHelperBuilder AddAccessControlHelper<TResourceAccess
5252
{
5353
ArgumentNullException.ThrowIfNull(services);
5454
ArgumentNullException.ThrowIfNull(configAction);
55-
55+
5656
services.Configure(configAction);
5757
return services.AddAccessControlHelper<TResourceAccessStrategy, TControlStrategy>();
5858
}
@@ -110,7 +110,7 @@ public static IAccessControlHelperBuilder AddAccessControlHelper(this IServiceCo
110110
{
111111
ArgumentNullException.ThrowIfNull(services);
112112
ArgumentNullException.ThrowIfNull(configAction);
113-
113+
114114
var option = new AccessControlOptions();
115115
configAction.Invoke(option);
116116
services.Configure(configAction);

src/WeihanLi.Web.Extensions/AccessControlHelper/AccessControlHelperMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public Task Invoke(HttpContext context)
3939
{
4040
return _next(context);
4141
}
42-
42+
4343
context.Response.StatusCode = context.User is { Identity.IsAuthenticated: true } ? 403 : 401;
4444
return _option.DefaultUnauthorizedOperation?.Invoke(context) ?? Task.CompletedTask;
4545
}

src/WeihanLi.Web.Extensions/AccessControlHelper/HtmlHelperExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static class HtmlHelperExtension
2121
/// <param name="accessKey">accessKey</param>
2222
/// <returns></returns>
2323
public static IHtmlContent SparkActionLink(
24-
this IHtmlHelper helper, string linkText, string actionName, string? controllerName = null,
24+
this IHtmlHelper helper, string linkText, string actionName, string? controllerName = null,
2525
object? routeValues = null, object? htmlAttributes = null, string? accessKey = null)
2626
{
2727
if (helper.ViewContext.HttpContext.RequestServices.GetRequiredService<IControlAccessStrategy>()

src/WeihanLi.Web.Extensions/Authentication/AuthenticationBuilderExtension.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static AuthenticationBuilder AddApiKey(this AuthenticationBuilder builder
3434
{
3535
ArgumentNullException.ThrowIfNull(builder);
3636
ArgumentNullException.ThrowIfNull(configureOptions);
37-
37+
3838
builder.Services.Configure(configureOptions);
3939
return builder.AddScheme<ApiKeyAuthenticationOptions, ApiKeyAuthenticationHandler>(schema,
4040
configureOptions);
@@ -98,7 +98,7 @@ public static AuthenticationBuilder AddHeader(this AuthenticationBuilder builder
9898
{
9999
ArgumentNullException.ThrowIfNull(builder);
100100
ArgumentNullException.ThrowIfNull(configureOptions);
101-
101+
102102
builder.Services.Configure(configureOptions);
103103
return builder.AddScheme<HeaderAuthenticationOptions, HeaderAuthenticationHandler>(schema,
104104
configureOptions);
@@ -130,7 +130,7 @@ public static AuthenticationBuilder AddQuery(this AuthenticationBuilder builder,
130130
{
131131
ArgumentNullException.ThrowIfNull(builder);
132132
ArgumentNullException.ThrowIfNull(configureOptions);
133-
133+
134134
builder.Services.Configure(configureOptions);
135135
return builder.AddScheme<QueryAuthenticationOptions, QueryAuthenticationHandler>(schema,
136136
configureOptions);

src/WeihanLi.Web.Extensions/Authorization/Jwt/DependencyInjectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static IServiceCollection AddJwtService(this IServiceCollection serviceCo
1313
{
1414
ArgumentNullException.ThrowIfNull(serviceCollection);
1515
ArgumentNullException.ThrowIfNull(optionsAction);
16-
16+
1717
serviceCollection.Configure(optionsAction);
1818
serviceCollection.TryAddSingleton<ITokenService, JsonWebTokenService>();
1919
serviceCollection.ConfigureOptions<JsonWebTokenOptionsSetup>();
@@ -29,7 +29,7 @@ public static IServiceCollection AddJwtServiceWithJwtBearerAuth(this IServiceCol
2929
{
3030
serviceCollection.Configure(jwtBearerOptionsSetup);
3131
}
32-
32+
3333
serviceCollection.ConfigureOptions<JwtBearerOptionsPostSetup>();
3434
return serviceCollection.AddJwtService(optionsAction);
3535
}

src/WeihanLi.Web.Extensions/DataProtection/ParamsProtection/ParamsProtectionHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ private static void ProtectParams(JToken token, ITimeLimitedDataProtector protec
7272
}
7373

7474
public static bool TryGetUnprotectedValue(this IDataProtector protector, ParamsProtectionOptions option,
75-
string? value, [MaybeNullWhen(false)]out string unprotectedValue)
75+
string? value, [MaybeNullWhen(false)] out string unprotectedValue)
7676
{
7777
unprotectedValue = value;
7878
if (string.IsNullOrEmpty(value))
7979
return false;
80-
80+
8181
if (option is { AllowUnprotectedParams: true, ParamValueProtectFuncEnabled: true } && option.ParamValueNeedProtectFunc(value)
8282
)
8383
{

src/WeihanLi.Web.Extensions/Extensions/EndpointExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ public static IEndpointConventionBuilder MapConfigInspector(this IEndpointRouteB
2020
)
2121
{
2222
ArgumentNullException.ThrowIfNull(endpointRouteBuilder);
23-
23+
2424
if (optionsConfigure is not null)
2525
{
2626
var options = endpointRouteBuilder.ServiceProvider.GetRequiredService<IOptions<ConfigInspectorOptions>>();
2727
optionsConfigure(options.Value);
2828
}
29-
29+
3030
return endpointRouteBuilder.MapGet($"{path}/{{configKey?}}", async (context) =>
3131
{
3232
var options = context.RequestServices.GetRequiredService<IOptions<ConfigInspectorOptions>>();

src/WeihanLi.Web.Extensions/Extensions/HealthCheckExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static IApplicationBuilder UseHealthCheck(this IApplicationBuilder applic
5454
{
5555
checkFunc = _ => Task.FromResult(true);
5656
}
57-
57+
5858
async Task CheckFunc(HttpContext context, Func<Task> next)
5959
{
6060
try

src/WeihanLi.Web.Extensions/Extensions/HttpContextExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static class HttpContextExtension
5252
/// <param name="principal">principal</param>
5353
/// <returns></returns>
5454
public static T GetUserId<T>(this ClaimsPrincipal principal) => GetUserId(principal).ToOrDefault<T>()!;
55-
55+
5656
public static T GetUserId<T>(this ClaimsPrincipal principal, string claimType)
5757
=> GetUserId(principal, claimType).ToOrDefault<T>()!;
5858

0 commit comments

Comments
 (0)