@@ -4,6 +4,8 @@ import jakarta.servlet.http.HttpServletResponse
44import org.gitanimals.core.AuthorizationException
55import org.gitanimals.core.ErrorResponse
66import org.gitanimals.core.FieldType
7+ import org.gitanimals.core.auth.RequiredUserEntryPoints
8+ import org.gitanimals.core.auth.UserEntryPoint
79import org.gitanimals.guild.app.*
810import org.gitanimals.guild.app.request.CreateGuildRequest
911import org.gitanimals.guild.app.response.*
@@ -35,13 +37,15 @@ class GuildController(
3537
3638 @ResponseStatus(HttpStatus .OK )
3739 @PostMapping(" /guilds" )
40+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
3841 fun createGuild (
3942 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
4043 @RequestBody createGuildRequest : CreateGuildRequest ,
4144 ) = createGuildFacade.createGuild(token, createGuildRequest)
4245
4346 @ResponseStatus(HttpStatus .OK )
4447 @PostMapping(" /guilds/{guildId}" )
48+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
4549 fun joinGuild (
4650 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
4751 @PathVariable(" guildId" ) guildId : Long ,
@@ -51,6 +55,7 @@ class GuildController(
5155
5256 @ResponseStatus(HttpStatus .OK )
5357 @PostMapping(" /guilds/{guildId}/accepts" )
58+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
5459 fun acceptJoinGuild (
5560 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
5661 @PathVariable(" guildId" ) guildId : Long ,
@@ -60,6 +65,7 @@ class GuildController(
6065
6166 @ResponseStatus(HttpStatus .OK )
6267 @DeleteMapping(" /guilds/{guildId}" )
68+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
6369 fun kickFromGuild (
6470 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
6571 @PathVariable(" guildId" ) guildId : Long ,
@@ -69,6 +75,7 @@ class GuildController(
6975
7076 @ResponseStatus(HttpStatus .OK )
7177 @PatchMapping(" /guilds/{guildId}" )
78+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
7279 fun changeGuild (
7380 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
7481 @PathVariable(" guildId" ) guildId : Long ,
@@ -89,6 +96,7 @@ class GuildController(
8996
9097 @ResponseStatus(HttpStatus .OK )
9198 @GetMapping(" /guilds" )
99+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
92100 fun getAllJoinedGuild (
93101 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
94102 ): GuildsResponse {
@@ -130,6 +138,7 @@ class GuildController(
130138 }
131139
132140 @PostMapping(" /guilds/{guildId}/personas" )
141+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
133142 fun changeMainPersona (
134143 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
135144 @PathVariable(" guildId" ) guildId : Long ,
@@ -141,12 +150,14 @@ class GuildController(
141150 )
142151
143152 @DeleteMapping(" /guilds/{guildId}/leave" )
153+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
144154 fun leaveGuild (
145155 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
146156 @PathVariable(" guildId" ) guildId : Long ,
147157 ) = leaveGuildFacade.leave(guildId)
148158
149159 @PostMapping(" guilds/{guildId}/deny" )
160+ @RequiredUserEntryPoints([UserEntryPoint .GITHUB ])
150161 fun deny (
151162 @RequestHeader(HttpHeaders .AUTHORIZATION ) token : String ,
152163 @PathVariable(" guildId" ) guildId : Long ,
0 commit comments