diff --git a/Dtos/XOpenActionDto.cs b/Dtos/XOpenActionDto.cs
index 5f01cfd..2064cb0 100644
--- a/Dtos/XOpenActionDto.cs
+++ b/Dtos/XOpenActionDto.cs
@@ -11,6 +11,8 @@ namespace xIdentityModels.Dtos
public struct XOpenActions
{
public const string HandShake = "HandShake";
+ public const string GetApiKey = "GetApiKey";
+ public const string UseApiKey = "UseApiKey";
public const string GetUserInfo = "GetUserInfo";
public const string GetUserInfos = "GetUserInfos";
}
diff --git a/Extensions/xIdentityModelsExtensions.cs b/Extensions/xIdentityModelsExtensions.cs
index 1058cf4..2314eff 100644
--- a/Extensions/xIdentityModelsExtensions.cs
+++ b/Extensions/xIdentityModelsExtensions.cs
@@ -385,6 +385,51 @@ namespace xIdentityModels.Extensions
return result;
}
+ ///
+ /// Check Dest Client IP is Exists in Source or not ...
+ ///
+ ///
+ ///
+ ///
+ public static bool IsClientIpPassed(
+ this IEnumerable source,
+ string dest
+ )
+ {
+ //
+ // if Allowed IPs Empty means all Client IPs is Valid ...
+ var result =
+ !source.HasChild();
+ if (result)
+ {
+ return result;
+ }
+
+ //
+ result = !dest.IsNullOrEmpty();
+ if (!result)
+ {
+ return result;
+ }
+
+ //
+ result = source.Any(s => s.ToNormalString() == dest.ToNormalString());
+ if (!result)
+ {
+ //
+ if (dest == "::1")
+ {
+ //
+ result = source.Any(s =>
+ s.ToNormalString() == "127.0.0.1" ||
+ s.ToNormalString() == "localhost");
+ }
+ }
+
+ //
+ return result;
+ }
+
///
/// Check Specified User Contains Specified UserSelectByParam or not ...
///