Skip to content
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

Feat/bsmOauth #82

Closed
wants to merge 3 commits into from
Closed

Feat/bsmOauth #82

wants to merge 3 commits into from

Conversation

chaewu
Copy link
Member

@chaewu chaewu commented Apr 4, 2023

๐Ÿ“„ Summary

BsmOauth๋ฅผ ํ†ตํ•œ ํšŒ์›๊ฐ€์ž… ๋ฐ ๋กœ๊ทธ์ธ ๊ธฐ๋Šฅ ๊ตฌํ˜„


๐Ÿ”จ Tasks

  • Bsm ์„œ๋น„์Šค๋ฅผ ํ†ตํ•œ ํ•™์ƒ ๋ฐ ์„ ์ƒ๋‹˜ ๋กœ๊ทธ์ธ๊ณผ ํšŒ์›๊ฐ€์ž…

๐Ÿ™‹๐Ÿป More

Google Oauth ๋กœ๊ทธ์ธ ๋ฐ ํšŒ์›๊ฐ€์ž… ๋กœ์ง ์ˆ˜์ •

@chaewu chaewu requested a review from a team as a code owner April 4, 2023 06:00
@chaewu chaewu added the โœจ Feature ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ label Apr 4, 2023
Copy link
Member

@gimhanul gimhanul left a comment

Choose a reason for hiding this comment

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

๋ณด์™„์ 

  • ํ•ด๋‹น PR ๊ด€๋ จ ์ด์Šˆ BSM OAuthย #66 ์ž˜ ์ฝ์–ด๋ณด์‹œ๊ณ  ๋น ์ง„ ๋ถ€๋ถ„ ๋ณด์™„ํ•ด์ฃผ์„ธ์šฉ(BSM ์—ฐ๋™, BSM service link ๊บผ๋‚ด์˜ค๊ธฐ ๋“ฑ๋“ฑ)
  • CI details ํ™•์ธ ํ›„ failed ๊ณ ์ณ์ฃผ์„ธ์š”
  • ์„œ๋น„์Šค๋Š” ๋‹ค ๋ถ„๋ฆฌํ•ด์„œ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”(BSM Service ํ•˜๋‚˜์— ๋‹ค ๋ฐ•ํ˜€์žˆ์Œ)

ํ•ข ๋ง

  • ์ „์ฒด์ ์œผ๋กœ ์ฝ”๋“œ๋ฅผ ๊ฐˆ์•„ ์—Ž์œผ์‹  ๊ฒƒ ๊ฐ™์€๋ฐ ์ด๋Ÿฐ ์‚ฌ์†Œํ•œ ์‚ฌ์†Œํ•œ ๋ณ€๊ฒฝ๋“ค ๊ณค๋ž€ํ•ฉ๋‹ˆ๋‹ค (์‹ฌ์ฒญ์ด๋Š” ์ด๋ฏธ ์„œ๋น„์Šค์ค‘์ด๋ผ์„œ, ํ”„๋ก ํŠธ์—์„œ ์‚ฌ์†Œํ•œ ๋ณ€๊ฒฝ์ ์„ ๋‹ค ๊ณ ์น˜๊ธฐ ํž˜๋“ญ๋‹ˆ๋‹ค)
  • ~~์™œ ํ•˜์…จ๋‚˜์š”? ๊ฐ™์€ ๋ฆฌ๋ทฐ๋Š” ๊ณ ์น˜๋ผ๋Š” ๋œป์ด ์•„๋‹™๋‹ˆ๋‹ค. ์ง„์งœ ๊ถ๊ธˆํ•ด์„œ ๋ฌผ์–ด๋ณด๋‹ˆ๊นŒ ๋‹ต๋ณ€ํ•ด์ฃผ์„ธ์šฉ

package com.soogung.simblue.domain.auth.domain;


import lombok.*;
Copy link
Member

Choose a reason for hiding this comment

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

wildcard ์‚ฌ์šฉ์€ ์ง€์–‘ํ•ฉ๋‹ˆ๋‹ค

๊ด€๋ จ ๊ธ€ ์ฝ์–ด๋ณด์‹œ๊ณ  ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”
์ด๊ณณ๋ง๊ณ  ๋‹ค๋ฅธ ๊ณณ๋„!~

Comment on lines +28 to +31
public RefreshToken update(final String refreshToken, final long ttl) {
this.refreshToken = refreshToken;
this.ttl = ttl;
return this;
Copy link
Member

Choose a reason for hiding this comment

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

refresh token์ด ์ˆ˜์ •๋˜์–ด์•ผ ํ•˜๋Š” ์ด์œ ๋Š”?

Comment on lines 16 to +19
@Id
private String token;
private String id;

private String refreshToken;
Copy link
Member

Choose a reason for hiding this comment

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

๊ตณ์ด id๋ฅผ ๋”ฐ๋กœ ๋‘๋Š” ์ด์œ ๋Š” ๋ฌด์—‡์ธ๊ฐ€์š”? refresh token๋„ ์ถฉ๋ถ„ํžˆ uniqueํ• ํ…๋ฐ์šฉ


private String refreshToken;

private String role;
Copy link
Member

Choose a reason for hiding this comment

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

role์„ ์ €์žฅํ•˜๋Š” ์ด์œ ๋Š” ๋ญ”๊ฐ€์š”?

Comment on lines +34 to +35
public BsmTokenResponse userSignup(HttpServletRequest request) throws IOException {
return loginService.execute(request.getHeader("authCode"));
Copy link
Member

Choose a reason for hiding this comment

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

ํ—ค๋”๋ฅผ ๊บผ๋‚ด์˜ค๊ณ  ์‹ถ์€ ๊ฑฐ๋ฉด @RequestHeader annotation์„ ์‚ฌ์šฉํ•ด์„œ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋Š” ๊ฑธ๋กœ ์•Œ๊ณ ์žˆ์Šต๋‹ˆ๋‹น

Comment on lines +7 to +26
@Getter
@ConstructorBinding
@ConfigurationProperties(prefix = "jwt")
public class JwtProperties {
private final String header;
private final String secret;
private final Long accessExp;
private final Long refreshExp;
private final String prefix;

public JwtProperties(String header, String secret, Long accessExp, Long refreshExp, String prefix) {
this.header = header;
this.secret = secret;
this.accessExp = accessExp;
this.refreshExp = refreshExp;
this.prefix = prefix;
}

}

Copy link
Member

Choose a reason for hiding this comment

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

์ด๋ฏธ ์žˆ์Šต๋‹ˆ๋‹ค


public String createAccessToken(String email) {
return createToken(email, jwtProperties.getAccessTime());
return jwtProperties.getPrefix() + EMPTY.getMessage() + generateToken(authId, role, ACCESS_KEY.getMessage() ,jwtProperties.getAccessExp());
Copy link
Member

Choose a reason for hiding this comment

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

prefix๋ฅผ ์™œ ๋ถ™์—ฌ์„œ ์ฃผ๋Š”์ง€

Comment on lines +52 to +62
secret: ${JWT_SECRET}
accessExp: 3600000
refreshExp: 2592000000
prefix: Bearer


# refresh-time: 2592000000 # 30์ผ
# access-time: 3600000 # 1์‹œ๊ฐ„
# prefix: Bearer
# header: Authorization
# secret-key: ${JWT_SECRET}
Copy link
Member

Choose a reason for hiding this comment

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

์žˆ๋Š” ๊ฑธ ์™œ ๋ฐ”๊พธ๋Š”์ง€?

Comment on lines +108 to +110
jpa:
hibernate:
ddl-auto: validate
Copy link
Member

Choose a reason for hiding this comment

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

validate๋Š” localํ™˜๊ฒฝ์—์„œ ์‚ฌ์šฉํ•˜์ง€ ์•Šใ„ด์Šต๋‹ˆ๋‹ค


@Override
protected void doFilterInternal(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
Copy link
Member

Choose a reason for hiding this comment

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

request์™€ response์— null์ด ๋“ค์–ด์˜ค๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‚˜์š”?

@chaewu chaewu closed this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
โœจ Feature ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants