Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0df2bcb
Merge pull request #68 from HSU-Makeus-Challenge-10th/Gibeom-Week7
kite-pp May 20, 2026
fdc4ba8
refactor : 리턴 리팩토링
kite-pp May 16, 2026
1e35650
feat : 의존성 추가
kite-pp May 16, 2026
1c599ee
feat : SecurityConfig 추가
kite-pp May 16, 2026
397f3a9
refactor : 안쓰는 에러 삭제
kite-pp May 19, 2026
b90c45f
feat : 회원가입 컨트롤러 추가
kite-pp May 19, 2026
487ba8e
feat : 회원가입 서비스 작성
kite-pp May 19, 2026
9beb252
feat : 회원가입 컨버터 작성
kite-pp May 19, 2026
8627cd5
feat : 회원가입 DTO 작성
kite-pp May 19, 2026
f2bd85a
feat : 회원 조회 Boolean 메소드 추가
kite-pp May 19, 2026
58b0f08
feat : 회원가입 성공 코드 추가
kite-pp May 19, 2026
c27c02e
feat : 에러코드 추가
kite-pp May 19, 2026
88d1525
feat : SecurityConfig 파일 추가
kite-pp May 19, 2026
288d256
docs : 8주차 키워드 정리
kite-pp May 19, 2026
380bc8d
feat : AuthMember 구현
kite-pp May 19, 2026
bcee1ae
feat : 유저 디테일을 가져오는 서비스 제작
kite-pp May 19, 2026
8ad2b46
feat : 인증, 인가 오류 처리
kite-pp May 19, 2026
4677dbf
refactor : 오타 수정
kite-pp May 20, 2026
e4640d2
chore: .env 파일 추적 제외
kite-pp May 22, 2026
7af73d2
feat : build.gradle 의존성 추가
kite-pp May 22, 2026
5fcaa5a
feat : JWT 관련 설정
kite-pp May 22, 2026
ca7c6f0
feat : 복호화 Util 클래스 추가
kite-pp May 22, 2026
8a210a3
feat : Token 검증 필터 추가
kite-pp May 22, 2026
9d4505c
feat : 토큰 필터 등록
kite-pp May 22, 2026
9c4dfb8
feat : AuthMember를 사용한 마이페이지 조회
kite-pp May 22, 2026
725df87
feat : MemberService 마이페이지 조회 메소드 수정
kite-pp May 22, 2026
f9e0cd9
feat : PassWord Error코드 추가
kite-pp May 22, 2026
937957f
feat : 사용자 로그인 DTO 추가
kite-pp May 22, 2026
539caae
feat : Converter 추가
kite-pp May 22, 2026
438566d
feat : 의존성 추가
kite-pp May 26, 2026
55ac5af
feat : JWT 관련 설정 추가
kite-pp May 26, 2026
3dc7122
feat : JwtUtil 추가
kite-pp May 26, 2026
84af938
feat : JWT 필터 추가
kite-pp May 26, 2026
2be1a91
feat : SecurityConfig 수정
kite-pp May 26, 2026
947ab52
feat : 컨트롤러에서 토큰으로 사용자 정보 리턴
kite-pp May 26, 2026
65b263a
feat : MemberService 수정
kite-pp May 26, 2026
f0ca08d
feat : 유저 정보를 담을 DTO(OAuth, Kakao)
kite-pp May 26, 2026
1909e62
feat : Entity(인증에 담길 객체) 생성
kite-pp May 26, 2026
d850ad7
feat : 핸들러 생성
kite-pp May 26, 2026
01e87fb
feat : JWT 비즈니스 로직
kite-pp May 26, 2026
00e45b6
feat : 멤버 도메인 수정
kite-pp May 26, 2026
1b7ccc7
docs : 9주차 키워드 요약
kite-pp May 26, 2026
088b79e
chore: gitignore에 .idea/ 추가
kite-pp May 26, 2026
6c0524a
feat : gitActions 설정
kite-pp Jun 13, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
Binary file added .gradle/9.4.1/checksums/checksums.lock
Binary file not shown.
Binary file not shown.
Binary file added .gradle/9.4.1/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/9.4.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/9.4.1/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/9.4.1/gc.properties
Empty file.
Binary file added .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 2 additions & 0 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Thu Apr 30 21:19:35 KST 2026
gradle.version=9.4.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.gradle 디렉터리는 로컬 Gradle 실행 캐시이므로 PR에 포함하지 않는 것을 권장합니다. 빌드 결과와 캐시는 환경마다 달라질 수 있어 리뷰 diff를 흐리고 충돌 가능성을 높이므로, .gitignore.gradle/을 추가하고 이미 올라간 캐시 파일은 제거하는 것이 적절합니다.

Empty file added .gradle/vcs-1/gc.properties
Empty file.
73 changes: 0 additions & 73 deletions .idea/workspace.xml

This file was deleted.

3 changes: 0 additions & 3 deletions Gibeom/umc10th/.env

This file was deleted.

64 changes: 64 additions & 0 deletions Gibeom/umc10th/.github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI/CD Pipeline (.jar)

on:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

워크플로 파일이 Gibeom/umc10th/.github/workflows/ 아래에 있어 GitHub Actions가 인식하지 못할 가능성이 높습니다. GitHub Actions는 보통 저장소 루트의 .github/workflows/만 실행하므로, 배포 실습 의도라면 파일 위치를 루트로 옮기고 working-directory: Gibeom/umc10th 또는 각 step의 경로 기준을 함께 지정하는 것을 권장합니다.

push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: main 체크아웃
uses: actions/checkout@v4 # 체크아웃

- name: 자바 설정 # Java 개발 킷 설정
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 job은 저장소 루트에서 실행되지만 gradlewGibeom/umc10th 하위 프로젝트에 있습니다. chmod +x gradlew, ./gradlew build, build/libs/*.jar 경로가 모두 실패할 수 있으므로, CI에서는 실행 위치와 산출물 경로를 프로젝트 구조에 맞게 명시해야 합니다.

- name: gradlew 실행 권한 부여
run: chmod +x gradlew

- name: gradle 세팅
uses: gradle/actions/setup-gradle@v4

- name: gradle 빌드
run: ./gradlew build -x test

- name: 빌드된 아티팩트 업로드
uses: actions/upload-artifact@v4
with:
name: BackEnd
path: build/libs/*.jar

deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: 아티팩트 다운로드
uses: actions/download-artifact@v4
with:
name: BackEnd
path: build/libs/

- name: EC2 배포
env:
EC2_SSH_KEY: ${{ secrets.EC2_SSH_KEY }}
EC2_USERNAME: ${{ secrets.EC2_USERNAME }}
EC2_HOST: ${{ secrets.EC2_HOST }}
ENV: ${{ secrets.ENV }}
run: |
echo "$EC2_SSH_KEY" > private_key.pem
chmod 600 private_key.pem
jar_file=$(find build/libs -name '*.jar' ! -name '*plain.jar' | head -n 1)
scp -i private_key.pem -o StrictHostKeyChecking=no "$jar_file" $EC2_USERNAME@$EC2_HOST:/home/$EC2_USERNAME/BackEnd.jar
echo "$ENV" | ssh -i private_key.pem -o StrictHostKeyChecking=no $EC2_USERNAME@$EC2_HOST "
cat > .env
pgrep java | xargs -r kill -15 # 기존에 실행 중인 Java 프로세스 종료
sleep 10
nohup java -jar /home/$EC2_USERNAME/BackEnd.jar > app.log 2>&1 & # 새 버전 애플리케이션 실행
"
rm -f private_key.pem # 민감한 정보 삭제
14 changes: 14 additions & 0 deletions Gibeom/umc10th/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-security'

// Jwt
implementation 'io.jsonwebtoken:jjwt-api:0.12.3'
implementation 'io.jsonwebtoken:jjwt-impl:0.12.3'
implementation 'io.jsonwebtoken:jjwt-jackson:0.12.3'
implementation 'org.springframework.boot:spring-boot-configuration-processor'

compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
Expand All @@ -31,9 +38,16 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testAnnotationProcessor 'org.projectlombok:lombok'

// Security
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.1'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:3.0.1'

// OAuth
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
}

tasks.named('test') {
Expand Down
26 changes: 0 additions & 26 deletions Gibeom/umc10th/feedback_summary/FeedBack_Study

This file was deleted.

90 changes: 0 additions & 90 deletions Gibeom/umc10th/keyword_summary/ch07.md

This file was deleted.

53 changes: 53 additions & 0 deletions Gibeom/umc10th/keyword_summary/ch09.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
- 세션과 토큰의 차이는?

세션 방식은 사용자의 정보를 서버가 저장함

- 이용자 수가 많으면 서버 부하가 커짐(모든 사용자 정보를 테이블로 보유하고 있음)

토큰 방식은 사용자가 내 정보가 포함된 토큰을 내밀기만 하면 됨

- 서버의 부담이 적음.
- 다만 사용자의 정보를 저장하지 않기 때문에 할 수 없는 기능도 있음.

세션 : 입장권인데 적혀있는 게 거의 없음. 사이트가 입장권 검사하고 저장해놓음.

토큰 : 뭐가 많이 적혀있는 입장권. 사이트는 입장권 들고있으면 입장 허용해줌.

(참고자료) https://youtu.be/XXseiON9CV0?si=Am8JlSoLV0SiZX0W

- 엑세스 토큰과 리프레시 토큰이란?

액세스 토큰 : 접근하기 위해 필요한 기본적인 토큰, 해킹 공격 방지를 위해 유효기간이 짧다.

리프레쉬 토큰 : 만료된 액세스 토큰을 재생성해주는 토큰.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refresh Token을 “Access Token을 재생성해주는 토큰”으로만 설명하면 저장 위치, 만료 정책, 탈취 시 무효화 전략이 빠질 수 있습니다. 서버 저장 여부, 재발급 API 흐름, 회전 전략까지 함께 정리하는 것을 권장합니다.


- OAuth 1.0과 OAuth 2.0의 차이는?

OAuth 2.0 은 1.0과 달리 복잡한 암호화 서명 과정을 간소화하고, 웹/모바일 등 다양한 환경에 맞춘 인증 방식을 도입해 속도와 확장성을 대폭 개선한 버전

핵심 차이점

| 구분 | OAuth 1.0 | OAuth 2.0 |
| --- | --- | --- |
| 핵심 매커니즘 | 모든 요청에 디지털 서명 필요 | 발급받은 액세스 토큰만으로 인증 |
| 암호화 요구사항 | HTTPS가 필수가 아님 | HTTPS(TLS) 필수 |
| 역할의 분리 | 단순함(Client, Server, User) | 인증서버와 리소스 서버의 분리 |
| 토큰 만료 | 토큰 만료 개념이 없거나 복잡 | 만료기간이 존재하며, 리프레시 토큰으로 갱신가능 |
| 지원 환경 | 웹 브라우저 기반 애플리케이션 중심 | 모바일 앱, Iot, 데스크톱 등 다양한 환경 지원 |


왜 2.0으로 바뀌었을까?

1. 개발의 복잡성 해결(디지털 서명의 폐지)

1.0은 API를 호출할 때마다 복잡한 암호화 알고리즘으로 디지털 서명을 생성하고 이를 헤더에 담아 보내야 했음. 이 서명을 만드는 과정이 조금만 틀려도 인증이 실패했기 때문에 매우 불편했음.

2.0은 이 서명 과정을 과감히 버렸음. 대신 HTTPS통신을 필수로 규정해 연결 자체를 암호화하고, 발급받은 문자열 토큰만 헤더에 얹어서 보내면 되도록 단순화 했음

2. 모바일 및 다양한 디바이스 지원

OAuth 1.0이 나올 당시에는 웹브라우저 중심의 환경이었음. 하지만 모바일 앱, IoT 등의 기기들이 생기면서 브라우저가 없거나 화면이 없는 환경에서도 인증을 처리해야 할 필요가 생김. OAuth 2.0은 시나리오별 인증방식을 여러개 제공해 맞춤형 인증을 제공함

3. 대규모 서비스 분할(확장성)

OAuth 2.0은 인증을 담당하는 서버와 실제 데이터를 가지고 있는 서버의 역할을 명확히 나눴음. 덕분에 대기업이나 대규모 서비스에서는 인증서버만 따로 구축해 트래픽을 분산할 수 있음.
Loading