Skip to content

Commit

Permalink
Merge pull request #36 from st-yclee/main
Browse files Browse the repository at this point in the history
nexus client 수정, 비밀번호 암호화 수정
  • Loading branch information
st-yclee authored Sep 19, 2024
2 parents 1dfc10c + 93dde32 commit 0be93a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/main/java/kr/co/mcmp/oss/service/OssServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ public Boolean checkConnection(OssDto ossDto) {
*/
public OssDto detailOss(Long ossIdx) {
Oss oss = ossRepository.findByOssIdx(ossIdx);
return OssDto.withDetailDecryptPassword(oss, encodingBase64String(decryptAesString(oss.getOssPassword())));
return OssDto.withDetailDecryptPassword(oss, decryptAesString(oss.getOssPassword()));
}

public OssDto detailOssByOssName(String ossName) {
Oss oss = ossRepository.findByOssName(ossName);
String pwd = oss.getOssPassword();
String decodePwd = Base64Utils.base64Decoding(pwd);
String decodePwd = AES256Utils.decrypt(pwd);
return OssDto.builder()
.ossIdx(oss.getOssIdx())
.ossTypeIdx(oss.getOssType().getOssTypeIdx())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import kr.co.mcmp.oss.dto.OssDto;
import kr.co.mcmp.oss.service.OssServiceImpl;
import kr.co.mcmp.util.Base64Util;
import kr.co.mcmp.util.Base64Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
Expand All @@ -25,10 +26,10 @@
@Service
public class NexusComponentAdapterClient {

private static final String GET_COMP_LIST = "/v1/components";
private static final String GET_COMP_DETAIL = "/v1/components/{id}";
private static final String DELETE_COMP_DELETE = "/v1/components/{id}";
private static final String POST_COMP_CREATE = "/v1/components";
private static final String GET_COMP_LIST = "/service/rest/v1/components";
private static final String GET_COMP_DETAIL = "/service/rest/v1/components/{id}";
private static final String DELETE_COMP_DELETE = "/service/rest/v1/components/{id}";
private static final String POST_COMP_CREATE = "/service/rest/v1/components";

private String nexusId = "";
private String nexusPwd = "";
Expand All @@ -42,7 +43,7 @@ private void getOssInfo() {
try {
OssDto nexus = ossService.detailOssByOssName("NEXUS");
this.nexusId = nexus.getOssUsername();
this.nexusPwd = nexus.getOssPassword();
this.nexusPwd = Base64Utils.base64Decoding(nexus.getOssPassword());
this.baseUrl = nexus.getOssUrl();
} catch (Exception e) {
throw new IllegalArgumentException ("DB Nexus 계정 정보가 없습니다.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import kr.co.mcmp.oss.dto.OssDto;
import kr.co.mcmp.oss.service.OssServiceImpl;
import kr.co.mcmp.util.Base64Util;
import kr.co.mcmp.util.Base64Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
Expand All @@ -23,12 +24,12 @@
@Service
public class NexusRepositoryAdapterClient {

private static final String GET_REPO_LIST = "/v1/repositories";
private static final String GET_REPO_BY_NAME = "/v1/repositories/{repositoryName}";
private static final String GET_REPO_DETAIL = "/v1/repositories/{format}/{type}/{repositoryName}";
private static final String POST_REPO_CREATE = "/v1/repositories/{format}/{type}";
private static final String PUT_REPO_UPDATE = "/v1/repositories/{format}/{type}/{repositoryName}";
private static final String DELETE_REPO_DELETE = "/v1/repositories/{repositoryName}";
private static final String GET_REPO_LIST = "/service/rest/v1/repositories";
private static final String GET_REPO_BY_NAME = "/service/rest/v1/repositories/{repositoryName}";
private static final String GET_REPO_DETAIL = "/service/rest/v1/repositories/{format}/{type}/{repositoryName}";
private static final String POST_REPO_CREATE = "/service/rest/v1/repositories/{format}/{type}";
private static final String PUT_REPO_UPDATE = "/service/rest/v1/repositories/{format}/{type}/{repositoryName}";
private static final String DELETE_REPO_DELETE = "/service/rest/v1/repositories/{repositoryName}";

private String nexusId = "";
private String nexusPwd = "";
Expand All @@ -41,7 +42,7 @@ private void getOssInfo() {
try {
OssDto nexus = ossService.detailOssByOssName("NEXUS");
this.nexusId = nexus.getOssUsername();
this.nexusPwd = nexus.getOssPassword();
this.nexusPwd = Base64Utils.base64Decoding(nexus.getOssPassword());
this.baseUrl = nexus.getOssUrl();
} catch (Exception e) {
throw new IllegalArgumentException ("DB Nexus 계정 정보가 없습니다.");
Expand Down

0 comments on commit 0be93a1

Please sign in to comment.