last ...
This commit is contained in:
@@ -303,8 +303,10 @@ namespace xIds.Providers
|
||||
//
|
||||
newExpiration = TimeSpan
|
||||
.FromMinutes(apiKeyConfiguration.DefaultExpirationMinutes);
|
||||
expiredDate = DateTime.UtcNow.Add(newExpiration.Value);
|
||||
}
|
||||
expiredDate = DateTime.UtcNow.Add(newExpiration.Value);
|
||||
|
||||
//
|
||||
if (!expiredDate.HasValue)
|
||||
{
|
||||
XException.InvalidArgs.Throw();
|
||||
@@ -496,6 +498,12 @@ namespace xIds.Providers
|
||||
result.Errors.Add("ApiKey Rate Limit Reached ...");
|
||||
}
|
||||
|
||||
//
|
||||
var requiredScopes =
|
||||
requiredScope.IsNullOrEmpty()
|
||||
? []
|
||||
: requiredScope.ParseListString<string>();
|
||||
|
||||
//
|
||||
// Audit Log ...
|
||||
|
||||
@@ -507,7 +515,9 @@ namespace xIds.Providers
|
||||
var isScopeValid =
|
||||
!allowedScopes.HasChild() ||
|
||||
requiredScope.IsNullOrEmpty() ||
|
||||
allowedScopes.Contains(requiredScope);
|
||||
requiredScopes
|
||||
.All(ts => allowedScopes
|
||||
.Any(asc => asc.ToNormalString() == ts.ToNormalString()));
|
||||
var isScopeIpValid =
|
||||
isIpValid &&
|
||||
isScopeValid
|
||||
|
||||
Reference in New Issue
Block a user