From 7bbd2fe5539f450be137dd9a31d6d05e175a6692 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 25 Oct 2024 17:27:53 +0800 Subject: [PATCH] feat(open-api): remove request query validate --- .../OpenApiAuthorizationService.cs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs index c37fe1dec..31ede4797 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs @@ -59,11 +59,6 @@ public async virtual Task AuthorizeAsync(HttpContext httpContext) return false; } - if (!await ValidateQueryString(httpContext)) - { - return false; - } - if (!await ValidatAppDescriptor(httpContext)) { return false; @@ -87,20 +82,6 @@ protected async virtual Task ValidateClientIpAddress(HttpContext httpConte return true; } - protected async virtual Task ValidateQueryString(HttpContext httpContext) - { - if (!httpContext.Request.QueryString.HasValue) - { - var exception = new BusinessException( - AbpOpenApiConsts.InvalidAccessWithAppKeyNotFound, - $"{AbpOpenApiConsts.AppKeyFieldName} Not Found", - $"{AbpOpenApiConsts.AppKeyFieldName} Not Found"); - await Unauthorized(httpContext, exception); - return false; - } - return true; - } - protected async virtual Task ValidatAppDescriptor(HttpContext httpContext) { httpContext.Request.Headers.TryGetValue(AbpOpenApiConsts.AppKeyFieldName, out var appKey);