260707_02_ENH: apikey 오류 수정
This commit is contained in:
@@ -50,10 +50,10 @@ namespace REPORT_API_ver6.Controllers
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
var configuration = Common.GetConfiguration();
|
var configuration = Common.GetConfiguration();
|
||||||
var value = configuration.GetSection("X-API-Key")[xApiKey ?? ""];
|
var apikey = configuration.GetSection("X-API-Key")[xApiKey ?? ""];
|
||||||
UserInfo? userInfo = String.IsNullOrEmpty(token)? null : Security.ValidateToken(token);
|
UserInfo? userInfo = String.IsNullOrEmpty(token)? null : Security.ValidateToken(token);
|
||||||
|
|
||||||
if (userInfo != null || !String.IsNullOrEmpty(value))
|
if (userInfo != null || !String.IsNullOrEmpty(apikey))
|
||||||
{
|
{
|
||||||
intranetCd = intranetCd.Split("_")[0];
|
intranetCd = intranetCd.Split("_")[0];
|
||||||
Project project = new Project();
|
Project project = new Project();
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ namespace REPORT_API_ver6.Controllers
|
|||||||
hcAccessor.HttpContext.Response.ContentType = "text/plain";
|
hcAccessor.HttpContext.Response.ContentType = "text/plain";
|
||||||
|
|
||||||
var configuration = Common.GetConfiguration();
|
var configuration = Common.GetConfiguration();
|
||||||
var value = configuration.GetSection("X-API-Key")[xApiKey ?? ""];
|
var apikey = configuration.GetSection("X-API-Key")[xApiKey ?? ""];
|
||||||
UserInfo? userInfo = String.IsNullOrEmpty(token)? null : Security.ValidateToken(token);
|
UserInfo? userInfo = String.IsNullOrEmpty(token)? null : Security.ValidateToken(token);
|
||||||
|
|
||||||
if (userInfo != null || !String.IsNullOrEmpty(value))
|
if (userInfo != null || !String.IsNullOrEmpty(apikey))
|
||||||
{
|
{
|
||||||
Project project = new Project();
|
Project project = new Project();
|
||||||
if (project.getProjectInfo(pkey, Convert.ToInt32(iskiwi)).Rows.Count > 0)
|
if (project.getProjectInfo(pkey, Convert.ToInt32(iskiwi)).Rows.Count > 0)
|
||||||
|
|||||||
@@ -30,19 +30,19 @@ namespace REPORT_API_ver6.Controllers
|
|||||||
hcAccessor.HttpContext.Response.ContentType = "text/plain";
|
hcAccessor.HttpContext.Response.ContentType = "text/plain";
|
||||||
|
|
||||||
var configuration = Common.GetConfiguration();
|
var configuration = Common.GetConfiguration();
|
||||||
var value = configuration.GetSection("X-API-Key")[xApiKey ?? ""];
|
var apikey = configuration.GetSection("X-API-Key")[xApiKey ?? ""];
|
||||||
UserInfo? userInfo = String.IsNullOrEmpty(token)? null : Security.ValidateToken(token);
|
UserInfo? userInfo = String.IsNullOrEmpty(token)? null : Security.ValidateToken(token);
|
||||||
|
|
||||||
if (userInfo != null || !String.IsNullOrEmpty(value))
|
if (userInfo != null || !String.IsNullOrEmpty(apikey))
|
||||||
{
|
{
|
||||||
string okey = "REPORT";
|
string okey = "REPORT";
|
||||||
if(userInfo.ID == "KON" || userInfo.ID == "KIWI" || userInfo.ID == "NEWSSAK")
|
if(userInfo != null && (userInfo.ID == "KON" || userInfo.ID == "KIWI" || userInfo.ID == "NEWSSAK"))
|
||||||
{
|
{
|
||||||
okey = userInfo.ID;
|
okey = userInfo.ID;
|
||||||
}
|
}
|
||||||
else if(!String.IsNullOrEmpty(value))
|
else if(!String.IsNullOrEmpty(apikey))
|
||||||
{
|
{
|
||||||
okey = value;
|
okey = apikey;
|
||||||
}
|
}
|
||||||
|
|
||||||
PkeyInfo pkeyInfo = new PkeyInfo(skey);
|
PkeyInfo pkeyInfo = new PkeyInfo(skey);
|
||||||
@@ -54,7 +54,7 @@ namespace REPORT_API_ver6.Controllers
|
|||||||
int mode = shortURLParam.Mode == "P" ? 1 : 0;
|
int mode = shortURLParam.Mode == "P" ? 1 : 0;
|
||||||
string returnString = "https://kart.kric.com/External/" + URI.GetURIKey(shortURLParam.RealURI, mode, skey, proejctInfo.Rows[0]["title"].ToString(), okey);
|
string returnString = "https://kart.kric.com/External/" + URI.GetURIKey(shortURLParam.RealURI, mode, skey, proejctInfo.Rows[0]["title"].ToString(), okey);
|
||||||
string cLogContent = "{ \"REAL_URI\": \"" + shortURLParam.RealURI + "\",\"MODE\": \"" + shortURLParam.Mode + "\", \"COPY_URI\": \"" + returnString + "\" }";
|
string cLogContent = "{ \"REAL_URI\": \"" + shortURLParam.RealURI + "\",\"MODE\": \"" + shortURLParam.Mode + "\", \"COPY_URI\": \"" + returnString + "\" }";
|
||||||
Log.InsertSiteLog(userInfo.ID, pkeyInfo.Pkey, "URL Copy", cLogContent);
|
Log.InsertSiteLog(userInfo != null ? userInfo.ID : apikey, pkeyInfo.Pkey, "URL Copy", cLogContent);
|
||||||
|
|
||||||
Response.StatusCode = (int)HttpStatusCode.OK;
|
Response.StatusCode = (int)HttpStatusCode.OK;
|
||||||
return Content(returnString);
|
return Content(returnString);
|
||||||
|
|||||||
Reference in New Issue
Block a user