-
Notifications
You must be signed in to change notification settings - Fork 1
test: add google login test #264
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package inha.gdgoc.domain.test.controller; | ||
|
|
||
| import inha.gdgoc.global.dto.response.ApiResponse; | ||
| import java.util.Map; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.CookieValue; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.RequestHeader; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/v1/test") | ||
| public class TestController { | ||
|
|
||
| @GetMapping("/login_test") | ||
| public ResponseEntity<ApiResponse<Map<String, Object>, Void>> loginTest( | ||
| @CookieValue(value = "refresh_token", required = false) String refreshToken, | ||
| @RequestHeader(value = "Authorization", required = false) String authorization | ||
| ) { | ||
| boolean hasRefreshToken = refreshToken != null && !refreshToken.isBlank(); | ||
| boolean hasAuthorization = authorization != null && !authorization.isBlank(); | ||
|
|
||
| Map<String, Object> data = Map.of( | ||
| "has_refresh_token", hasRefreshToken, | ||
| "has_authorization", hasAuthorization | ||
| ); | ||
|
|
||
| return ResponseEntity.ok(ApiResponse.ok("LOGIN_TEST_OK", data)); | ||
| } | ||
|
Comment on lines
+16
to
+30
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. νλ‘λμ νκ²½μμ ν μ€νΈ μλν¬μΈνΈ λ ΈμΆμ μ νν΄μΌ ν©λλ€. μ΄ ν μ€νΈ μλν¬μΈνΈκ° λͺ¨λ νκ²½μμ 곡κ°μ μΌλ‘ μ κ·Ό κ°λ₯νλλ‘ μ€μ λμ΄ μμ΅λλ€. νλ‘λμ νκ²½μμ ν μ€νΈ μλν¬μΈνΈλ₯Ό λ ΈμΆνλ©΄ 보μ μνμ΄ λ°μν μ μμ΅λλ€. λ€μ μ€ νλλ₯Ό μ μ©νλ κ²μ κΆμ₯ν©λλ€:
π νλ‘ν κΈ°λ° νμ±ν μ μ+import org.springframework.context.annotation.Profile;
+
+@Profile({"local", "dev", "test"})
@RestController
@RequestMapping("/api/v1/test")
public class TestController {λλ μ‘°κ±΄λΆ λΉ λ±λ‘μ μ¬μ©: +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+
+@ConditionalOnProperty(name = "feature.test-endpoints.enabled", havingValue = "true")
@RestController
@RequestMapping("/api/v1/test")
public class TestController {
π€ Prompt for AI Agents |
||
| } | ||
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.
PR μ λͺ©κ³Ό ꡬν λ΄μ©μ΄ λΆμΌμΉν©λλ€.
PR μ λͺ©μ "test: add google login test"μ΄μ§λ§, μ΄ μ»¨νΈλ‘€λ¬λ Google λ‘κ·ΈμΈμ ν μ€νΈνμ§ μμ΅λλ€. λ¨μν ν ν°κ³Ό ν€λμ μ‘΄μ¬ μ¬λΆλ§ νμΈν©λλ€.
PR μ λͺ©μ ꡬνμ λ§κ² μμ νκ±°λ, Google λ‘κ·ΈμΈμ μ€μ λ‘ ν μ€νΈνλ λ‘μ§μ μΆκ°νλ κ²μ κΆμ₯ν©λλ€.