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

๐Ÿš€ ์„ ํƒ - RoleHierarchy ๋ฆฌ๋ทฐ ์š”์ฒญ ๋“œ๋ฆฝ๋‹ˆ๋‹ค. #20

Merged
merged 12 commits into from
Feb 15, 2025

Conversation

parkjun5
Copy link

์•ˆ๋…•ํ•˜์„ธ์š”.
์„ ํƒ - RoleHierarchy ๋ฏธ์…˜ ๋ฆฌ๋ทฐ ์š”์ฒญํ•ฉ๋‹ˆ๋‹ค.

์ด๋ฒˆ ๋ฏธ์…˜์€ ์‹œํ๋ฆฌํ‹ฐ์—์„œ ๋ช…์‹œ์ ์œผ๋กœ ๊ฐœ๋ฐœ๋˜์–ด์žˆ๋˜ ๋ถ€๋ถ„์ด ๋งŽ์•„ ๋น ๋ฅด๊ฒŒ ๊ฐœ๋ฐœํ•˜์˜€์Šต๋‹ˆ๋‹ค!

๊ทธ๋Ÿฐ๋ฐ Spring Security ์ฝ”๋“œ ์ „๋ฐ˜์—์„œ๋Š” Authority๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š”๋ฐ,
RoleHierarchy์—์„œ ํŠน๋ณ„ํžˆ Role์ด๋ผ๋Š” ์šฉ์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•˜๋„ค์š”.

์˜ˆ๋ฅผ ๋“ค์–ด:

  • UserDetails.getAuthorities()

  • Authentication.getAuthorities()
    ์—์„œ๋Š” Authority๋ฅผ ์‚ฌ์šฉํ•˜์ง€๋งŒ

  • RoleHierarchy.getReachableRoles()
    ์—์„œ๋Š” Role์„ ์‚ฌ์šฉํ•˜๋„ค์š”.

์ด๋ ‡๊ฒŒ Role์ด๋ผ๋Š” ์šฉ์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ๋Š” ์—ญํ• ๋กœ ๋น„๊ตํ•œ๋‹ค๊ณ  ๋ช…์‹œ์ ์œผ๋กœ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•ด์„œ ์ผ๊นŒ์š”??

๋ฆฌ๋ทฐ ์ž˜ ๋ถ€ํƒ ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

MZC01-PARKJUN5 and others added 9 commits February 13, 2025 11:51
 - ์ž„์‹œ๋กœ RoleHierarchy ๊ตฌ์กฐ ์ปค๋ฐ‹
 - ์‚ฌ์šฉ์ž Role์˜ ์ด๋ฆ„์„ ์ €์žฅํ•˜๊ณ  ๋น„๊ตํ•  ์ˆ˜ ์žˆ๋Š” ์ธ๊ฐ€ ๊ฐ์ฒด ์ƒ์„ฑ
โ€ฆity>๋กœ ๋ณ€๊ฒฝ

- Authentication ๊ฐ์ฒด๊ฐ€ ๊ถŒํ•œ์„ String์ด ์•„๋‹Œ GrantedAuthority ๊ฐ์ฒด๋กœ ๊ด€๋ฆฌํ•˜๋„๋ก ๊ฐœ์„ 
 - MEMBER ๋กค์€ ๊ธฐ๋ณธ ๋กค์œผ๋กœ ADMIN ์„ ๊ฐ€์ง€๋ฉด MEMBER ๋กค๋„ ์ธ๊ฐ€ํ•œ๋‹ค.
- Update README with optional mission requirements
Copy link
Member

@jinyoungchoi95 jinyoungchoi95 left a comment

Choose a reason for hiding this comment

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

์•ˆ๋…•ํ•˜์„ธ์š” ์„ธ์ค€๋‹˜ ๐Ÿ˜„

์„ ํƒ๋ฏธ์…˜๋„ ์ž˜ ๊ตฌํ˜„ํ•ด์ฃผ์…จ๋„ค์š”. ๋ช‡๊ฐ€์ง€ ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒจ๋‘์—ˆ์œผ๋‹ˆ ํ™•์ธ๋ถ€ํƒ๋“œ๋ ค์š” :)

๊ถ๊ธˆํ•˜๊ฑฐ๋‚˜ ๊ณ ๋ฏผ์ด ๋˜๋Š” ๋ถ€๋ถ„์ด ์žˆ์œผ์‹œ๋‹ค๋ฉด ์–ธ์ œ๋“  pr ์ฝ”๋ฉ˜ํŠธ ๋˜๋Š” dm์œผ๋กœ ์š”์ฒญ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ๐Ÿ™‡โ€โ™‚๏ธ

import java.util.Collection;

public interface RoleHierarchy {
Collection<GrantedAuthority> getReachableRoles(Collection<GrantedAuthority> authorities);
Copy link
Member

Choose a reason for hiding this comment

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

๊ทธ๋Ÿฐ๋ฐ Spring Security ์ฝ”๋“œ ์ „๋ฐ˜์—์„œ๋Š” Authority๋ฅผ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š”๋ฐ,
RoleHierarchy์—์„œ ํŠน๋ณ„ํžˆ Role์ด๋ผ๋Š” ์šฉ์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•˜๋„ค์š”.
์ด๋ ‡๊ฒŒ Role์ด๋ผ๋Š” ์šฉ์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ๋Š” ์—ญํ• ๋กœ ๋น„๊ตํ•œ๋‹ค๊ณ  ๋ช…์‹œ์ ์œผ๋กœ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•ด์„œ ์ผ๊นŒ์š”??

ํ˜น์‹œ ์–ด๋”” ์ฝ”๋“œ์—์„œ RoleHierarchy.getReachableRoles๋กœ ๋˜์–ด์žˆ์„๊นŒ์š”? ์‹ค์ œ ์Šคํ”„๋ง ์‹œํ๋ฆฌํ‹ฐ ์ฝ”๋“œ์—์„œ๋„ ๋ง์”€ํ•ด์ฃผ์‹ ๋Œ€๋กœ authority๋ผ๋Š” ํ‘œํ˜„์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด์š”.

	Collection<? extends GrantedAuthority> getReachableGrantedAuthorities(
			Collection<? extends GrantedAuthority> authorities);

https://github.com/spring-projects/spring-security/blob/main/core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchy.java

Copy link
Author

@parkjun5 parkjun5 Feb 14, 2025

Choose a reason for hiding this comment

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

์ œ๊ฐ€ ์ž˜๋ชป ์งˆ๋ฌธ์„ ๋“œ๋ ธ๋„ค์š”. ์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค.
getReachableRoles๋Š” ๋ฏธ์…˜ ์ฝ”๋“œ์— ๋ถ€๋ถ„์ด์˜€๋„ค์š”. ๐Ÿ˜…

๊ทธ๋ž˜๋„ Role ์ด๋ฆ„์€ ์‹œํ๋ฆฌํ‹ฐ์˜ RoleHierarchy์˜ ๊ตฌํ˜„์ฒด ์ฝ”๋“œ์—๋„ ์ข…์ข… ์‚ฌ์šฉ๋˜๋Š” ๊ฒƒ ๊ฐ™์•„์š”
์˜ˆ๋ฅผ ๋“ค์–ด์„œ getReachableGrantedAuthorities ์˜ ๊ตฌํ˜„ ๋ฉ”์„œ๋“œ ์ค‘

			Set<GrantedAuthority> lowerRoles = this.rolesReachableInOneOrMoreStepsMap.get(authority.getAuthority());
			if (lowerRoles == null) {
				continue; // No hierarchy for the role
			}
			for (GrantedAuthority role : lowerRoles) {
				if (processedNames.add(role.getAuthority())) {
					reachableRoles.add(role);
				}
			}

์œ„ ๋ถ€๋ถ„๋“ค ๋ณด๋ฉด Authority ์™€ Role์„ ๊ฐ™์ด ์‚ฌ์šฉํ•˜๋Š” ๋“ฏํ•ด์„œ RolePrefix์™€ ๊ด€๋ จ์žˆ๋Š”๊ฑด๊ฐ€? ํ–ˆ์Šต๋‹ˆ๋‹ค ใ…Žใ…Ž

https://github.com/spring-projects/spring-security/blob/main/core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImpl.java

Copy link
Member

Choose a reason for hiding this comment

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

๋„ค spring security์—์„œ๋Š” ์ธ๊ฐ€์ฒ˜๋ฆฌ ๊ถŒํ•œ(Authority)๊ฐ€ ์žˆ์ง€๋งŒ, ๊ทธ ๊ถŒํ•œ์„ ์—ญํ• ๋ณ„๋กœ ๊ณ„์ธต์œผ๋กœ ๋ถ„๋ฆฌํ•˜๋ คํ–ˆ๊ณ  ๊ทธ๋ ‡๊ฒŒ ๋‚˜์˜จ ๊ฒƒ์ด RoleHierarchy๋ผ๊ณ  ๋ณด์‹œ๋ฉด ๋  ๊ฒƒ ๊ฐ™์•„์š”.

๋‘ ์ •๋ณด๊ฐ€ ๋™์ผํ•  ์ˆ˜๋Š” ์žˆ๋Š”๋ฐ ์“ฐ์ž„์ƒˆ ์ž์ฒด๊ฐ€ ๊ถŒํ•œ, ๊ถŒํ•œ๋ณ„ ์—ญํ• ๋กœ ํ•œ๋ฒˆ ๋” ์ชผ๊ฐœ์ง„๋‹ค๊ณ  ๋ณด์‹œ๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

https://docs.spring.io/spring-security/reference/servlet/authorization/architecture.html?utm_source=chatgpt.com#authz-hierarchical-roles

Comment on lines +111 to +114
public RoleHierarchy roleHierarchy() {
return RoleHierarchyImpl.builder()
.role("ADMIN").addImplies("MEMBER")
.build();
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 6 to 10
public class NullRoleHierarchy implements RoleHierarchy {
@Override
public Collection<GrantedAuthority> getReachableRoles(Collection<GrantedAuthority> authorities) {
return Collections.emptyList();
}
Copy link
Member

Choose a reason for hiding this comment

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

RoleHierarchy์˜ ์˜๋ฌธ๋ช… ๊ทธ๋Œ€๋กœ ์ด ์ธํ„ฐํŽ˜์ด์Šค์˜ ์—ญํ• ์€ "์—ญํ•  ๊ณ„์ธต"์„ ๋งŒ๋“ค์–ด์ฃผ๋Š” ๊ฒƒ์ด์—์š”. ๊ทธ๋ž˜์„œ ๊ตฌํ˜„์ฒด๋“ค๋„ ์—ญํ•  ๊ณ„์ธต์„ ๋งŒ๋“ค์–ด์ฃผ๋Š” ๊ฒƒ์œผ๋กœ ๊ตฌ์„ฑ์ด ๋˜์–ด์•ผํ•˜๋Š”๋ฐ์š”.

NullRoleHierarchy์ด๋ผ๋Š” ๊ฒƒ์€ null์ด๋ผ๋Š” ๋ง์ด ํ‘œํ˜„๋˜์–ด์žˆ๊ธฐ๋Š”ํ•˜์ง€๋งŒ ์ง์—ญํ•˜๋ฉด "์—ญํ•  ๊ณ„์ธต์ด ์—†๋‹ค"์ž…๋‹ˆ๋‹ค. ๊ณ„์ธต์ด ์—†๋‹ค๋Š” ๊ฒƒ์ด์ง€ authority๊ฐ€ ์—†๋‹ค๋Š” ๋œป์€ ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— empty๋ฅผ ๋ฐ˜ํ™˜ํ•˜๊ธฐ๋ณด๋‹ค๋Š” ์ธ์ž…๋œ ํŒŒ๋ผ๋ฉ”ํ„ฐ๋ฅผ ๊ทธ๋Œ€๋กœ ๋ฐ˜ํ™˜ํ•ด์ฃผ๋Š” ๊ฒƒ์ด ๊ทธ ๋ชฉ์ ์ด๋ผ๊ณ  ๋ณผ ์ˆ˜ ์žˆ์–ด์š”.

Copy link
Author

Choose a reason for hiding this comment

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

์•„ํ•˜ ์ €๋„ NULL์„ ์™œ ์“ฐ์ง€ ๋ผ๋Š” ์˜๋ฌธ์ด ์žˆ์—ˆ๋Š”๋ฐ , ๋นˆ ๊ถŒํ•œ์„ ์ฃผ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ๋ง ๊ทธ๋Œ€๋กœ RoleHierarchy ๊ฐ€ ์—†๋‹ค๋ผ๋Š” ์˜๋ฏธ๊ตฐ์š”!

Comment on lines 9 to 11
Map<String, Set<GrantedAuthority>> roleHierarchy;

private static final List<GrantedAuthority> EMPTY_AUTHORITIES = Collections.emptyList();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Map<String, Set<GrantedAuthority>> roleHierarchy;
private static final List<GrantedAuthority> EMPTY_AUTHORITIES = Collections.emptyList();
private static final List<GrantedAuthority> EMPTY_AUTHORITIES = Collections.emptyList();
private final Map<String, Set<GrantedAuthority>> roleHierarchy;

์ƒ์ˆ˜๋Š” ์ž๋ฐ” ์ปจ๋ฒค์…˜์ƒ ๊ฐ€์žฅ ์œ„์— ์žˆ์–ด์•ผํ•˜๊ณ , roleHierarchy๋Š” ์ ‘๊ทผ์ œ์–ด๊ฐ€ ํ•„์š”ํ•ด๋ณด์ด๋„ค์š” :)

Copy link
Author

Choose a reason for hiding this comment

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

์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!


import java.util.*;

public class RoleHierarchyImpl implements RoleHierarchy {
Copy link
Member

Choose a reason for hiding this comment

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

RoleHierarchyImpl์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ๋„ ์ถ”๊ฐ€ํ•ด๋ณด๋ฉด ์–ด๋–จ๊นŒ์š”? ๊ธฐ๋Šฅ์ด ๋ณต์žกํ•œ ๊ฐ์ฒด์ด๋‹ˆ ์ด๋ฅผ ๋ฌธ์„œํ™”ํ•œ๋‹ค๋Š” ๋Š๋‚Œ์œผ๋กœ ํ…Œ์ŠคํŠธ๋ฅผ ์งœ๋ณด์…”๋„ ์ข‹์€ ๊ฒฝํ—˜์ด ๋  ๊ฒƒ ๊ฐ™์•„์š” :)

 - ์—ญํ•  ๊ณ„์ธต์„ Authority ๋กœ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋‹ค
 - ์ƒˆ๋กœ์šด ์—ญํ•  ๊ณ„์ธต์„ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋‹ค.
 - ์—ญํ• ์˜ ์ด๋ฆ„์€ ๋น„์–ด์žˆ์„์ˆ˜ ์—†๋‹ค.
 - ํฌํ•จ๋œ ์—ญํ• ๋“ค๋„ ๋น„์–ด์žˆ์„ ์ˆ˜ ์—†๋‹ค.
Copy link
Member

@jinyoungchoi95 jinyoungchoi95 left a comment

Choose a reason for hiding this comment

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

์•ˆ๋…•ํ•˜์„ธ์š” ์„ธ์ค€๋‹˜ ๐Ÿ˜„

ํ”ผ๋“œ๋ฐฑ ์ž˜ ๋ฐ˜์˜ํ•ด์ฃผ์…จ๋„ค์š”. ๋ช‡๊ฐ€์ง€ ์•Œ๊ณ  ๋„˜์–ด๊ฐ€๋ฉด ์ข‹์€ ๋‚ด์šฉ ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒจ๋‘์—ˆ์Šต๋‹ˆ๋‹ค.
Authorization ๋ฏธ์…˜์— ํ•„์š”ํ•œ ํ•™์Šต์„ ๋ชจ๋‘ ์ž˜ ์ง„ํ–‰ํ•ด์ฃผ์‹  ๊ฒƒ ๊ฐ™์•„ ๋จธ์ง€ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ๐Ÿ™‡โ€โ™‚๏ธ

Comment on lines +20 to +21
@BeforeEach
void setUp() {
Copy link
Member

Choose a reason for hiding this comment

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

junit5์—์„œ๋Š” ์ดˆ๊ธฐํ™” ๋‹จ์œ„๊ฐ€ ๋ฉ”์†Œ๋“œ ๋‹จ์œ„์ด๊ธฐ ๋•Œ๋ฌธ์— ๋”ฐ๋กœ setup์œผ๋กœ ์ดˆ๊ธฐํ™”ํ•ด์ฃผ์‹œ ์•Š์œผ์…”๋„ ๋ฉ๋‹ˆ๋‹ค.

https://junit.org/junit5/docs/current/user-guide/#writing-tests-test-instance-lifecycle

Comment on lines +54 to +72
@DisplayName("์ƒˆ๋กœ์šด ์—ญํ•  ๊ณ„์ธต์„ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋‹ค.")
void addRoleHierarchyTest() {
// given
String target = "ISRAEL";
String nothing = "NOTHING";
String everything = "EVERYTHING";
RoleHierarchyImpl roleHierarchy = builder.role(target).addImplies(nothing, everything)
.build();

// when
SimpleGrantedAuthority authority = new SimpleGrantedAuthority(target);
Collection<GrantedAuthority> reachableRoles = roleHierarchy.getReachableRoles(List.of(authority));

// then
var expect = List.of(
authority,
new SimpleGrantedAuthority(nothing),
new SimpleGrantedAuthority(everything)
);
Copy link
Member

Choose a reason for hiding this comment

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

  1. ์ถ”๊ฐ€ํ•œ๋‹ค๊ธฐ๋ณด๋‹ค๋Š” ๊ณ„์ธต์„ ๊ฐ€์ ธ์˜จ๋‹ค์— ๋” ๊ฐ€๊นŒ์šด ํ…Œ์ŠคํŠธ๋กœ ๋ณด์ด๋„ค์š”.
  2. SimpleGrantedAuthority authority = new SimpleGrantedAuthority(target);๋Š” ๊ทธ๋ž˜์„œ ๋”ฐ์ง€๊ณ ๋ณด๋ฉด ์ฃผ์–ด์ง„ ๋ฐ์ดํ„ฐ์ธ given์— ๋” ๊ฐ€๊น์Šต๋‹ˆ๋‹ค. when์—๋Š” ํ…Œ์ŠคํŠธ๋ฅผ ์ฆ๋ช…ํ•˜๊ณ ์žํ•˜๋Š” ๋Œ€์ƒ์˜ ์‹คํ–‰ ๊ทธ์ž์ฒด๋งŒ์„ ๋„ฃ์–ด์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”.
  3. expected ๋˜ํ•œ given์— ๋“ค์–ด๊ฐ€๋Š” ๊ฒƒ์ด ๋งž๊ฒ ์ฃ . 74๋ฒˆ๋ผ์ธ์— ๊ฐ’์„ ๊ทธ๋Œ€๋กœ ๋„ฃ๋Š” ๊ฒฝ์šฐ๋Š” ์ƒ๊ด€์ด ์—†์ง€๋งŒ ๊ธฐ๋Œ“๊ฐ’ ๋˜ํ•œ ์ฃผ์–ด์ง„ ๋ฐ์ดํ„ฐ๋ผ๊ณ  ๋ณด๋Š” ํŽธ์ž…๋‹ˆ๋‹ค.

String target = "ISRAEL";
String nothing = "NOTHING";
String everything = "EVERYTHING";
RoleHierarchyImpl roleHierarchy = builder.role(target).addImplies(nothing, everything)
Copy link
Member

Choose a reason for hiding this comment

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

๊ทธ๋ž˜์„œ ์ถ”๊ฐ€ํ•จ(addImplies)๋ฅผ ํ…Œ์ŠคํŠธํ•˜๊ณ ์‹ถ๋‹ค๋ฉด ์ •๋ง ๊ฐ’์ด ์ถ”๊ฐ€๋˜์—ˆ๋Š”์ง€ ๊ทธ ์ž์ฒด๋งŒ์„ ํ…Œ์ŠคํŠธํ•˜๋Š” ๊ฒƒ์ด ๋‚˜์„ ์ˆ˜๋„ ์žˆ์–ด์š”. private final Map<String, Set<GrantedAuthority>> rolesReachableInOneOrMoreStepsMap;์— ์›ํ•˜๋Š” ๊ฐ’์ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๊ฒƒ์œผ๋กœ์š”.

Copy link
Author

Choose a reason for hiding this comment

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

์ „์ฒด ๋™์ž‘์ด ์•„๋‹Œ rolesReachableInOneOrMoreStepsMap ์ž์ฒด์— ๊ฐ’์ด ์ €์žฅ๋˜์–ด์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š”๊ฒŒ ์ถ”๊ฐ€๋˜์—ˆ๋Š”๊ฐ€ ์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ๋กœ ๋” ์ขํ˜€์ง€๊ฒ ๋„ค์š”!

Comment on lines +38 to +47
List<GrantedAuthority> expect = switch (roleName) {
case "ADMIN" -> List.of(
new SimpleGrantedAuthority("ADMIN"),
new SimpleGrantedAuthority("MEMBER")
);
case "MEMBER", "UNKNOWN" -> List.of(
new SimpleGrantedAuthority(roleName)
);
default -> throw new IllegalStateException("Unexpected roleName: " + roleName);
};
Copy link
Member

Choose a reason for hiding this comment

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

@CsvSource๋ฅผ ํ™œ์šฉํ•˜๋ฉด ๊ธฐ๋Œ“๊ฐ’์— ๋Œ€ํ•œ ๋ถ„๊ธฐ์ฒ˜๋ฆฌ๋ฅผ ํ…Œ์ŠคํŠธ์—์„œ ํ•˜์ง€ ์•Š์•„๋„ ๋  ๊ฒƒ ๊ฐ™์•„์š”.

Copy link
Member

Choose a reason for hiding this comment

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

ํ…Œ์ŠคํŠธ๋กœ ์–ด๋–ค ๊ธฐ๋Šฅ์ด ์žˆ๋Š”์ง€ ์ž˜ ๋ณด์ด๋„ค์š” ๐Ÿ‘

@jinyoungchoi95 jinyoungchoi95 merged commit dc271c7 into next-step:parkjun5 Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants