mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: 实现鉴权操作
Signed-off-by: 白池 <whitechi73@outlook.com>
This commit is contained in:
parent
bbdfb7c04e
commit
a528030cbb
@ -7,6 +7,7 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.asExecutor
|
import kotlinx.coroutines.asExecutor
|
||||||
|
import kritor.auth.AuthInterceptor
|
||||||
import kritor.service.*
|
import kritor.service.*
|
||||||
import moe.fuqiuluo.shamrock.helper.LogCenter
|
import moe.fuqiuluo.shamrock.helper.LogCenter
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
@ -16,6 +17,7 @@ class KritorServer(
|
|||||||
): CoroutineScope {
|
): CoroutineScope {
|
||||||
private val server = Grpc.newServerBuilderForPort(port, InsecureServerCredentials.create())
|
private val server = Grpc.newServerBuilderForPort(port, InsecureServerCredentials.create())
|
||||||
.executor(Dispatchers.IO.asExecutor())
|
.executor(Dispatchers.IO.asExecutor())
|
||||||
|
.intercept(AuthInterceptor)
|
||||||
.addService(Authentication)
|
.addService(Authentication)
|
||||||
.addService(ContactService)
|
.addService(ContactService)
|
||||||
.build()!!
|
.build()!!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user