From 22a5ad3acef0bfb8353dac64d4cbe0d52f6d2a07 Mon Sep 17 00:00:00 2001
From: jack <jack.su@pollex.com.tw>
Date: 星期五, 01 九月 2023 10:16:41 +0800
Subject: [PATCH] [UPDATE] 解決弱點Use of hard-coded cryptographic key , 把key移到設定檔

---
 pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java |  120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 119 insertions(+), 1 deletions(-)

diff --git a/pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java b/pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java
index cbe8982..371b675 100644
--- a/pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java
+++ b/pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java
@@ -1,5 +1,9 @@
 package com.pollex.pam.config;
 
+import com.pollex.pam.business.config.AppProperties;
+import com.pollex.pam.business.config.SendEmailProperties;
+import com.pollex.pam.business.config.SendSMSProperties;
+import com.pollex.pam.business.enums.SendEmailMsgMethod;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
@@ -9,4 +13,118 @@
  * See {@link tech.jhipster.config.JHipsterProperties} for a good example.
  */
 @ConfigurationProperties(prefix = "application", ignoreUnknownFields = false)
-public class ApplicationProperties {}
+public class ApplicationProperties implements AppProperties {
+
+    private boolean mockLogin;
+    private String otpWebServiceUrl;
+    private String otpWebServicePassword;
+    private String otpWebServiceSystemType;
+    private String eServiceLoginUrl;
+    private String eServiceLoginFunc;
+    private String eServiceLoginSys;
+    private String frontEndDomain;
+    private SendSMSProperties sms;
+    private SendEmailProperties email;
+    private String fileFolderPath;
+    private String aesKey;
+
+    public boolean isMockLogin() {
+        return mockLogin;
+    }
+
+    public void setMockLogin(boolean mockLogin) {
+        this.mockLogin = mockLogin;
+    }
+
+    public String getOtpWebServiceUrl() {
+        return otpWebServiceUrl;
+    }
+
+    public void setOtpWebServiceUrl(String otpWebServiceUrl) {
+        this.otpWebServiceUrl = otpWebServiceUrl;
+    }
+
+    public String getOtpWebServicePassword() {
+        return otpWebServicePassword;
+    }
+
+    public void setOtpWebServicePassword(String otpWebServicePassword) {
+        this.otpWebServicePassword = otpWebServicePassword;
+    }
+
+    public String getOtpWebServiceSystemType() {
+        return otpWebServiceSystemType;
+    }
+
+    public void setOtpWebServiceSystemType(String otpWebServiceSystemType) {
+        this.otpWebServiceSystemType = otpWebServiceSystemType;
+    }
+
+    public String geteServiceLoginUrl() {
+        return eServiceLoginUrl;
+    }
+
+    public void seteServiceLoginUrl(String eServiceLoginUrl) {
+        this.eServiceLoginUrl = eServiceLoginUrl;
+    }
+
+    public String geteServiceLoginFunc() {
+        return eServiceLoginFunc;
+    }
+
+    public void seteServiceLoginFunc(String eServiceLoginFunc) {
+        this.eServiceLoginFunc = eServiceLoginFunc;
+    }
+
+    public String geteServiceLoginSys() {
+        return eServiceLoginSys;
+    }
+
+    public void seteServiceLoginSys(String eServiceLoginSys) {
+        this.eServiceLoginSys = eServiceLoginSys;
+    }
+
+    public String getFrontEndDomain() {
+        return frontEndDomain;
+    }
+
+    public void setFrontEndDomain(String frontEndDomain) {
+        this.frontEndDomain = frontEndDomain;
+    }
+
+    public SendSMSProperties getSms() {
+        return sms;
+    }
+
+    public void setSms(SendSMSProperties sms) {
+        this.sms = sms;
+    }
+
+    public SendEmailProperties getEmail() {
+        return email;
+    }
+
+    public void setEmail(SendEmailProperties email) {
+        this.email = email;
+    }
+
+	public String getFileFolderPath() {
+		return fileFolderPath;
+	}
+
+	public void setFileFolderPath(String fileFolderPath) {
+		this.fileFolderPath = fileFolderPath;
+	}
+	
+	@Override
+	public String getAesKey() {
+		return aesKey;
+	}
+
+	public void setAesKey(String aesKey) {
+		this.aesKey = aesKey;
+	}
+	
+	
+
+}

--
Gitblit v1.8.0