Skip to content

Commit 7130519

Browse files
committed
credentails 코드 삭제
1 parent 1cb164d commit 7130519

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

src/main/java/com/catcher/infrastructure/KmsService.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ public class KmsService {
2121
@Value("${aws.kms.keyId}")
2222
private static String KEY_ID;
2323

24-
@Value("${spring.profiles.active}")
25-
private static String PROFILE;
24+
// @Value("${spring.profiles.active}")
25+
// private static String PROFILE;
2626

2727
public String encrypt(String text) {
28+
// AWSKMS kmsClient = AWSKMSClientBuilder.standard()
29+
// .withCredentials(new ProfileCredentialsProvider(PROFILE))
30+
// .withRegion(Regions.AP_NORTHEAST_2)
31+
// .build();
2832
AWSKMS kmsClient = AWSKMSClientBuilder.standard()
29-
.withCredentials(new ProfileCredentialsProvider(PROFILE))
3033
.withRegion(Regions.AP_NORTHEAST_2)
3134
.build();
3235

@@ -40,10 +43,13 @@ public String encrypt(String text) {
4043
}
4144

4245
public String decrypt(String cipherBase64) {
46+
// AWSKMS kmsClient = AWSKMSClientBuilder.standard()
47+
// .withCredentials(new ProfileCredentialsProvider(PROFILE))
48+
// .withRegion(Regions.AP_NORTHEAST_2)
49+
// .build();
4350
AWSKMS kmsClient = AWSKMSClientBuilder.standard()
44-
.withCredentials(new ProfileCredentialsProvider(PROFILE))
45-
.withRegion(Regions.AP_NORTHEAST_2)
46-
.build();
51+
.withRegion(Regions.AP_NORTHEAST_2)
52+
.build();
4753

4854
DecryptRequest request = new DecryptRequest();
4955
request.withKeyId(KEY_ID);

src/main/resources/application-dev.properties

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
spring.profiles.active=dev
1+
# spring.config.activate.on-profile=dev
2+
# spring.profiles.active=dev
3+
4+
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
5+
6+
# need to change below 3 lines
7+
spring.datasource.url=AQICAHgxTvGwZVD/2MLMvR9/01Wy8IeL4nGHGGgc5XMYIhkQ2gGYe1wr8QYG1vCYAhVAo0JfAAAA1TCB0gYJKoZIhvcNAQcGoIHEMIHBAgEAMIG7BgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDC1cQFghJcu5/cY/4AIBEICBjdKJ7cmEZJNbv+7sXAZZ8S5DJfyInJZZGh65g2UMaZlDFYDp+AQW+hZ9M/phzxKBMsty+GQQDF3Zbmp3BWentnKWiq5f+1DN5p70Q2h+D5C2Jvc3WhMxyszR14BQ2GLVNJtybNyNdPWHv+qvYSNxCa0virEnwofy3VA8g7HYzIfjwvkQBfAB6TpfIrl4ig==
8+
spring.datasource.username=AQICAHgxTvGwZVD/2MLMvR9/01Wy8IeL4nGHGGgc5XMYIhkQ2gHjjS+iI8paQoWh2XynxxR6AAAAYzBhBgkqhkiG9w0BBwagVDBSAgEAME0GCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMdiC97kMQiVShzOL3AgEQgCBxmxxcHHGCCPJr4H/icaFXiSLq4r3ECD9Gi7I++rW69g==
9+
spring.datasource.password=AQICAHgxTvGwZVD/2MLMvR9/01Wy8IeL4nGHGGgc5XMYIhkQ2gGV2GRHq/RXnmgS71reYEZTAAAAaTBnBgkqhkiG9w0BBwagWjBYAgEAMFMGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQM/ffIoHU+vie1wK+wAgEQgCZYEWen/OI+P8YMByQl8h64J4m1iVQdsw4ohlJuIvjIrCkAaG4b1g==
10+
11+
## kms
12+
aws.kms.keyId=5d1c783d-6c8e-4661-a8ed-a12654aac8c3
13+
aws.kms.encryptionAlgorithm=SYMMETRIC_DEFAULT
14+
# aws.kms.profile=default
215

316
#update the schema with the given values.
417
spring.jpa.hibernate.ddl-auto=update

0 commit comments

Comments
 (0)