-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from kakao-tech-campus-2nd-step3/week6
[Develop] 6주차 최종 코드 PR
- Loading branch information
Showing
113 changed files
with
2,568 additions
and
612 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
36 changes: 0 additions & 36 deletions
36
src/main/java/poomasi/domain/auth/controller/AuthController.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/main/java/poomasi/domain/auth/dto/request/LoginRequest.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/main/java/poomasi/domain/auth/dto/request/TokenRequest.java
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
src/main/java/poomasi/domain/auth/dto/response/TokenResponse.java
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
src/main/java/poomasi/domain/auth/entity/RefreshToken.java
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
src/main/java/poomasi/domain/auth/security/AuthTestController.java
This file contains 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,42 @@ | ||
package poomasi.domain.auth.security; | ||
|
||
|
||
import jdk.jfr.Description; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.security.access.annotation.Secured; | ||
import org.springframework.security.core.Authentication; | ||
import org.springframework.security.core.context.SecurityContextHolder; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import poomasi.domain.auth.security.userdetail.UserDetailsImpl; | ||
import poomasi.domain.member.entity.Member; | ||
|
||
@Slf4j | ||
@Description("접근 제어 확인 controller") | ||
@RestController | ||
public class AuthTestController { | ||
|
||
@Secured("ROLE_CUSTOMER") | ||
@GetMapping("/api/auth-test/customer") | ||
public String customer() { | ||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); | ||
Object impl = authentication.getPrincipal(); | ||
Member member = ((UserDetailsImpl) impl).getMember(); | ||
|
||
log.info("email : " + member.getEmail()); | ||
|
||
return "hi. customer"; | ||
} | ||
|
||
@Secured("ROLE_FARMER") | ||
@GetMapping("/api/need-auth/farmer") | ||
public String farmer() { | ||
return "hi. farmer"; | ||
} | ||
|
||
@GetMapping("/api/need-auth") | ||
public String needAuth() { | ||
return "auth"; | ||
} | ||
|
||
} |
Oops, something went wrong.