|
@@ -1,7 +1,7 @@
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
// versions:
|
|
// versions:
|
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
|
-// - protoc v6.33.4
|
|
|
|
|
|
|
+// - protoc v7.34.1
|
|
|
// source: pb/perm.proto
|
|
// source: pb/perm.proto
|
|
|
|
|
|
|
|
package pb
|
|
package pb
|
|
@@ -24,17 +24,27 @@ const (
|
|
|
PermService_RefreshToken_FullMethodName = "/pb.PermService/RefreshToken"
|
|
PermService_RefreshToken_FullMethodName = "/pb.PermService/RefreshToken"
|
|
|
PermService_VerifyToken_FullMethodName = "/pb.PermService/VerifyToken"
|
|
PermService_VerifyToken_FullMethodName = "/pb.PermService/VerifyToken"
|
|
|
PermService_GetUserPerms_FullMethodName = "/pb.PermService/GetUserPerms"
|
|
PermService_GetUserPerms_FullMethodName = "/pb.PermService/GetUserPerms"
|
|
|
|
|
+ PermService_Logout_FullMethodName = "/pb.PermService/Logout"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// PermServiceClient is the client API for PermService service.
|
|
// PermServiceClient is the client API for PermService service.
|
|
|
//
|
|
//
|
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
|
|
|
+//
|
|
|
|
|
+// PermService 权限管理系统 gRPC 服务,供接入产品的服务端调用。
|
|
|
type PermServiceClient interface {
|
|
type PermServiceClient interface {
|
|
|
|
|
+ // SyncPermissions 同步权限声明。产品服务端通过 appKey/appSecret 认证后批量同步权限定义(新增/更新/禁用不在列表中的权限)。
|
|
|
SyncPermissions(ctx context.Context, in *SyncPermissionsReq, opts ...grpc.CallOption) (*SyncPermissionsResp, error)
|
|
SyncPermissions(ctx context.Context, in *SyncPermissionsReq, opts ...grpc.CallOption) (*SyncPermissionsResp, error)
|
|
|
|
|
+ // Login 产品端登录。产品成员通过用户名密码 + productCode 登录,返回 JWT 令牌对及用户权限信息。
|
|
|
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error)
|
|
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error)
|
|
|
|
|
+ // RefreshToken 刷新令牌。使用有效的 refreshToken 换取新的令牌对,旧令牌即时失效(单会话轮转)。
|
|
|
RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*RefreshTokenResp, error)
|
|
RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*RefreshTokenResp, error)
|
|
|
|
|
+ // VerifyToken 验证令牌。校验 accessToken 的有效性(签名、过期、用户状态、产品状态、成员资格、tokenVersion),返回用户权限信息。
|
|
|
VerifyToken(ctx context.Context, in *VerifyTokenReq, opts ...grpc.CallOption) (*VerifyTokenResp, error)
|
|
VerifyToken(ctx context.Context, in *VerifyTokenReq, opts ...grpc.CallOption) (*VerifyTokenResp, error)
|
|
|
|
|
+ // GetUserPerms 查询用户权限。产品服务端通过 appKey/appSecret 认证后查询指定用户在该产品下的成员类型和权限列表。
|
|
|
GetUserPerms(ctx context.Context, in *GetUserPermsReq, opts ...grpc.CallOption) (*GetUserPermsResp, error)
|
|
GetUserPerms(ctx context.Context, in *GetUserPermsReq, opts ...grpc.CallOption) (*GetUserPermsResp, error)
|
|
|
|
|
+ // Logout 用户登出。使当前 accessToken 对应用户的所有令牌立即失效(递增 tokenVersion)。
|
|
|
|
|
+ Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*LogoutResp, error)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type permServiceClient struct {
|
|
type permServiceClient struct {
|
|
@@ -95,15 +105,34 @@ func (c *permServiceClient) GetUserPerms(ctx context.Context, in *GetUserPermsRe
|
|
|
return out, nil
|
|
return out, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func (c *permServiceClient) Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*LogoutResp, error) {
|
|
|
|
|
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
|
|
|
+ out := new(LogoutResp)
|
|
|
|
|
+ err := c.cc.Invoke(ctx, PermService_Logout_FullMethodName, in, out, cOpts...)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ return nil, err
|
|
|
|
|
+ }
|
|
|
|
|
+ return out, nil
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// PermServiceServer is the server API for PermService service.
|
|
// PermServiceServer is the server API for PermService service.
|
|
|
// All implementations must embed UnimplementedPermServiceServer
|
|
// All implementations must embed UnimplementedPermServiceServer
|
|
|
// for forward compatibility.
|
|
// for forward compatibility.
|
|
|
|
|
+//
|
|
|
|
|
+// PermService 权限管理系统 gRPC 服务,供接入产品的服务端调用。
|
|
|
type PermServiceServer interface {
|
|
type PermServiceServer interface {
|
|
|
|
|
+ // SyncPermissions 同步权限声明。产品服务端通过 appKey/appSecret 认证后批量同步权限定义(新增/更新/禁用不在列表中的权限)。
|
|
|
SyncPermissions(context.Context, *SyncPermissionsReq) (*SyncPermissionsResp, error)
|
|
SyncPermissions(context.Context, *SyncPermissionsReq) (*SyncPermissionsResp, error)
|
|
|
|
|
+ // Login 产品端登录。产品成员通过用户名密码 + productCode 登录,返回 JWT 令牌对及用户权限信息。
|
|
|
Login(context.Context, *LoginReq) (*LoginResp, error)
|
|
Login(context.Context, *LoginReq) (*LoginResp, error)
|
|
|
|
|
+ // RefreshToken 刷新令牌。使用有效的 refreshToken 换取新的令牌对,旧令牌即时失效(单会话轮转)。
|
|
|
RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error)
|
|
RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error)
|
|
|
|
|
+ // VerifyToken 验证令牌。校验 accessToken 的有效性(签名、过期、用户状态、产品状态、成员资格、tokenVersion),返回用户权限信息。
|
|
|
VerifyToken(context.Context, *VerifyTokenReq) (*VerifyTokenResp, error)
|
|
VerifyToken(context.Context, *VerifyTokenReq) (*VerifyTokenResp, error)
|
|
|
|
|
+ // GetUserPerms 查询用户权限。产品服务端通过 appKey/appSecret 认证后查询指定用户在该产品下的成员类型和权限列表。
|
|
|
GetUserPerms(context.Context, *GetUserPermsReq) (*GetUserPermsResp, error)
|
|
GetUserPerms(context.Context, *GetUserPermsReq) (*GetUserPermsResp, error)
|
|
|
|
|
+ // Logout 用户登出。使当前 accessToken 对应用户的所有令牌立即失效(递增 tokenVersion)。
|
|
|
|
|
+ Logout(context.Context, *LogoutReq) (*LogoutResp, error)
|
|
|
mustEmbedUnimplementedPermServiceServer()
|
|
mustEmbedUnimplementedPermServiceServer()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -129,6 +158,9 @@ func (UnimplementedPermServiceServer) VerifyToken(context.Context, *VerifyTokenR
|
|
|
func (UnimplementedPermServiceServer) GetUserPerms(context.Context, *GetUserPermsReq) (*GetUserPermsResp, error) {
|
|
func (UnimplementedPermServiceServer) GetUserPerms(context.Context, *GetUserPermsReq) (*GetUserPermsResp, error) {
|
|
|
return nil, status.Error(codes.Unimplemented, "method GetUserPerms not implemented")
|
|
return nil, status.Error(codes.Unimplemented, "method GetUserPerms not implemented")
|
|
|
}
|
|
}
|
|
|
|
|
+func (UnimplementedPermServiceServer) Logout(context.Context, *LogoutReq) (*LogoutResp, error) {
|
|
|
|
|
+ return nil, status.Error(codes.Unimplemented, "method Logout not implemented")
|
|
|
|
|
+}
|
|
|
func (UnimplementedPermServiceServer) mustEmbedUnimplementedPermServiceServer() {}
|
|
func (UnimplementedPermServiceServer) mustEmbedUnimplementedPermServiceServer() {}
|
|
|
func (UnimplementedPermServiceServer) testEmbeddedByValue() {}
|
|
func (UnimplementedPermServiceServer) testEmbeddedByValue() {}
|
|
|
|
|
|
|
@@ -240,6 +272,24 @@ func _PermService_GetUserPerms_Handler(srv interface{}, ctx context.Context, dec
|
|
|
return interceptor(ctx, in, info, handler)
|
|
return interceptor(ctx, in, info, handler)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func _PermService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
|
+ in := new(LogoutReq)
|
|
|
|
|
+ if err := dec(in); err != nil {
|
|
|
|
|
+ return nil, err
|
|
|
|
|
+ }
|
|
|
|
|
+ if interceptor == nil {
|
|
|
|
|
+ return srv.(PermServiceServer).Logout(ctx, in)
|
|
|
|
|
+ }
|
|
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
|
|
+ Server: srv,
|
|
|
|
|
+ FullMethod: PermService_Logout_FullMethodName,
|
|
|
|
|
+ }
|
|
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
|
|
+ return srv.(PermServiceServer).Logout(ctx, req.(*LogoutReq))
|
|
|
|
|
+ }
|
|
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// PermService_ServiceDesc is the grpc.ServiceDesc for PermService service.
|
|
// PermService_ServiceDesc is the grpc.ServiceDesc for PermService service.
|
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
|
// and not to be introspected or modified (even as a copy)
|
|
// and not to be introspected or modified (even as a copy)
|
|
@@ -267,6 +317,10 @@ var PermService_ServiceDesc = grpc.ServiceDesc{
|
|
|
MethodName: "GetUserPerms",
|
|
MethodName: "GetUserPerms",
|
|
|
Handler: _PermService_GetUserPerms_Handler,
|
|
Handler: _PermService_GetUserPerms_Handler,
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ MethodName: "Logout",
|
|
|
|
|
+ Handler: _PermService_Logout_Handler,
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
Streams: []grpc.StreamDesc{},
|
|
Streams: []grpc.StreamDesc{},
|
|
|
Metadata: "pb/perm.proto",
|
|
Metadata: "pb/perm.proto",
|