Browse Source
Merge pull request #1029 from colinin/open-api-query
feat(open-api): remove request query validate
pull/1050/head
yx lin
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
0 additions and
19 deletions
-
aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs
|
|
|
@ -59,11 +59,6 @@ namespace LINGYUN.Abp.OpenApi.Authorization |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (!await ValidateQueryString(httpContext)) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (!await ValidatAppDescriptor(httpContext)) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
@ -87,20 +82,6 @@ namespace LINGYUN.Abp.OpenApi.Authorization |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
protected async virtual Task<bool> 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<bool> ValidatAppDescriptor(HttpContext httpContext) |
|
|
|
{ |
|
|
|
httpContext.Request.Headers.TryGetValue(AbpOpenApiConsts.AppKeyFieldName, out var appKey); |
|
|
|
|