Sort Ordering Usings and Add Support for User ID in OpenActions ...
This commit is contained in:
@@ -304,8 +304,8 @@ namespace xIds.Providers
|
||||
newExpiration = TimeSpan
|
||||
.FromMinutes(apiKeyConfiguration.DefaultExpirationMinutes);
|
||||
}
|
||||
expiredDate = DateTime.UtcNow.Add(newExpiration.Value);
|
||||
|
||||
expiredDate = DateTime.UtcNow.Add(newExpiration.Value);
|
||||
|
||||
//
|
||||
if (!expiredDate.HasValue)
|
||||
{
|
||||
@@ -431,8 +431,8 @@ namespace xIds.Providers
|
||||
|
||||
//
|
||||
// Here we Have to Parse Allowed Ips and Scopes ...
|
||||
var allowedIps = keyModel.AllowedIPs.IsNullOrEmpty()
|
||||
? []
|
||||
var allowedIps = keyModel.AllowedIPs.IsNullOrEmpty()
|
||||
? []
|
||||
: keyModel.AllowedIPs.ParseListString<string>();
|
||||
var allowedScopes = keyModel.AllowedScopes.IsNullOrEmpty()
|
||||
? []
|
||||
@@ -499,7 +499,7 @@ namespace xIds.Providers
|
||||
}
|
||||
|
||||
//
|
||||
var requiredScopes =
|
||||
var requiredScopes =
|
||||
requiredScope.IsNullOrEmpty()
|
||||
? []
|
||||
: requiredScope.ParseListString<string>();
|
||||
@@ -507,10 +507,10 @@ namespace xIds.Providers
|
||||
//
|
||||
// Check Scope and IP is Valid or not ...
|
||||
var isIpValid = allowedIps.IsClientIpPassed(clientIP);
|
||||
var isScopeValid =
|
||||
var isScopeValid =
|
||||
allowedScopes
|
||||
.IsScopePassed(requiredScopes);
|
||||
var isScopeIpValid =
|
||||
var isScopeIpValid =
|
||||
isIpValid &&
|
||||
isScopeValid
|
||||
;
|
||||
@@ -537,6 +537,27 @@ namespace xIds.Providers
|
||||
isApplicationActive;
|
||||
if (isValid)
|
||||
{
|
||||
//
|
||||
// Handle Attach Owner ...
|
||||
try
|
||||
{
|
||||
//
|
||||
var user = await identityManager.GetUserAsync(
|
||||
containsDetail: true,
|
||||
userSelectByParam: application.OwnerId
|
||||
);
|
||||
|
||||
//
|
||||
var owner = user.ToXPerson();
|
||||
result.Owner = owner;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//
|
||||
result.Errors.Add($"exception occured: {ex.Message}");
|
||||
return result;
|
||||
}
|
||||
|
||||
result.Errors.Clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user