chore: auto-generate protobuf files [skip ci]
This commit is contained in:
56
gen/auth.ts
56
gen/auth.ts
@@ -69,6 +69,37 @@ export interface GetAccountRoleLevelResponse {
|
|||||||
roleLevel: number;
|
roleLevel: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GetSessionRequest {
|
||||||
|
userId: string;
|
||||||
|
sessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SessionItem {
|
||||||
|
/** Здесь будет лежать захэшированный ID */
|
||||||
|
id: string;
|
||||||
|
ipAddress: string;
|
||||||
|
userAgent: string;
|
||||||
|
/** Unix timestamp в миллисекундах */
|
||||||
|
lastActivity: number;
|
||||||
|
/** Флаг текущей сессии */
|
||||||
|
isCurrent: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetSessionsResponse {
|
||||||
|
sessions: SessionItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TerminateSessionRequest {
|
||||||
|
userId: string;
|
||||||
|
/** Хэш сессии, которую нужно убить */
|
||||||
|
targetHash: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TerminateSessionResponse {
|
||||||
|
success: boolean;
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
||||||
|
|
||||||
export interface AuthServiceClient {
|
export interface AuthServiceClient {
|
||||||
@@ -86,6 +117,10 @@ export interface AuthServiceClient {
|
|||||||
logout(request: LogoutRequest, metadata?: Metadata): Observable<LogoutResponse>;
|
logout(request: LogoutRequest, metadata?: Metadata): Observable<LogoutResponse>;
|
||||||
|
|
||||||
logoutOther(request: LogoutRequest, metadata?: Metadata): Observable<LogoutResponse>;
|
logoutOther(request: LogoutRequest, metadata?: Metadata): Observable<LogoutResponse>;
|
||||||
|
|
||||||
|
getSessions(request: GetSessionRequest, metadata?: Metadata): Observable<GetSessionsResponse>;
|
||||||
|
|
||||||
|
terminateSession(request: TerminateSessionRequest, metadata?: Metadata): Observable<TerminateSessionResponse>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AuthServiceController {
|
export interface AuthServiceController {
|
||||||
@@ -115,11 +150,30 @@ export interface AuthServiceController {
|
|||||||
request: LogoutRequest,
|
request: LogoutRequest,
|
||||||
metadata?: Metadata,
|
metadata?: Metadata,
|
||||||
): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
|
): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
|
||||||
|
|
||||||
|
getSessions(
|
||||||
|
request: GetSessionRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<GetSessionsResponse> | Observable<GetSessionsResponse> | GetSessionsResponse;
|
||||||
|
|
||||||
|
terminateSession(
|
||||||
|
request: TerminateSessionRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<TerminateSessionResponse> | Observable<TerminateSessionResponse> | TerminateSessionResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AuthServiceControllerMethods() {
|
export function AuthServiceControllerMethods() {
|
||||||
return function (constructor: Function) {
|
return function (constructor: Function) {
|
||||||
const grpcMethods: string[] = ["login", "refresh", "verifyToken", "getAccountRoleLevel", "logout", "logoutOther"];
|
const grpcMethods: string[] = [
|
||||||
|
"login",
|
||||||
|
"refresh",
|
||||||
|
"verifyToken",
|
||||||
|
"getAccountRoleLevel",
|
||||||
|
"logout",
|
||||||
|
"logoutOther",
|
||||||
|
"getSessions",
|
||||||
|
"terminateSession",
|
||||||
|
];
|
||||||
for (const method of grpcMethods) {
|
for (const method of grpcMethods) {
|
||||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||||
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
||||||
|
|||||||
@@ -605,6 +605,282 @@ func (x *GetAccountRoleLevelResponse) GetRoleLevel() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetSessionRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||||
|
SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetSessionRequest) Reset() {
|
||||||
|
*x = GetSessionRequest{}
|
||||||
|
mi := &file_auth_proto_msgTypes[10]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetSessionRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetSessionRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetSessionRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_auth_proto_msgTypes[10]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetSessionRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetSessionRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_auth_proto_rawDescGZIP(), []int{10}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetSessionRequest) GetUserId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UserId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetSessionRequest) GetSessionId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.SessionId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type SessionItem struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Здесь будет лежать захэшированный ID
|
||||||
|
IpAddress string `protobuf:"bytes,2,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
|
||||||
|
UserAgent string `protobuf:"bytes,3,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"`
|
||||||
|
LastActivity int64 `protobuf:"varint,4,opt,name=last_activity,json=lastActivity,proto3" json:"last_activity,omitempty"` // Unix timestamp в миллисекундах
|
||||||
|
IsCurrent bool `protobuf:"varint,5,opt,name=is_current,json=isCurrent,proto3" json:"is_current,omitempty"` // Флаг текущей сессии
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SessionItem) Reset() {
|
||||||
|
*x = SessionItem{}
|
||||||
|
mi := &file_auth_proto_msgTypes[11]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SessionItem) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SessionItem) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SessionItem) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_auth_proto_msgTypes[11]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use SessionItem.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SessionItem) Descriptor() ([]byte, []int) {
|
||||||
|
return file_auth_proto_rawDescGZIP(), []int{11}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SessionItem) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SessionItem) GetIpAddress() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.IpAddress
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SessionItem) GetUserAgent() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UserAgent
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SessionItem) GetLastActivity() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.LastActivity
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SessionItem) GetIsCurrent() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.IsCurrent
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetSessionsResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Sessions []*SessionItem `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetSessionsResponse) Reset() {
|
||||||
|
*x = GetSessionsResponse{}
|
||||||
|
mi := &file_auth_proto_msgTypes[12]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetSessionsResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetSessionsResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetSessionsResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_auth_proto_msgTypes[12]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetSessionsResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetSessionsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_auth_proto_rawDescGZIP(), []int{12}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetSessionsResponse) GetSessions() []*SessionItem {
|
||||||
|
if x != nil {
|
||||||
|
return x.Sessions
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type TerminateSessionRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||||
|
TargetHash string `protobuf:"bytes,2,opt,name=target_hash,json=targetHash,proto3" json:"target_hash,omitempty"` // Хэш сессии, которую нужно убить
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionRequest) Reset() {
|
||||||
|
*x = TerminateSessionRequest{}
|
||||||
|
mi := &file_auth_proto_msgTypes[13]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*TerminateSessionRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *TerminateSessionRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_auth_proto_msgTypes[13]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use TerminateSessionRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*TerminateSessionRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_auth_proto_rawDescGZIP(), []int{13}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionRequest) GetUserId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UserId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionRequest) GetTargetHash() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.TargetHash
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type TerminateSessionResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||||
|
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionResponse) Reset() {
|
||||||
|
*x = TerminateSessionResponse{}
|
||||||
|
mi := &file_auth_proto_msgTypes[14]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*TerminateSessionResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *TerminateSessionResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_auth_proto_msgTypes[14]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use TerminateSessionResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*TerminateSessionResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_auth_proto_rawDescGZIP(), []int{14}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionResponse) GetSuccess() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Success
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *TerminateSessionResponse) GetMessage() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Message
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_auth_proto protoreflect.FileDescriptor
|
var File_auth_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
const file_auth_proto_rawDesc = "" +
|
const file_auth_proto_rawDesc = "" +
|
||||||
@@ -665,14 +941,38 @@ const file_auth_proto_rawDesc = "" +
|
|||||||
"\x1bGetAccountRoleLevelResponse\x12\x14\n" +
|
"\x1bGetAccountRoleLevelResponse\x12\x14\n" +
|
||||||
"\x05found\x18\x01 \x01(\bR\x05found\x12\x1d\n" +
|
"\x05found\x18\x01 \x01(\bR\x05found\x12\x1d\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"role_level\x18\x02 \x01(\x05R\troleLevel2\xaa\x03\n" +
|
"role_level\x18\x02 \x01(\x05R\troleLevel\"K\n" +
|
||||||
|
"\x11GetSessionRequest\x12\x17\n" +
|
||||||
|
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"session_id\x18\x02 \x01(\tR\tsessionId\"\x9f\x01\n" +
|
||||||
|
"\vSessionItem\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"ip_address\x18\x02 \x01(\tR\tipAddress\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"user_agent\x18\x03 \x01(\tR\tuserAgent\x12#\n" +
|
||||||
|
"\rlast_activity\x18\x04 \x01(\x03R\flastActivity\x12\x1d\n" +
|
||||||
|
"\n" +
|
||||||
|
"is_current\x18\x05 \x01(\bR\tisCurrent\"G\n" +
|
||||||
|
"\x13GetSessionsResponse\x120\n" +
|
||||||
|
"\bsessions\x18\x01 \x03(\v2\x14.auth.v1.SessionItemR\bsessions\"S\n" +
|
||||||
|
"\x17TerminateSessionRequest\x12\x17\n" +
|
||||||
|
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1f\n" +
|
||||||
|
"\vtarget_hash\x18\x02 \x01(\tR\n" +
|
||||||
|
"targetHash\"N\n" +
|
||||||
|
"\x18TerminateSessionResponse\x12\x18\n" +
|
||||||
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||||
|
"\amessage\x18\x02 \x01(\tR\amessage2\xcc\x04\n" +
|
||||||
"\vAuthService\x126\n" +
|
"\vAuthService\x126\n" +
|
||||||
"\x05Login\x12\x15.auth.v1.LoginRequest\x1a\x16.auth.v1.LoginResponse\x12<\n" +
|
"\x05Login\x12\x15.auth.v1.LoginRequest\x1a\x16.auth.v1.LoginResponse\x12<\n" +
|
||||||
"\aRefresh\x12\x17.auth.v1.RefreshRequest\x1a\x18.auth.v1.RefreshResponse\x12H\n" +
|
"\aRefresh\x12\x17.auth.v1.RefreshRequest\x1a\x18.auth.v1.RefreshResponse\x12H\n" +
|
||||||
"\vVerifyToken\x12\x1b.auth.v1.VerifyTokenRequest\x1a\x1c.auth.v1.VerifyTokenResponse\x12`\n" +
|
"\vVerifyToken\x12\x1b.auth.v1.VerifyTokenRequest\x1a\x1c.auth.v1.VerifyTokenResponse\x12`\n" +
|
||||||
"\x13GetAccountRoleLevel\x12#.auth.v1.GetAccountRoleLevelRequest\x1a$.auth.v1.GetAccountRoleLevelResponse\x129\n" +
|
"\x13GetAccountRoleLevel\x12#.auth.v1.GetAccountRoleLevelRequest\x1a$.auth.v1.GetAccountRoleLevelResponse\x129\n" +
|
||||||
"\x06Logout\x12\x16.auth.v1.LogoutRequest\x1a\x17.auth.v1.LogoutResponse\x12>\n" +
|
"\x06Logout\x12\x16.auth.v1.LogoutRequest\x1a\x17.auth.v1.LogoutResponse\x12>\n" +
|
||||||
"\vLogoutOther\x12\x16.auth.v1.LogoutRequest\x1a\x17.auth.v1.LogoutResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
|
"\vLogoutOther\x12\x16.auth.v1.LogoutRequest\x1a\x17.auth.v1.LogoutResponse\x12G\n" +
|
||||||
|
"\vGetSessions\x12\x1a.auth.v1.GetSessionRequest\x1a\x1c.auth.v1.GetSessionsResponse\x12W\n" +
|
||||||
|
"\x10TerminateSession\x12 .auth.v1.TerminateSessionRequest\x1a!.auth.v1.TerminateSessionResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
file_auth_proto_rawDescOnce sync.Once
|
file_auth_proto_rawDescOnce sync.Once
|
||||||
@@ -686,7 +986,7 @@ func file_auth_proto_rawDescGZIP() []byte {
|
|||||||
return file_auth_proto_rawDescData
|
return file_auth_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
|
||||||
var file_auth_proto_goTypes = []any{
|
var file_auth_proto_goTypes = []any{
|
||||||
(*LoginRequest)(nil), // 0: auth.v1.LoginRequest
|
(*LoginRequest)(nil), // 0: auth.v1.LoginRequest
|
||||||
(*LoginResponse)(nil), // 1: auth.v1.LoginResponse
|
(*LoginResponse)(nil), // 1: auth.v1.LoginResponse
|
||||||
@@ -698,25 +998,35 @@ var file_auth_proto_goTypes = []any{
|
|||||||
(*VerifyTokenResponse)(nil), // 7: auth.v1.VerifyTokenResponse
|
(*VerifyTokenResponse)(nil), // 7: auth.v1.VerifyTokenResponse
|
||||||
(*GetAccountRoleLevelRequest)(nil), // 8: auth.v1.GetAccountRoleLevelRequest
|
(*GetAccountRoleLevelRequest)(nil), // 8: auth.v1.GetAccountRoleLevelRequest
|
||||||
(*GetAccountRoleLevelResponse)(nil), // 9: auth.v1.GetAccountRoleLevelResponse
|
(*GetAccountRoleLevelResponse)(nil), // 9: auth.v1.GetAccountRoleLevelResponse
|
||||||
|
(*GetSessionRequest)(nil), // 10: auth.v1.GetSessionRequest
|
||||||
|
(*SessionItem)(nil), // 11: auth.v1.SessionItem
|
||||||
|
(*GetSessionsResponse)(nil), // 12: auth.v1.GetSessionsResponse
|
||||||
|
(*TerminateSessionRequest)(nil), // 13: auth.v1.TerminateSessionRequest
|
||||||
|
(*TerminateSessionResponse)(nil), // 14: auth.v1.TerminateSessionResponse
|
||||||
}
|
}
|
||||||
var file_auth_proto_depIdxs = []int32{
|
var file_auth_proto_depIdxs = []int32{
|
||||||
0, // 0: auth.v1.AuthService.Login:input_type -> auth.v1.LoginRequest
|
11, // 0: auth.v1.GetSessionsResponse.sessions:type_name -> auth.v1.SessionItem
|
||||||
2, // 1: auth.v1.AuthService.Refresh:input_type -> auth.v1.RefreshRequest
|
0, // 1: auth.v1.AuthService.Login:input_type -> auth.v1.LoginRequest
|
||||||
6, // 2: auth.v1.AuthService.VerifyToken:input_type -> auth.v1.VerifyTokenRequest
|
2, // 2: auth.v1.AuthService.Refresh:input_type -> auth.v1.RefreshRequest
|
||||||
8, // 3: auth.v1.AuthService.GetAccountRoleLevel:input_type -> auth.v1.GetAccountRoleLevelRequest
|
6, // 3: auth.v1.AuthService.VerifyToken:input_type -> auth.v1.VerifyTokenRequest
|
||||||
4, // 4: auth.v1.AuthService.Logout:input_type -> auth.v1.LogoutRequest
|
8, // 4: auth.v1.AuthService.GetAccountRoleLevel:input_type -> auth.v1.GetAccountRoleLevelRequest
|
||||||
4, // 5: auth.v1.AuthService.LogoutOther:input_type -> auth.v1.LogoutRequest
|
4, // 5: auth.v1.AuthService.Logout:input_type -> auth.v1.LogoutRequest
|
||||||
1, // 6: auth.v1.AuthService.Login:output_type -> auth.v1.LoginResponse
|
4, // 6: auth.v1.AuthService.LogoutOther:input_type -> auth.v1.LogoutRequest
|
||||||
3, // 7: auth.v1.AuthService.Refresh:output_type -> auth.v1.RefreshResponse
|
10, // 7: auth.v1.AuthService.GetSessions:input_type -> auth.v1.GetSessionRequest
|
||||||
7, // 8: auth.v1.AuthService.VerifyToken:output_type -> auth.v1.VerifyTokenResponse
|
13, // 8: auth.v1.AuthService.TerminateSession:input_type -> auth.v1.TerminateSessionRequest
|
||||||
9, // 9: auth.v1.AuthService.GetAccountRoleLevel:output_type -> auth.v1.GetAccountRoleLevelResponse
|
1, // 9: auth.v1.AuthService.Login:output_type -> auth.v1.LoginResponse
|
||||||
5, // 10: auth.v1.AuthService.Logout:output_type -> auth.v1.LogoutResponse
|
3, // 10: auth.v1.AuthService.Refresh:output_type -> auth.v1.RefreshResponse
|
||||||
5, // 11: auth.v1.AuthService.LogoutOther:output_type -> auth.v1.LogoutResponse
|
7, // 11: auth.v1.AuthService.VerifyToken:output_type -> auth.v1.VerifyTokenResponse
|
||||||
6, // [6:12] is the sub-list for method output_type
|
9, // 12: auth.v1.AuthService.GetAccountRoleLevel:output_type -> auth.v1.GetAccountRoleLevelResponse
|
||||||
0, // [0:6] is the sub-list for method input_type
|
5, // 13: auth.v1.AuthService.Logout:output_type -> auth.v1.LogoutResponse
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
5, // 14: auth.v1.AuthService.LogoutOther:output_type -> auth.v1.LogoutResponse
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
12, // 15: auth.v1.AuthService.GetSessions:output_type -> auth.v1.GetSessionsResponse
|
||||||
0, // [0:0] is the sub-list for field type_name
|
14, // 16: auth.v1.AuthService.TerminateSession:output_type -> auth.v1.TerminateSessionResponse
|
||||||
|
9, // [9:17] is the sub-list for method output_type
|
||||||
|
1, // [1:9] is the sub-list for method input_type
|
||||||
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_auth_proto_init() }
|
func init() { file_auth_proto_init() }
|
||||||
@@ -732,7 +1042,7 @@ func file_auth_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_auth_proto_rawDesc), len(file_auth_proto_rawDesc)),
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_auth_proto_rawDesc), len(file_auth_proto_rawDesc)),
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 10,
|
NumMessages: 15,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ const (
|
|||||||
AuthService_GetAccountRoleLevel_FullMethodName = "/auth.v1.AuthService/GetAccountRoleLevel"
|
AuthService_GetAccountRoleLevel_FullMethodName = "/auth.v1.AuthService/GetAccountRoleLevel"
|
||||||
AuthService_Logout_FullMethodName = "/auth.v1.AuthService/Logout"
|
AuthService_Logout_FullMethodName = "/auth.v1.AuthService/Logout"
|
||||||
AuthService_LogoutOther_FullMethodName = "/auth.v1.AuthService/LogoutOther"
|
AuthService_LogoutOther_FullMethodName = "/auth.v1.AuthService/LogoutOther"
|
||||||
|
AuthService_GetSessions_FullMethodName = "/auth.v1.AuthService/GetSessions"
|
||||||
|
AuthService_TerminateSession_FullMethodName = "/auth.v1.AuthService/TerminateSession"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AuthServiceClient is the client API for AuthService service.
|
// AuthServiceClient is the client API for AuthService service.
|
||||||
@@ -37,6 +39,8 @@ type AuthServiceClient interface {
|
|||||||
GetAccountRoleLevel(ctx context.Context, in *GetAccountRoleLevelRequest, opts ...grpc.CallOption) (*GetAccountRoleLevelResponse, error)
|
GetAccountRoleLevel(ctx context.Context, in *GetAccountRoleLevelRequest, opts ...grpc.CallOption) (*GetAccountRoleLevelResponse, error)
|
||||||
Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
|
Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
|
||||||
LogoutOther(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
|
LogoutOther(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
|
||||||
|
GetSessions(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionsResponse, error)
|
||||||
|
TerminateSession(ctx context.Context, in *TerminateSessionRequest, opts ...grpc.CallOption) (*TerminateSessionResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type authServiceClient struct {
|
type authServiceClient struct {
|
||||||
@@ -107,6 +111,26 @@ func (c *authServiceClient) LogoutOther(ctx context.Context, in *LogoutRequest,
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *authServiceClient) GetSessions(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionsResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(GetSessionsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AuthService_GetSessions_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *authServiceClient) TerminateSession(ctx context.Context, in *TerminateSessionRequest, opts ...grpc.CallOption) (*TerminateSessionResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(TerminateSessionResponse)
|
||||||
|
err := c.cc.Invoke(ctx, AuthService_TerminateSession_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// AuthServiceServer is the server API for AuthService service.
|
// AuthServiceServer is the server API for AuthService service.
|
||||||
// All implementations must embed UnimplementedAuthServiceServer
|
// All implementations must embed UnimplementedAuthServiceServer
|
||||||
// for forward compatibility.
|
// for forward compatibility.
|
||||||
@@ -117,6 +141,8 @@ type AuthServiceServer interface {
|
|||||||
GetAccountRoleLevel(context.Context, *GetAccountRoleLevelRequest) (*GetAccountRoleLevelResponse, error)
|
GetAccountRoleLevel(context.Context, *GetAccountRoleLevelRequest) (*GetAccountRoleLevelResponse, error)
|
||||||
Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
|
Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
|
||||||
LogoutOther(context.Context, *LogoutRequest) (*LogoutResponse, error)
|
LogoutOther(context.Context, *LogoutRequest) (*LogoutResponse, error)
|
||||||
|
GetSessions(context.Context, *GetSessionRequest) (*GetSessionsResponse, error)
|
||||||
|
TerminateSession(context.Context, *TerminateSessionRequest) (*TerminateSessionResponse, error)
|
||||||
mustEmbedUnimplementedAuthServiceServer()
|
mustEmbedUnimplementedAuthServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +171,12 @@ func (UnimplementedAuthServiceServer) Logout(context.Context, *LogoutRequest) (*
|
|||||||
func (UnimplementedAuthServiceServer) LogoutOther(context.Context, *LogoutRequest) (*LogoutResponse, error) {
|
func (UnimplementedAuthServiceServer) LogoutOther(context.Context, *LogoutRequest) (*LogoutResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method LogoutOther not implemented")
|
return nil, status.Error(codes.Unimplemented, "method LogoutOther not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedAuthServiceServer) GetSessions(context.Context, *GetSessionRequest) (*GetSessionsResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method GetSessions not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedAuthServiceServer) TerminateSession(context.Context, *TerminateSessionRequest) (*TerminateSessionResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method TerminateSession not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
||||||
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
@@ -274,6 +306,42 @@ func _AuthService_LogoutOther_Handler(srv interface{}, ctx context.Context, dec
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _AuthService_GetSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetSessionRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AuthServiceServer).GetSessions(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AuthService_GetSessions_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AuthServiceServer).GetSessions(ctx, req.(*GetSessionRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _AuthService_TerminateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(TerminateSessionRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(AuthServiceServer).TerminateSession(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: AuthService_TerminateSession_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(AuthServiceServer).TerminateSession(ctx, req.(*TerminateSessionRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService 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)
|
||||||
@@ -305,6 +373,14 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "LogoutOther",
|
MethodName: "LogoutOther",
|
||||||
Handler: _AuthService_LogoutOther_Handler,
|
Handler: _AuthService_LogoutOther_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetSessions",
|
||||||
|
Handler: _AuthService_GetSessions_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "TerminateSession",
|
||||||
|
Handler: _AuthService_TerminateSession_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "auth.proto",
|
Metadata: "auth.proto",
|
||||||
|
|||||||
Reference in New Issue
Block a user