Skip to content

Commit

Permalink
feat(open-api): remove request query validate
Browse files Browse the repository at this point in the history
  • Loading branch information
colinin committed Oct 25, 2024
1 parent 5c856ed commit 7bbd2fe
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ public async virtual Task<bool> AuthorizeAsync(HttpContext httpContext)
return false;
}

if (!await ValidateQueryString(httpContext))
{
return false;
}

if (!await ValidatAppDescriptor(httpContext))
{
return false;
Expand All @@ -87,20 +82,6 @@ protected async virtual Task<bool> ValidateClientIpAddress(HttpContext httpConte
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);
Expand Down

0 comments on commit 7bbd2fe

Please sign in to comment.