-
Notifications
You must be signed in to change notification settings - Fork 0
[JWT 인증 서버] 최정훈 제출합니다. #49
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
haonkr
wants to merge
2
commits into
haonkr
Choose a base branch
from
haonkr-spring-security
base: haonkr
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
2 commits
Select commit
Hold shift + click to select a range
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,14 @@ | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
|
|
||
| target/ | ||
|
|
||
| .idea/ | ||
| *.iml | ||
|
|
||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| *.log | ||
| logs/ |
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,36 @@ | ||
| # 과제명 | ||
| JWT 인증 서버 | ||
|
|
||
| ## ⚙️ 실행 방법 | ||
| 1. MySQL에서 데이터베이스 생성 | ||
| ```sql | ||
| CREATE DATABASE security; | ||
| ``` | ||
|
|
||
| 2. '.env'에 데이터베이스 정보 설정 | ||
| ```env | ||
| DB_URL=jdbc:mysql://localhost:3306/security?serverTimezone=Asia/Seoul&Encoding=UTF-8&&useSSL=false&allowPublicKeyRetrieval=true | ||
| DB_USERNAME=(MySQL_사용자명) | ||
| DB_USERNAME(MySQL_패스워드) | ||
|
|
||
| JWT_SECRET=(Base 64로 인코딩된 JWT 비밀키) | ||
| JWT_EXPIRATION_MS=3600000 | ||
| ``` | ||
|
|
||
| 3. Spring Boot 실행 | ||
|
|
||
| ## 💡 작업 내용 | ||
| - POST /auth/register - 회원가입 구현 | ||
| - POST /auth/login → JWT 토큰 수령 구현 | ||
| - GET /posts (protected) → Authorization: Bearer {token} 구현 | ||
|
|
||
| ## 📡 API 명세 (Spring 과제의 경우) | ||
| | Method | URI | 설명 | | ||
| |--------|----------------|--------| | ||
| | POST | /auth/register | 회원가입 | | ||
| | POST | /auth/login | 로그인 | | ||
| | GET | /posts | 게시글 조회 | | ||
|
|
||
| ## 🤔 느낀 점 / 어려웠던 점 | ||
| - JWT의 생성, 검증, 필터 처리 과정이 여러 단계로 되어 있어 전체적인 흐름을 이해하는 데 어려웠다. | ||
| - 부족한 예외처리나 글로벌 예외처리는 시간이 좀 나면 작성해야겠다. |
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.
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,2 @@ | ||
| /mvnw text eol=lf | ||
| *.cmd text eol=crlf |
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,33 @@ | ||
| HELP.md | ||
| target/ | ||
| .mvn/wrapper/maven-wrapper.jar | ||
| !**/src/main/**/target/ | ||
| !**/src/test/**/target/ | ||
|
|
||
| ### STS ### | ||
| .apt_generated | ||
| .classpath | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
|
|
||
| ### IntelliJ IDEA ### | ||
| .idea | ||
| *.iws | ||
| *.iml | ||
| *.ipr | ||
|
|
||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
| build/ | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
|
|
||
| ### VS Code ### | ||
| .vscode/ |
3 changes: 3 additions & 0 deletions
3
spring-security/spring-security/.mvn/wrapper/maven-wrapper.properties
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 @@ | ||
| wrapperVersion=3.3.4 | ||
| distributionType=only-script | ||
| distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip |
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.
trace는 지금 서버 내에서 뜨는 로그 내용을 출력해주는거 같은데 저 내용을 클라이언트 입장에서 봤을 때 서버가 어떤 구조로 동작하고 어떻게 처리하는지 파악해 보안 위험이 있습니다. 그래서 클라이언트한테는 서버 로그를 보여주는 방식이 아닌 간단한 에러 메시지만 반환하고 서버로그는 서버 내부에서만 확인 가능하도록 처리하는 방식이 좋습니다.
혹시 trace 즉 서버 로그를 body값에 넘겨주는 특별한 의도가 있는지 정훈님의 의견을 들어보고 싶습니다!