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
@@ -1,30 +1,34 @@
package com.eactive.apim.portal.apps.auth.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import com.eactive.apim.portal.config.PortalProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.security.SecureRandom;
import java.util.Arrays;
@Component
@Slf4j
public class AuthNumberGenerator {
private final Environment env;
private final PortalProperties portalProperties;
@Autowired
public AuthNumberGenerator(Environment env) {
this.env = env;
public AuthNumberGenerator(PortalProperties portalProperties) {
this.portalProperties = portalProperties;
}
public String generateAuthNumber() {
if (isDevProfile()) {
return "123456";
if (StringUtils.hasLength(portalProperties.getAuthVirtualCode())) {
log.info("가상 인증코드 활성화 상태 - {}", portalProperties.getAuthVirtualCode());
return portalProperties.getAuthVirtualCode();
}
SecureRandom rand = new SecureRandom();
return String.format("%06d", 100000 + rand.nextInt(900000));
}
private boolean isDevProfile() {
return Arrays.asList(env.getActiveProfiles()).contains("dev");
}
// private boolean isDevProfile() {
// return Arrays.asList(env.getActiveProfiles()).contains("dev");
// }
}
@@ -23,5 +23,7 @@ public class PortalProperties {
private int authTtl = 300; // 인증번호 만료시간, 초단위
private String authVirtualCode = "";
private Map<RoleCode, List<String>> portalSecurity;
}
@@ -1,19 +1,19 @@
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;
public class KjbPasswordEncoder implements PasswordEncoder {
@Override
public String encode(CharSequence rawPassword) {
SafeDBWrapper safedb = SafeDBWrapper.getInstance();
return safedb.encryptPswd(rawPassword.toString());
KjbSafedbWrapper safedb = KjbSafedbWrapper.getInstance();
return safedb.encryptPassword(rawPassword.toString());
}
@Override
public boolean matches(CharSequence rawPassword, String encodedPassword) {
SafeDBWrapper safedb = SafeDBWrapper.getInstance();
String encoded = safedb.encryptPswd(rawPassword.toString());
KjbSafedbWrapper safedb = KjbSafedbWrapper.getInstance();
String encoded = safedb.encryptPassword(rawPassword.toString());
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
password: AGWAPP123!
portal:
auth-virtual-code: 654321
proxy:
targets:
stg: http://localhost:10000/monitoring
+4
View File
@@ -1,3 +1,5 @@
server.port: '30200'
spring:
jta:
enabled: true
@@ -33,6 +35,8 @@ gateway:
password: AGWAPP123!
schema: AGWADM
portal:
auth-virtual-code: 654321
proxy:
targets:
+3
View File
@@ -24,6 +24,9 @@ ems:
password: EMSAPP123!
schema: EMSADM
portal:
auth-virtual-code: 654321
gateway:
datasource:
serverName: 192.168.240.177
+1
View File
@@ -52,6 +52,7 @@ sample-code-path: classpath:/templates/sample_code
portal:
auth-ttl: 300
user-approval: true
password-expiration-days: 90
+11 -4
View File
@@ -36,14 +36,21 @@
<appender-ref ref="ROLLING"/>
</root>
<springProfile name="stage">
<springProfile name="dev">
<root level="DEBUG">
<appender-ref ref="ROLLING"/>
</root>
</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="javax" level="INFO" additivity="false"/>
@@ -69,7 +76,7 @@
</logger>
<root level="DEBUG">
<root level="INFO">
<appender-ref ref="ROLLING"/>
<appender-ref ref="CONSOLE"/>
</root>