-
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.
Create auth argument resolver skeleton
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
raisedragon-api/src/main/kotlin/com/whatever/raisedragon/security/authentication/UserInfo.kt
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,17 @@ | ||
package com.whatever.raisedragon.security.authentication | ||
|
||
import com.whatever.raisedragon.domain.user.User | ||
|
||
data class UserInfo( | ||
val id: Long, | ||
val nickname: String, | ||
) { | ||
companion object { | ||
fun from(user: User): UserInfo { | ||
return UserInfo( | ||
user.id!!, | ||
user.nickname.value, | ||
) | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
raisedragon-api/src/main/kotlin/com/whatever/raisedragon/security/resolver/GetAuth.kt
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,8 @@ | ||
package com.whatever.raisedragon.security.resolver | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Retention(AnnotationRetention.RUNTIME) | ||
@Target(AnnotationTarget.VALUE_PARAMETER) | ||
@Schema(hidden = true) | ||
annotation class GetAuth |