复制项目
This commit is contained in:
15
pkg/common/startrpc/mw.go
Normal file
15
pkg/common/startrpc/mw.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package startrpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.imall.cloud/openim/open-im-server-deploy/pkg/authverify"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
func grpcServerIMAdminUserID(imAdminUserID []string) grpc.ServerOption {
|
||||
return grpc.ChainUnaryInterceptor(func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error) {
|
||||
ctx = authverify.WithIMAdminUserIDs(ctx, imAdminUserID)
|
||||
return handler(ctx, req)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user