Skip to content

Commit

Permalink
Merge branch 'develop' into hwan2-99_feature/set-entity
Browse files Browse the repository at this point in the history
  • Loading branch information
YeaChan05 authored Feb 8, 2024
2 parents 7404f2f + 68bb00f commit cdcefc1
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 10 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/pull-request-intergration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ permissions:
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest # 실행 환경 지정

setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
Expand All @@ -33,6 +32,11 @@ jobs:
java-version: '17'
distribution: 'temurin'

cache-dependencies:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Caching Dependencies
uses: actions/cache@v3
with:
Expand All @@ -42,22 +46,33 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
build:
needs: cache-dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build -x test

test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test with Gradle
run: ./gradlew test

report:
needs: test
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Report Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ always() }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build/
!**/src/test/**/build/

### Config ###
.yml
src/main/resources/application-prod.yml

### STS ###
.apt_generated
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.kakaoshare.backend.common.config;

import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JasyptConfig {

public static final String PBE_WITH_MD_5_AND_DES = "PBEWithMD5AndDES";
public static final String BASE_64 = "base64";
public static final String ITERATIONS = "1000";
public static final String RANDOM_SALT_GENERATOR = "org.jasypt.salt.RandomSaltGenerator";
public static final String POOL_SIZE = "1";

@Value("${jasypt.encryptor.password}")
private String encryptKey;

@Bean("jasyptStringEncryptor")
public StringEncryptor stringEncryptor(){
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
config.setPassword(encryptKey);
config.setPoolSize(POOL_SIZE);
config.setAlgorithm(PBE_WITH_MD_5_AND_DES);
config.setStringOutputType(BASE_64);
config.setKeyObtentionIterations(ITERATIONS);
config.setSaltGeneratorClassName(RANDOM_SALT_GENERATOR);
encryptor.setConfig(config);
return encryptor;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spring:
hibernate:
ddl-auto: create
datasource:
username: sa
username: ENC(2SkZyC/z/C0Um0i4IOtuAA==)
password:
driver-class-name: org.h2.Driver
1 change: 0 additions & 1 deletion src/main/resources/application.properties

This file was deleted.

1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ spring:
# active: prod
active: dev
# active: test
include: secret

0 comments on commit cdcefc1

Please sign in to comment.