kjb-safedb 적용, 휴대폰 인증 개발용 설정 추가, 로깅 설정 일부 변경

This commit is contained in:
Rinjae
2025-09-29 18:33:58 +09:00
parent 050ec17a7f
commit 696350f8f3
11 changed files with 53 additions and 79 deletions
+4
View File
@@ -97,3 +97,7 @@ TODO.txt
*.zip *.zip
/src/docs/ /src/docs/
/docs/ /docs/
*.lck
*.log
+4
View File
@@ -5,3 +5,7 @@ include 'elink-portal-common'
project (':elink-online-core-jpa').projectDir = new File(settingsDir, "../eapim-online/elink-online-core-jpa") project (':elink-online-core-jpa').projectDir = new File(settingsDir, "../eapim-online/elink-online-core-jpa")
project (':elink-portal-common').projectDir = new File(settingsDir, "../elink-portal-common") project (':elink-portal-common').projectDir = new File(settingsDir, "../elink-portal-common")
include 'kjb-safedb'
project (':kjb-safedb').projectDir = new File(settingsDir, "../kjb-safedb")
@@ -1,30 +1,34 @@
package com.eactive.apim.portal.apps.auth.service; package com.eactive.apim.portal.apps.auth.service;
import org.springframework.beans.factory.annotation.Autowired; import com.eactive.apim.portal.config.PortalProperties;
import org.springframework.core.env.Environment; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.util.Arrays;
@Component @Component
@Slf4j
public class AuthNumberGenerator { public class AuthNumberGenerator {
private final Environment env; private final PortalProperties portalProperties;
@Autowired
public AuthNumberGenerator(Environment env) { public AuthNumberGenerator(PortalProperties portalProperties) {
this.env = env; this.portalProperties = portalProperties;
} }
public String generateAuthNumber() { public String generateAuthNumber() {
if (isDevProfile()) { if (StringUtils.hasLength(portalProperties.getAuthVirtualCode())) {
return "123456"; log.info("가상 인증코드 활성화 상태 - {}", portalProperties.getAuthVirtualCode());
return portalProperties.getAuthVirtualCode();
} }
SecureRandom rand = new SecureRandom(); SecureRandom rand = new SecureRandom();
return String.format("%06d", 100000 + rand.nextInt(900000)); return String.format("%06d", 100000 + rand.nextInt(900000));
} }
private boolean isDevProfile() { // private boolean isDevProfile() {
return Arrays.asList(env.getActiveProfiles()).contains("dev"); // return Arrays.asList(env.getActiveProfiles()).contains("dev");
} // }
} }
@@ -23,5 +23,7 @@ public class PortalProperties {
private int authTtl = 300; // 인증번호 만료시간, 초단위 private int authTtl = 300; // 인증번호 만료시간, 초단위
private String authVirtualCode = "";
private Map<RoleCode, List<String>> portalSecurity; private Map<RoleCode, List<String>> portalSecurity;
} }
@@ -1,19 +1,19 @@
package com.eactive.apim.portal.custom.config; package com.eactive.apim.portal.custom.config;
import com.eactive.ext.kjb.safedb.SafeDBWrapper; import com.eactive.ext.kjb.safedb.KjbSafedbWrapper;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
public class KjbPasswordEncoder implements PasswordEncoder { public class KjbPasswordEncoder implements PasswordEncoder {
@Override @Override
public String encode(CharSequence rawPassword) { public String encode(CharSequence rawPassword) {
SafeDBWrapper safedb = SafeDBWrapper.getInstance(); KjbSafedbWrapper safedb = KjbSafedbWrapper.getInstance();
return safedb.encryptPswd(rawPassword.toString()); return safedb.encryptPassword(rawPassword.toString());
} }
@Override @Override
public boolean matches(CharSequence rawPassword, String encodedPassword) { public boolean matches(CharSequence rawPassword, String encodedPassword) {
SafeDBWrapper safedb = SafeDBWrapper.getInstance(); KjbSafedbWrapper safedb = KjbSafedbWrapper.getInstance();
String encoded = safedb.encryptPswd(rawPassword.toString()); String encoded = safedb.encryptPassword(rawPassword.toString());
return encoded.equals(encodedPassword); return encoded.equals(encodedPassword);
} }
} }
@@ -1,58 +0,0 @@
spring:
jta:
enabled: true
jpa:
properties:
hibernate:
show_sql: true
format_sql: true
use_sql_comments: true
devtools:
restart:
enabled: false
livereload:
enabled: true
thymeleaf:
cache: false
ems:
datasource:
serverName: 192.168.240.177
portNumber: 3306
databaseName: apims
username: apims
password: apims
# serverName: 172.20.160.59
# portNumber: 3317
# databaseName: ndapims
# username: api_app
# password: Tapiapp*17
gateway:
datasource:
serverName: 192.168.240.177
portNumber: 3306
databaseName: apigw
username: apigw
password: apigw
# serverName: 172.20.160.59
# portNumber: 3317
# databaseName: ndapigw
# username: api_app
# password: Tapiapp*17
proxy:
targets:
stg: http://localhost:10000/monitoring
prod: http://localhost:10000/monitoring
# stg: http://inter-ndapiap01.k-bank.com:7090/monitoring
# prod: http://inter-ndapiap01.k-bank.com:7090/monitoring
timeout:
connect: 5000
read: 5000
+3
View File
@@ -34,6 +34,9 @@ gateway:
username: AGWAPP username: AGWAPP
password: AGWAPP123! password: AGWAPP123!
portal:
auth-virtual-code: 654321
proxy: proxy:
targets: targets:
stg: http://localhost:10000/monitoring stg: http://localhost:10000/monitoring
+4
View File
@@ -1,3 +1,5 @@
server.port: '30200'
spring: spring:
jta: jta:
enabled: true enabled: true
@@ -33,6 +35,8 @@ gateway:
password: AGWAPP123! password: AGWAPP123!
schema: AGWADM schema: AGWADM
portal:
auth-virtual-code: 654321
proxy: proxy:
targets: targets:
+3
View File
@@ -24,6 +24,9 @@ ems:
password: EMSAPP123! password: EMSAPP123!
schema: EMSADM schema: EMSADM
portal:
auth-virtual-code: 654321
gateway: gateway:
datasource: datasource:
serverName: 192.168.240.177 serverName: 192.168.240.177
+1
View File
@@ -52,6 +52,7 @@ sample-code-path: classpath:/templates/sample_code
portal: portal:
auth-ttl: 300 auth-ttl: 300
user-approval: true user-approval: true
password-expiration-days: 90 password-expiration-days: 90
+11 -4
View File
@@ -36,14 +36,21 @@
<appender-ref ref="ROLLING"/> <appender-ref ref="ROLLING"/>
</root> </root>
<springProfile name="dev">
<springProfile name="stage">
<root level="DEBUG"> <root level="DEBUG">
<appender-ref ref="ROLLING"/> <appender-ref ref="ROLLING"/>
</root> </root>
</springProfile> </springProfile>
<springProfile name="dev,gf63"> <springProfile name="stage">
<root level="INFO">
<appender-ref ref="ROLLING"/>
</root>
</springProfile>
<springProfile name="gf63">
<property name="LOG_PATH" value="d:/kjb-logs/${inst.Name:-devSvr00}"/>
<logger name="sun.rmi" level="INFO" additivity="false"/> <logger name="sun.rmi" level="INFO" additivity="false"/>
<logger name="javax" level="INFO" additivity="false"/> <logger name="javax" level="INFO" additivity="false"/>
@@ -69,7 +76,7 @@
</logger> </logger>
<root level="DEBUG"> <root level="INFO">
<appender-ref ref="ROLLING"/> <appender-ref ref="ROLLING"/>
<appender-ref ref="CONSOLE"/> <appender-ref ref="CONSOLE"/>
</root> </root>