IsSkipIPorHost() PW/SMS 인증패스 기능 수정

This commit is contained in:
iyak 2025-09-05 03:53:21 +00:00
parent 525f0e7c7a
commit cee250389c
1 changed files with 45 additions and 0 deletions

View File

@ -2,6 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
@ -569,6 +570,48 @@ public static class Helpers
/// <returns>true:skip처리, false:skip하지않음</returns> /// <returns>true:skip처리, false:skip하지않음</returns>
/// </summary> /// </summary>
public static bool IsSkipIPorHost(IpHostSkipGb gb, string ip, string host) public static bool IsSkipIPorHost(IpHostSkipGb gb, string ip, string host)
{
// HS 기존코드 변경
bool isReulst = false;
ip = ip ?? "";
host = host ?? "";
// PassWord 스킵
string[] skipIpsForPassword = { "218.232.111.111" };
string[] skipHostsForPassword = { "ynictea.nptc.kr", "admin.ynicte.com" };
// SmsAuth 스킵
string[] skipIpsForSms = { "218.232.111.111" };
string[] skipHostsForSms = { "ynictea.nptc.kr", "admin.ynicte.com" };
switch (gb)
{
case IpHostSkipGb.PassWord:
if (skipIpsForPassword.Contains(ip) || skipHostsForPassword.Any(h => host.Contains(h)))
{
isReulst = true;
}
break;
case IpHostSkipGb.SmsAuth:
if (skipIpsForSms.Contains(ip) || skipHostsForSms.Any(h => host.Contains(h)))
{
isReulst = true;
}
break;
default:
isReulst = false;
break;
}
return isReulst;
}
/*
public static bool IsSkipIPorHost(IpHostSkipGb gb, string ip, string host)
{ {
string ipAddrs, hosts; string ipAddrs, hosts;
//ipAddrs1 = "127.0.0.1,218.232.111.111,59.150.105.195,59.150.105.198"; //ipAddrs1 = "127.0.0.1,218.232.111.111,59.150.105.195,59.150.105.198";
@ -600,6 +643,8 @@ public static class Helpers
} }
return false; return false;
} }
*/
/// <summary> /// <summary>
/// 문자열을 지정된 최대 자리수만큼 자르고 초과하면 "..."을 추가. /// 문자열을 지정된 최대 자리수만큼 자르고 초과하면 "..."을 추가.