Skip to content

Commit

Permalink
Merge pull request #16 from dnd-side-project/feat/#15
Browse files Browse the repository at this point in the history
[Feat-15] 애플로그인 API 변경, refresh token 발급 메커니즘 변경
  • Loading branch information
youngreal authored Aug 23, 2024
2 parents d601d58 + f6d27cc commit 18825a5
Show file tree
Hide file tree
Showing 45 changed files with 723 additions and 555 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,21 @@ on:

env:
AWS_REGION: ap-northeast-2
AWS_S3_BUCKET: mapddang-s3
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET_NAME }}
AWS_CODE_DEPLOY_APPLICATION: mapddang-CD
AWS_CODE_DEPLOY_GROUP: mapddang-CD-group
MYSQL_URL: ${{ secrets.MYSQL_URL }}
MYSQL_USERNAME: ${{ secrets.MYSQL_USERNAME }}
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
APPLE_CLIENT_ID: ${{ secrets.APPLE_CLIENT_ID }}
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_PRIVATE_KEY: ${{ secrets.APPLE_PRIVATE_KEY }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
ACCESS_TOKEN_EXPIRE: ${{ secrets.ACCESS_TOKEN_EXPIRE }}
REFRESH_TOKEN_EXPIRE: ${{ secrets.REFRESH_TOKEN_EXPIRE }}
AWS_S3_ACCESS_KEY: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_S3_SECRET_KEY: ${{ secrets.AWS_S3_SECRET_KEY }}

jobs:
build-with-gradle:
Expand All @@ -30,19 +42,29 @@ jobs:
#gradlew 파일에 실행 권한 부여
- name: Grant execute permission to gradlew
run: chmod +x ./gradlew
#프로젝트 빌드(test 제외)
#프로젝트 빌드
- name: Build Project
run: ./gradlew clean build -x test
#AWS 자격증명 설정
- name: Setup AWS credential
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.EC2_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.EC2_SECRET_KEY }}
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_KEY }}
aws-region: ap-northeast-2
#ZIP 파일을 S3 버킷에 업로드
- name: Upload to AWS S3
run: aws deploy push --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --ignore-hidden-files --s3-location s3://$AWS_S3_BUCKET/cicdtest/$GITHUB_SHA.zip --source .
run: |
aws deploy push \
--application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} \
--ignore-hidden-files \
--s3-location s3://$AWS_S3_BUCKET/cicdtest/$GITHUB_SHA.zip \
--source .
#업로드된 ZIP 파일을 CodeDeploy로 배포
- name: AWS Code Deploy
run: aws deploy create-deployment --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=$AWS_S3_BUCKET,key=cicdtest/$GITHUB_SHA.zip,bundleType=zip
run: |
aws deploy create-deployment \
--application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} \
--s3-location bucket=$AWS_S3_BUCKET,bundleType=zip,key=cicdtest/$GITHUB_SHA.zip
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,22 @@ repositories {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'

//OpenFeign
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.1.3'

//JWT
implementation 'io.jsonwebtoken:jjwt-api:0.12.3'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.3'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.3'
implementation 'org.bouncycastle:bcprov-jdk18on:1.75'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.75'

//AWS S3
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'

implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/com/dnd/dndtravel/auth/apple/AppleClient.java

This file was deleted.

28 changes: 0 additions & 28 deletions src/main/java/com/dnd/dndtravel/auth/apple/AppleOauthService.java

This file was deleted.

This file was deleted.

54 changes: 0 additions & 54 deletions src/main/java/com/dnd/dndtravel/auth/apple/AppleTokenParser.java

This file was deleted.

42 changes: 0 additions & 42 deletions src/main/java/com/dnd/dndtravel/auth/apple/dto/ApplePublicKey.java

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/java/com/dnd/dndtravel/auth/apple/dto/AppleUser.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.dnd.dndtravel.auth.config;

import org.springframework.context.annotation.Bean;

import com.dnd.dndtravel.auth.service.AppleFeignClientErrorDecoder;
import com.fasterxml.jackson.databind.ObjectMapper;

public class AppleFeignClientConfiguration {

@Bean
public AppleFeignClientErrorDecoder appleFeignClientErrorDecoder() {
return new AppleFeignClientErrorDecoder(new ObjectMapper());
}
}
20 changes: 20 additions & 0 deletions src/main/java/com/dnd/dndtravel/auth/config/AppleProperties.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.dnd.dndtravel.auth.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import lombok.Getter;
import lombok.Setter;

@Component
@ConfigurationProperties(prefix = "social-login.provider.apple")
@Getter
@Setter // 프로퍼티 주입에 필수
public class AppleProperties {
private String grantType;
private String clientId;
private String keyId;
private String teamId;
private String audience;
private String privateKey;
}
50 changes: 0 additions & 50 deletions src/main/java/com/dnd/dndtravel/auth/config/JwtFilter.java

This file was deleted.

Loading

0 comments on commit 18825a5

Please sign in to comment.