Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nexus client 수정, 비밀번호 암호화 수정 #36

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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