This commit is contained in:
2026-10-18 05:46:34 +03:30
parent e9001a7735
commit 05d9454c24
2 changed files with 19 additions and 3 deletions
+13
View File
@@ -333,6 +333,19 @@ namespace xIdentityService.Interfaces
string token,
string request
);
//
Task<bool> UseApiKey(
XDeviceDto device,
XApiKeyUsageDto apiKeyUsage
);
Task<bool> UseApiKey(
XOpenActionInnerDto dto
);
Task<bool> UseApiKey(
string token,
string request
);
//
Task<XOpenActionUserInfoDto> GetUserInfo(
+6 -3
View File
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using xCommons.Extensions;
using xIdentityModels.Dtos;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using xIdentityService.Attributes;
@@ -8,7 +9,6 @@ using xIdentityService.Interfaces;
using xIdentityService.Extensions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http.Features;
using xIdentityModels.Dtos;
namespace xIdentityService.Middlewares
{
@@ -66,6 +66,7 @@ namespace xIdentityService.Middlewares
apiKey: apiKey
);
//
try
{
await next(context);
@@ -90,9 +91,11 @@ namespace xIdentityService.Middlewares
RequestedOn = requestedOn,
ResponseTimeMs = sw.ElapsedMilliseconds,
};
await identityProvider.AddApiKeyUsage();
// await identityProvider.AddApiKeyUsage();
}
} else
{
await next(context);
}
}
#endregion