-
Notifications
You must be signed in to change notification settings - Fork 0
[JWT 인증 서버] 이민구 제출합니다. #45
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
Open
LEEMINGU03
wants to merge
29
commits into
LEEMINGU03
Choose a base branch
from
LEEMINGU03-spring-security
base: LEEMINGU03
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
684a026
Docs/README 작성
LEEMINGU03 a7008d3
Docs/postman
LEEMINGU03 89717d4
Setting/ 세팅
LEEMINGU03 2f542a3
Feat/회원가입 controller
LEEMINGU03 035fc74
Feat/ 생성시간
LEEMINGU03 6ee84f3
Feat/ CustomUserDetails(UserDetails 상속)
LEEMINGU03 ba68a37
Feat/ CustomUserDetailsService(UserDetailsService상속)
LEEMINGU03 a2478cf
Feat/ 예외처리
LEEMINGU03 915f135
Feat/ 회원가입 dto
LEEMINGU03 6a977b5
Feat/ 회원가입 dto
LEEMINGU03 79f7673
Feat/ 회원가입 service
LEEMINGU03 d6341c4
Feat/ JWT 토큰을 검증
LEEMINGU03 02d992f
Feat/ login dto
LEEMINGU03 18649f5
Feat/ login fillter
LEEMINGU03 9e53be2
Feat/ 게시판 entity
LEEMINGU03 e2891a5
Feat/ 게시판 controller
LEEMINGU03 d3d1dd6
Feat/ 게시판 생성 요청 dto
LEEMINGU03 44f3757
Feat/ 게시판 레파지토리
LEEMINGU03 e272daf
Feat/ 게시판 응답 dto
LEEMINGU03 bff9c0c
Feat/ 게시판 service
LEEMINGU03 708dc24
Feat/ 게시판 수정 dto
LEEMINGU03 8ab851c
Feat/ Rsdata
LEEMINGU03 a292b6b
Feat/ Spring Security 설정
LEEMINGU03 b739d9f
Feat/ 실행
LEEMINGU03 253f602
Feat/ user entity
LEEMINGU03 46aaf0c
Feat/ user 레포
LEEMINGU03 d9a718c
Feat/ test
LEEMINGU03 c5fb006
Docs/ 스크린샷
LEEMINGU03 06601d5
Refactor/ 수정
LEEMINGU03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| /gradlew text eol=lf | ||
| *.bat text eol=crlf | ||
| *.jar binary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| HELP.md | ||
| .gradle | ||
| build/ | ||
| !gradle/wrapper/gradle-wrapper.jar | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
|
|
||
| ### STS ### | ||
| .apt_generated | ||
| .classpath | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
| bin/ | ||
| !**/src/main/**/bin/ | ||
| !**/src/test/**/bin/ | ||
|
|
||
| ### IntelliJ IDEA ### | ||
| .idea | ||
| *.iws | ||
| *.iml | ||
| *.ipr | ||
| out/ | ||
| !**/src/main/**/out/ | ||
| !**/src/test/**/out/ | ||
|
|
||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
|
|
||
| ### VS Code ### | ||
| .vscode/ | ||
|
|
||
| .env | ||
| .idea/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이미지 파일명은 token인데 테스트 결과 화면은 조회 결과 완료된 이미지 내용인 부분을 확인했습니다. 혹시 파일 명을 token으로 지정해주신 이유에 대해서 설명해주실 수 있을까요? |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # 과제명 | ||
| JWT 인증 서버 | ||
|
|
||
| ## ⚙️ 실행 방법 | ||
| 1. mysql 생성 후 SCHEMAS 생성 | ||
| 2. .env 에 DB정보 입력 | ||
| 3. SpringsecurityApplication 실행 | ||
|
|
||
| ## 💡 작업 내용 | ||
| - 회원가입 - POST /auth/register | ||
| - 로그인 - POST /auth/login → JWT 토큰 수령 | ||
| - GET /posts (protected) → Authorization: Bearer {token} | ||
|
|
||
| # API 명세 | ||
|
|
||
| | Method | URI | 설명 | | ||
| |--------|---------------|------| | ||
| | POST | /post | 게시글 생성 | | ||
| | GET | /post | 게시글 목록 조회 | | ||
| | GET | /post/{id} | 게시글 단건 조회 | | ||
| | PUT | /post/{id} | 게시글 수정 | | ||
| | DELETE | /post/{id} | 게시글 삭제 | | ||
| | POST | auth/register | 회원가입| | ||
| | POST | auth/login | JWT 토큰 수령 | | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| # API 성공 세부 사항 | ||
| - 200-1: 게시물 등록 성공 | ||
| - 200-2: 게시물 단건 조회 선공 | ||
| - 200-3: 게시물 수정 조회 선공 | ||
| - 200-4: 게시물 삭제 선공 | ||
| - 200-5: 게시물 전체 조회 선공 | ||
| - 200-6 : 로그인 성공 | ||
|
|
||
| ## 🤔 느낀 점 / 어려웠던 점 | ||
| - 전체적인 회원가입과 로그인의 구조에 대해 알게 되었습니다.. | ||
| - 하지만 refresh 토큰과 access 토큰을 사용해서 보안을 강화 하는법과 예외처리하는 법을 더욱 자세히 작성해야할거같습니다(시험끝나고 보안하겠습니다) | ||
| - spring security 가 Dispatcher Servlet 앞단에 어떻게 작동하는지에 대해 집중하여 학습해보았습니다. | ||
| - 헷갈리는 것도 많고 했지만 많은 자료들을 찾아보며 작성하였습니다. | ||
| - 예외처리가 많이 부족하게 되어있습니다... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'org.springframework.boot' version '4.0.6' | ||
| id 'io.spring.dependency-management' version '1.1.7' | ||
| } | ||
|
|
||
| group = 'com.project' | ||
| version = '0.0.1-SNAPSHOT' | ||
|
|
||
| java { | ||
| toolchain { | ||
| languageVersion = JavaLanguageVersion.of(21) | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
| implementation 'org.springframework.boot:spring-boot-starter-security' | ||
| implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' | ||
| implementation 'org.springframework.boot:spring-boot-starter-webmvc' | ||
| implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6' | ||
| compileOnly 'org.projectlombok:lombok' | ||
| developmentOnly 'org.springframework.boot:spring-boot-devtools' | ||
| runtimeOnly 'com.mysql:mysql-connector-j' | ||
| annotationProcessor 'org.projectlombok:lombok' | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test' | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-security-test' | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-thymeleaf-test' | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test' | ||
| testCompileOnly 'org.projectlombok:lombok' | ||
| testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
| testAnnotationProcessor 'org.projectlombok:lombok' | ||
| implementation 'io.jsonwebtoken:jjwt-api:0.12.3' | ||
| runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.3' | ||
| runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.3' | ||
| } | ||
|
|
||
| tasks.named('test') { | ||
| useJUnitPlatform() | ||
| } |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip | ||
| networkTimeout=10000 | ||
| retries=0 | ||
| retryBackOffMs=500 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password 값을 encoder 사용해서 암호화 걸어주신 부분 잘 처리해주셨네요! 😊