From 1d13a790b5b4742a6ef634bcd9021561a27a546d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A7=E9=A9=8A?= Date: Sat, 24 Aug 2024 15:19:12 +0000 Subject: [PATCH] feature/token (#3) Co-authored-by: daniel.w Reviewed-on: https://code.30cm.net/digimon/proto-all/pulls/3 --- pkg/permission/service.pb.go | 1498 +++++++++++++++++++++++++++++ pkg/permission/service_grpc.pb.go | 481 +++++++++ 2 files changed, 1979 insertions(+) create mode 100644 pkg/permission/service.pb.go create mode 100644 pkg/permission/service_grpc.pb.go diff --git a/pkg/permission/service.pb.go b/pkg/permission/service.pb.go new file mode 100644 index 0000000..5f8ba6f --- /dev/null +++ b/pkg/permission/service.pb.go @@ -0,0 +1,1498 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v3.19.4 +// source: generate/protobuf/service.proto + +package permission + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// OKResp +type OKResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OKResp) Reset() { + *x = OKResp{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OKResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OKResp) ProtoMessage() {} + +func (x *OKResp) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OKResp.ProtoReflect.Descriptor instead. +func (*OKResp) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{0} +} + +// NoneReq +type NoneReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NoneReq) Reset() { + *x = NoneReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NoneReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NoneReq) ProtoMessage() {} + +func (x *NoneReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NoneReq.ProtoReflect.Descriptor instead. +func (*NoneReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{1} +} + +// AuthorizationReq 定義授權請求的結構 +type AuthorizationReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // grant_type 表示授權類型 + GrantType string `protobuf:"bytes,1,opt,name=grant_type,json=grantType,proto3" json:"grant_type,omitempty"` + // device_id 表示設備 ID + DeviceId string `protobuf:"bytes,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` + // scope 表示授權範圍 + Scope string `protobuf:"bytes,3,opt,name=scope,proto3" json:"scope,omitempty"` + // data 是一個通用的 key-value 結構,用於存儲額外數據 + Data map[string]string `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // expires 表示過期時間 + Expires int32 `protobuf:"varint,5,opt,name=expires,proto3" json:"expires,omitempty"` + // is_refresh_token 表示是否為刷新令牌 + IsRefreshToken bool `protobuf:"varint,6,opt,name=is_refresh_token,json=isRefreshToken,proto3" json:"is_refresh_token,omitempty"` +} + +func (x *AuthorizationReq) Reset() { + *x = AuthorizationReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthorizationReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthorizationReq) ProtoMessage() {} + +func (x *AuthorizationReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthorizationReq.ProtoReflect.Descriptor instead. +func (*AuthorizationReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{2} +} + +func (x *AuthorizationReq) GetGrantType() string { + if x != nil { + return x.GrantType + } + return "" +} + +func (x *AuthorizationReq) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +func (x *AuthorizationReq) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +func (x *AuthorizationReq) GetData() map[string]string { + if x != nil { + return x.Data + } + return nil +} + +func (x *AuthorizationReq) GetExpires() int32 { + if x != nil { + return x.Expires + } + return 0 +} + +func (x *AuthorizationReq) GetIsRefreshToken() bool { + if x != nil { + return x.IsRefreshToken + } + return false +} + +// TokenResp 定義訪問令牌響應的結構 +type TokenResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // access_token 表示訪問令牌 + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + // token_type 表示令牌類型 + TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` + // expires_in 表示令牌過期時間 + ExpiresIn int32 `protobuf:"varint,3,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` + // refresh_token 表示刷新令牌 + RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` +} + +func (x *TokenResp) Reset() { + *x = TokenResp{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenResp) ProtoMessage() {} + +func (x *TokenResp) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenResp.ProtoReflect.Descriptor instead. +func (*TokenResp) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{3} +} + +func (x *TokenResp) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *TokenResp) GetTokenType() string { + if x != nil { + return x.TokenType + } + return "" +} + +func (x *TokenResp) GetExpiresIn() int32 { + if x != nil { + return x.ExpiresIn + } + return 0 +} + +func (x *TokenResp) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +// CreateOneTimeTokenReq 建立一次性使用的 token, +// 要帶比較長久的 token 來,驗證後才可以 +type CreateOneTimeTokenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *CreateOneTimeTokenReq) Reset() { + *x = CreateOneTimeTokenReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOneTimeTokenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOneTimeTokenReq) ProtoMessage() {} + +func (x *CreateOneTimeTokenReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOneTimeTokenReq.ProtoReflect.Descriptor instead. +func (*CreateOneTimeTokenReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateOneTimeTokenReq) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type CreateOneTimeTokenResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OneTimeToken string `protobuf:"bytes,1,opt,name=one_time_token,json=oneTimeToken,proto3" json:"one_time_token,omitempty"` +} + +func (x *CreateOneTimeTokenResp) Reset() { + *x = CreateOneTimeTokenResp{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOneTimeTokenResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOneTimeTokenResp) ProtoMessage() {} + +func (x *CreateOneTimeTokenResp) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOneTimeTokenResp.ProtoReflect.Descriptor instead. +func (*CreateOneTimeTokenResp) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateOneTimeTokenResp) GetOneTimeToken() string { + if x != nil { + return x.OneTimeToken + } + return "" +} + +// RefreshTokenReq 更新 Token +type RefreshTokenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + Scope string `protobuf:"bytes,2,opt,name=scope,proto3" json:"scope,omitempty"` + Expires int64 `protobuf:"varint,3,opt,name=expires,proto3" json:"expires,omitempty"` + DeviceId string `protobuf:"bytes,4,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` +} + +func (x *RefreshTokenReq) Reset() { + *x = RefreshTokenReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshTokenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshTokenReq) ProtoMessage() {} + +func (x *RefreshTokenReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshTokenReq.ProtoReflect.Descriptor instead. +func (*RefreshTokenReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{6} +} + +func (x *RefreshTokenReq) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *RefreshTokenReq) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +func (x *RefreshTokenReq) GetExpires() int64 { + if x != nil { + return x.Expires + } + return 0 +} + +func (x *RefreshTokenReq) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +// https://datatracker.ietf.org/doc/html/rfc6749#section-4.3.3 +type RefreshTokenResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + OneTimeToken string `protobuf:"bytes,2,opt,name=one_time_token,json=oneTimeToken,proto3" json:"one_time_token,omitempty"` + ExpiresIn int64 `protobuf:"varint,3,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` + TokenType string `protobuf:"bytes,4,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` +} + +func (x *RefreshTokenResp) Reset() { + *x = RefreshTokenResp{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshTokenResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshTokenResp) ProtoMessage() {} + +func (x *RefreshTokenResp) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshTokenResp.ProtoReflect.Descriptor instead. +func (*RefreshTokenResp) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{7} +} + +func (x *RefreshTokenResp) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *RefreshTokenResp) GetOneTimeToken() string { + if x != nil { + return x.OneTimeToken + } + return "" +} + +func (x *RefreshTokenResp) GetExpiresIn() int64 { + if x != nil { + return x.ExpiresIn + } + return 0 +} + +func (x *RefreshTokenResp) GetTokenType() string { + if x != nil { + return x.TokenType + } + return "" +} + +// CancelTokenReq 註銷這個 Token +type CancelTokenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *CancelTokenReq) Reset() { + *x = CancelTokenReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelTokenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelTokenReq) ProtoMessage() {} + +func (x *CancelTokenReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelTokenReq.ProtoReflect.Descriptor instead. +func (*CancelTokenReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{8} +} + +func (x *CancelTokenReq) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// CancelTokenReq 註銷這個 Token +type DoTokenByUIDReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` +} + +func (x *DoTokenByUIDReq) Reset() { + *x = DoTokenByUIDReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoTokenByUIDReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoTokenByUIDReq) ProtoMessage() {} + +func (x *DoTokenByUIDReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoTokenByUIDReq.ProtoReflect.Descriptor instead. +func (*DoTokenByUIDReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{9} +} + +func (x *DoTokenByUIDReq) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +func (x *DoTokenByUIDReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +// QueryTokenByUIDReq 拿這個UID 找 Token +type QueryTokenByUIDReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` +} + +func (x *QueryTokenByUIDReq) Reset() { + *x = QueryTokenByUIDReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryTokenByUIDReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryTokenByUIDReq) ProtoMessage() {} + +func (x *QueryTokenByUIDReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryTokenByUIDReq.ProtoReflect.Descriptor instead. +func (*QueryTokenByUIDReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{10} +} + +func (x *QueryTokenByUIDReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +// ValidationTokenReq 驗證這個 Token +type ValidationTokenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *ValidationTokenReq) Reset() { + *x = ValidationTokenReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidationTokenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidationTokenReq) ProtoMessage() {} + +func (x *ValidationTokenReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidationTokenReq.ProtoReflect.Descriptor instead. +func (*ValidationTokenReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{11} +} + +func (x *ValidationTokenReq) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// ValidationTokenResp 驗證以及取得 Token 詳情 +type ValidationTokenResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token *Token `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + Data map[string]string `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ValidationTokenResp) Reset() { + *x = ValidationTokenResp{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidationTokenResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidationTokenResp) ProtoMessage() {} + +func (x *ValidationTokenResp) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidationTokenResp.ProtoReflect.Descriptor instead. +func (*ValidationTokenResp) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{12} +} + +func (x *ValidationTokenResp) GetToken() *Token { + if x != nil { + return x.Token + } + return nil +} + +func (x *ValidationTokenResp) GetData() map[string]string { + if x != nil { + return x.Data + } + return nil +} + +// Token 定義令牌的結構 +type Token struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID 表示令牌的唯一標識符 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // client_id 表示客戶端 ID + ClientId int32 `protobuf:"varint,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // uid 表示用戶 ID + Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"` + // device_id 表示設備 ID + DeviceId string `protobuf:"bytes,4,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` + // access_token 表示訪問令牌 + AccessToken string `protobuf:"bytes,5,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + // expires_in 表示訪問令牌的過期時間(秒) + ExpiresIn int32 `protobuf:"varint,6,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` + // access_create_at 表示訪問令牌的創建時間 + AccessCreateAt int64 `protobuf:"varint,7,opt,name=access_create_at,json=accessCreateAt,proto3" json:"access_create_at,omitempty"` + // refresh_token 表示刷新令牌 + RefreshToken string `protobuf:"bytes,8,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + // refresh_expires_in 表示刷新令牌的過期時間(秒) + RefreshExpiresIn int32 `protobuf:"varint,9,opt,name=refresh_expires_in,json=refreshExpiresIn,proto3" json:"refresh_expires_in,omitempty"` + // refresh_create_at 表示刷新令牌的創建時間 + RefreshCreateAt int64 `protobuf:"varint,10,opt,name=refresh_create_at,json=refreshCreateAt,proto3" json:"refresh_create_at,omitempty"` +} + +func (x *Token) Reset() { + *x = Token{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Token) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Token) ProtoMessage() {} + +func (x *Token) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Token.ProtoReflect.Descriptor instead. +func (*Token) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{13} +} + +func (x *Token) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Token) GetClientId() int32 { + if x != nil { + return x.ClientId + } + return 0 +} + +func (x *Token) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *Token) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +func (x *Token) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *Token) GetExpiresIn() int32 { + if x != nil { + return x.ExpiresIn + } + return 0 +} + +func (x *Token) GetAccessCreateAt() int64 { + if x != nil { + return x.AccessCreateAt + } + return 0 +} + +func (x *Token) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *Token) GetRefreshExpiresIn() int32 { + if x != nil { + return x.RefreshExpiresIn + } + return 0 +} + +func (x *Token) GetRefreshCreateAt() int64 { + if x != nil { + return x.RefreshCreateAt + } + return 0 +} + +// DoTokenByDeviceIDReq 用DeviceID 來做事的 +type DoTokenByDeviceIDReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeviceId string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` +} + +func (x *DoTokenByDeviceIDReq) Reset() { + *x = DoTokenByDeviceIDReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoTokenByDeviceIDReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoTokenByDeviceIDReq) ProtoMessage() {} + +func (x *DoTokenByDeviceIDReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoTokenByDeviceIDReq.ProtoReflect.Descriptor instead. +func (*DoTokenByDeviceIDReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{14} +} + +func (x *DoTokenByDeviceIDReq) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +type Tokens struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token []*TokenResp `protobuf:"bytes,1,rep,name=token,proto3" json:"token,omitempty"` +} + +func (x *Tokens) Reset() { + *x = Tokens{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tokens) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Tokens) ProtoMessage() {} + +func (x *Tokens) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Tokens.ProtoReflect.Descriptor instead. +func (*Tokens) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{15} +} + +func (x *Tokens) GetToken() []*TokenResp { + if x != nil { + return x.Token + } + return nil +} + +type CancelOneTimeTokenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token []string `protobuf:"bytes,1,rep,name=token,proto3" json:"token,omitempty"` +} + +func (x *CancelOneTimeTokenReq) Reset() { + *x = CancelOneTimeTokenReq{} + if protoimpl.UnsafeEnabled { + mi := &file_generate_protobuf_service_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CancelOneTimeTokenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelOneTimeTokenReq) ProtoMessage() {} + +func (x *CancelOneTimeTokenReq) ProtoReflect() protoreflect.Message { + mi := &file_generate_protobuf_service_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelOneTimeTokenReq.ProtoReflect.Descriptor instead. +func (*CancelOneTimeTokenReq) Descriptor() ([]byte, []int) { + return file_generate_protobuf_service_proto_rawDescGZIP(), []int{16} +} + +func (x *CancelOneTimeTokenReq) GetToken() []string { + if x != nil { + return x.Token + } + return nil +} + +var File_generate_protobuf_service_proto protoreflect.FileDescriptor + +var file_generate_protobuf_service_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x08, 0x0a, + 0x06, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x09, 0x0a, 0x07, 0x4e, 0x6f, 0x6e, 0x65, 0x52, + 0x65, 0x71, 0x22, 0x9d, 0x02, 0x0a, 0x10, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x61, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x12, + 0x28, 0x0a, 0x10, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, + 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x91, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x69, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, + 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2d, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3e, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, + 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x24, 0x0a, 0x0e, 0x6f, 0x6e, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x74, 0x0a, 0x0f, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, + 0x63, 0x6f, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x12, 0x1b, + 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x10, + 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x24, 0x0a, 0x0e, 0x6f, 0x6e, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x6f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x35, 0x0a, 0x0f, 0x44, 0x6f, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x79, 0x55, + 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x26, 0x0a, 0x12, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x79, 0x55, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, + 0x64, 0x22, 0x2a, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xb6, 0x01, + 0x0a, 0x13, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3d, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, + 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xce, 0x02, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x12, 0x28, + 0x0a, 0x10, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, + 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2c, 0x0a, + 0x12, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, + 0x5f, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x72, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x12, 0x2a, 0x0a, 0x11, 0x72, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x74, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x22, 0x33, 0x0a, 0x14, 0x44, 0x6f, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, + 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x06, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0x2d, 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x6e, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x32, 0xff, 0x05, 0x0a, 0x0c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x4e, 0x65, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x1c, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, + 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x3d, 0x0a, 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1a, + 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x52, + 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x1e, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x3f, 0x0a, 0x0c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x44, 0x6f, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x79, 0x55, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, + 0x12, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x20, 0x2e, 0x70, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x42, 0x79, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x12, + 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x4f, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x42, 0x79, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x20, 0x2e, + 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x42, 0x79, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, + 0x12, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x12, 0x48, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x73, 0x42, 0x79, 0x55, 0x69, 0x64, 0x12, 0x1e, 0x2e, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x42, 0x79, 0x55, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x58, 0x0a, + 0x0f, 0x4e, 0x65, 0x77, 0x4f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x21, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4b, 0x0a, 0x12, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x4f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x2e, + 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x4f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, + 0x1a, 0x12, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x4b, + 0x52, 0x65, 0x73, 0x70, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_generate_protobuf_service_proto_rawDescOnce sync.Once + file_generate_protobuf_service_proto_rawDescData = file_generate_protobuf_service_proto_rawDesc +) + +func file_generate_protobuf_service_proto_rawDescGZIP() []byte { + file_generate_protobuf_service_proto_rawDescOnce.Do(func() { + file_generate_protobuf_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_generate_protobuf_service_proto_rawDescData) + }) + return file_generate_protobuf_service_proto_rawDescData +} + +var file_generate_protobuf_service_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_generate_protobuf_service_proto_goTypes = []any{ + (*OKResp)(nil), // 0: permission.OKResp + (*NoneReq)(nil), // 1: permission.NoneReq + (*AuthorizationReq)(nil), // 2: permission.AuthorizationReq + (*TokenResp)(nil), // 3: permission.TokenResp + (*CreateOneTimeTokenReq)(nil), // 4: permission.CreateOneTimeTokenReq + (*CreateOneTimeTokenResp)(nil), // 5: permission.CreateOneTimeTokenResp + (*RefreshTokenReq)(nil), // 6: permission.RefreshTokenReq + (*RefreshTokenResp)(nil), // 7: permission.RefreshTokenResp + (*CancelTokenReq)(nil), // 8: permission.CancelTokenReq + (*DoTokenByUIDReq)(nil), // 9: permission.DoTokenByUIDReq + (*QueryTokenByUIDReq)(nil), // 10: permission.QueryTokenByUIDReq + (*ValidationTokenReq)(nil), // 11: permission.ValidationTokenReq + (*ValidationTokenResp)(nil), // 12: permission.ValidationTokenResp + (*Token)(nil), // 13: permission.Token + (*DoTokenByDeviceIDReq)(nil), // 14: permission.DoTokenByDeviceIDReq + (*Tokens)(nil), // 15: permission.Tokens + (*CancelOneTimeTokenReq)(nil), // 16: permission.CancelOneTimeTokenReq + nil, // 17: permission.AuthorizationReq.DataEntry + nil, // 18: permission.ValidationTokenResp.DataEntry +} +var file_generate_protobuf_service_proto_depIdxs = []int32{ + 17, // 0: permission.AuthorizationReq.data:type_name -> permission.AuthorizationReq.DataEntry + 13, // 1: permission.ValidationTokenResp.token:type_name -> permission.Token + 18, // 2: permission.ValidationTokenResp.data:type_name -> permission.ValidationTokenResp.DataEntry + 3, // 3: permission.Tokens.token:type_name -> permission.TokenResp + 2, // 4: permission.TokenService.NewToken:input_type -> permission.AuthorizationReq + 6, // 5: permission.TokenService.RefreshToken:input_type -> permission.RefreshTokenReq + 8, // 6: permission.TokenService.CancelToken:input_type -> permission.CancelTokenReq + 11, // 7: permission.TokenService.ValidationToken:input_type -> permission.ValidationTokenReq + 9, // 8: permission.TokenService.CancelTokens:input_type -> permission.DoTokenByUIDReq + 14, // 9: permission.TokenService.CancelTokenByDeviceId:input_type -> permission.DoTokenByDeviceIDReq + 14, // 10: permission.TokenService.GetUserTokensByDeviceId:input_type -> permission.DoTokenByDeviceIDReq + 10, // 11: permission.TokenService.GetUserTokensByUid:input_type -> permission.QueryTokenByUIDReq + 4, // 12: permission.TokenService.NewOneTimeToken:input_type -> permission.CreateOneTimeTokenReq + 16, // 13: permission.TokenService.CancelOneTimeToken:input_type -> permission.CancelOneTimeTokenReq + 3, // 14: permission.TokenService.NewToken:output_type -> permission.TokenResp + 7, // 15: permission.TokenService.RefreshToken:output_type -> permission.RefreshTokenResp + 0, // 16: permission.TokenService.CancelToken:output_type -> permission.OKResp + 12, // 17: permission.TokenService.ValidationToken:output_type -> permission.ValidationTokenResp + 0, // 18: permission.TokenService.CancelTokens:output_type -> permission.OKResp + 0, // 19: permission.TokenService.CancelTokenByDeviceId:output_type -> permission.OKResp + 15, // 20: permission.TokenService.GetUserTokensByDeviceId:output_type -> permission.Tokens + 15, // 21: permission.TokenService.GetUserTokensByUid:output_type -> permission.Tokens + 5, // 22: permission.TokenService.NewOneTimeToken:output_type -> permission.CreateOneTimeTokenResp + 0, // 23: permission.TokenService.CancelOneTimeToken:output_type -> permission.OKResp + 14, // [14:24] is the sub-list for method output_type + 4, // [4:14] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_generate_protobuf_service_proto_init() } +func file_generate_protobuf_service_proto_init() { + if File_generate_protobuf_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_generate_protobuf_service_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*OKResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*NoneReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*AuthorizationReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*TokenResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*CreateOneTimeTokenReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*CreateOneTimeTokenResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*RefreshTokenReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*RefreshTokenResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*CancelTokenReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*DoTokenByUIDReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*QueryTokenByUIDReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*ValidationTokenReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[12].Exporter = func(v any, i int) any { + switch v := v.(*ValidationTokenResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[13].Exporter = func(v any, i int) any { + switch v := v.(*Token); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[14].Exporter = func(v any, i int) any { + switch v := v.(*DoTokenByDeviceIDReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[15].Exporter = func(v any, i int) any { + switch v := v.(*Tokens); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_generate_protobuf_service_proto_msgTypes[16].Exporter = func(v any, i int) any { + switch v := v.(*CancelOneTimeTokenReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_generate_protobuf_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 19, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_generate_protobuf_service_proto_goTypes, + DependencyIndexes: file_generate_protobuf_service_proto_depIdxs, + MessageInfos: file_generate_protobuf_service_proto_msgTypes, + }.Build() + File_generate_protobuf_service_proto = out.File + file_generate_protobuf_service_proto_rawDesc = nil + file_generate_protobuf_service_proto_goTypes = nil + file_generate_protobuf_service_proto_depIdxs = nil +} diff --git a/pkg/permission/service_grpc.pb.go b/pkg/permission/service_grpc.pb.go new file mode 100644 index 0000000..292d377 --- /dev/null +++ b/pkg/permission/service_grpc.pb.go @@ -0,0 +1,481 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc v3.19.4 +// source: generate/protobuf/service.proto + +package permission + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + TokenService_NewToken_FullMethodName = "/permission.TokenService/NewToken" + TokenService_RefreshToken_FullMethodName = "/permission.TokenService/RefreshToken" + TokenService_CancelToken_FullMethodName = "/permission.TokenService/CancelToken" + TokenService_ValidationToken_FullMethodName = "/permission.TokenService/ValidationToken" + TokenService_CancelTokens_FullMethodName = "/permission.TokenService/CancelTokens" + TokenService_CancelTokenByDeviceId_FullMethodName = "/permission.TokenService/CancelTokenByDeviceId" + TokenService_GetUserTokensByDeviceId_FullMethodName = "/permission.TokenService/GetUserTokensByDeviceId" + TokenService_GetUserTokensByUid_FullMethodName = "/permission.TokenService/GetUserTokensByUid" + TokenService_NewOneTimeToken_FullMethodName = "/permission.TokenService/NewOneTimeToken" + TokenService_CancelOneTimeToken_FullMethodName = "/permission.TokenService/CancelOneTimeToken" +) + +// TokenServiceClient is the client API for TokenService 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. +// +// 跟 Token 相關的大小事,這次只回應錯誤,以及結果,不統一規範 +// 錯誤碼應該在 Biz GW 在做回應,另外我這邊取名字比較通用, +// access_token -> token , refresh_token -> one_time_token +type TokenServiceClient interface { + // NewToken 建立一個新的 Token,例如:AccessToken + NewToken(ctx context.Context, in *AuthorizationReq, opts ...grpc.CallOption) (*TokenResp, error) + // RefreshToken 更新目前的token 以及裡面包含的一次性 Token + RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*RefreshTokenResp, error) + // CancelToken 取消 Token,也包含他裡面的 One Time Toke + CancelToken(ctx context.Context, in *CancelTokenReq, opts ...grpc.CallOption) (*OKResp, error) + // ValidationToken 驗證這個 Token 有沒有效 + ValidationToken(ctx context.Context, in *ValidationTokenReq, opts ...grpc.CallOption) (*ValidationTokenResp, error) + // CancelTokens 取消 Token 從UID 視角,以及 token id 視角出發, UID 登出,底下所有 Device ID 也要登出, Token ID 登出, 所有 UID + Device 都要登出 + CancelTokens(ctx context.Context, in *DoTokenByUIDReq, opts ...grpc.CallOption) (*OKResp, error) + // CancelTokenByDeviceId 取消 Token, 從 Device 視角出發,可以選,登出這個Device 下所有 token ,登出這個Device 下指定token + CancelTokenByDeviceId(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*OKResp, error) + // GetUserTokensByDeviceId 取得目前所對應的 DeviceID 所存在的 Tokens + GetUserTokensByDeviceId(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*Tokens, error) + // GetUserTokensByUid 取得目前所對應的 UID 所存在的 Tokens + GetUserTokensByUid(ctx context.Context, in *QueryTokenByUIDReq, opts ...grpc.CallOption) (*Tokens, error) + // NewOneTimeToken 建立一次性使用,例如:RefreshToken + NewOneTimeToken(ctx context.Context, in *CreateOneTimeTokenReq, opts ...grpc.CallOption) (*CreateOneTimeTokenResp, error) + // CancelOneTimeToken 取消一次性使用 + CancelOneTimeToken(ctx context.Context, in *CancelOneTimeTokenReq, opts ...grpc.CallOption) (*OKResp, error) +} + +type tokenServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTokenServiceClient(cc grpc.ClientConnInterface) TokenServiceClient { + return &tokenServiceClient{cc} +} + +func (c *tokenServiceClient) NewToken(ctx context.Context, in *AuthorizationReq, opts ...grpc.CallOption) (*TokenResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TokenResp) + err := c.cc.Invoke(ctx, TokenService_NewToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*RefreshTokenResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RefreshTokenResp) + err := c.cc.Invoke(ctx, TokenService_RefreshToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) CancelToken(ctx context.Context, in *CancelTokenReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, TokenService_CancelToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) ValidationToken(ctx context.Context, in *ValidationTokenReq, opts ...grpc.CallOption) (*ValidationTokenResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValidationTokenResp) + err := c.cc.Invoke(ctx, TokenService_ValidationToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) CancelTokens(ctx context.Context, in *DoTokenByUIDReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, TokenService_CancelTokens_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) CancelTokenByDeviceId(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, TokenService_CancelTokenByDeviceId_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) GetUserTokensByDeviceId(ctx context.Context, in *DoTokenByDeviceIDReq, opts ...grpc.CallOption) (*Tokens, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Tokens) + err := c.cc.Invoke(ctx, TokenService_GetUserTokensByDeviceId_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) GetUserTokensByUid(ctx context.Context, in *QueryTokenByUIDReq, opts ...grpc.CallOption) (*Tokens, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Tokens) + err := c.cc.Invoke(ctx, TokenService_GetUserTokensByUid_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) NewOneTimeToken(ctx context.Context, in *CreateOneTimeTokenReq, opts ...grpc.CallOption) (*CreateOneTimeTokenResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateOneTimeTokenResp) + err := c.cc.Invoke(ctx, TokenService_NewOneTimeToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tokenServiceClient) CancelOneTimeToken(ctx context.Context, in *CancelOneTimeTokenReq, opts ...grpc.CallOption) (*OKResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OKResp) + err := c.cc.Invoke(ctx, TokenService_CancelOneTimeToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TokenServiceServer is the server API for TokenService service. +// All implementations must embed UnimplementedTokenServiceServer +// for forward compatibility +// +// 跟 Token 相關的大小事,這次只回應錯誤,以及結果,不統一規範 +// 錯誤碼應該在 Biz GW 在做回應,另外我這邊取名字比較通用, +// access_token -> token , refresh_token -> one_time_token +type TokenServiceServer interface { + // NewToken 建立一個新的 Token,例如:AccessToken + NewToken(context.Context, *AuthorizationReq) (*TokenResp, error) + // RefreshToken 更新目前的token 以及裡面包含的一次性 Token + RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error) + // CancelToken 取消 Token,也包含他裡面的 One Time Toke + CancelToken(context.Context, *CancelTokenReq) (*OKResp, error) + // ValidationToken 驗證這個 Token 有沒有效 + ValidationToken(context.Context, *ValidationTokenReq) (*ValidationTokenResp, error) + // CancelTokens 取消 Token 從UID 視角,以及 token id 視角出發, UID 登出,底下所有 Device ID 也要登出, Token ID 登出, 所有 UID + Device 都要登出 + CancelTokens(context.Context, *DoTokenByUIDReq) (*OKResp, error) + // CancelTokenByDeviceId 取消 Token, 從 Device 視角出發,可以選,登出這個Device 下所有 token ,登出這個Device 下指定token + CancelTokenByDeviceId(context.Context, *DoTokenByDeviceIDReq) (*OKResp, error) + // GetUserTokensByDeviceId 取得目前所對應的 DeviceID 所存在的 Tokens + GetUserTokensByDeviceId(context.Context, *DoTokenByDeviceIDReq) (*Tokens, error) + // GetUserTokensByUid 取得目前所對應的 UID 所存在的 Tokens + GetUserTokensByUid(context.Context, *QueryTokenByUIDReq) (*Tokens, error) + // NewOneTimeToken 建立一次性使用,例如:RefreshToken + NewOneTimeToken(context.Context, *CreateOneTimeTokenReq) (*CreateOneTimeTokenResp, error) + // CancelOneTimeToken 取消一次性使用 + CancelOneTimeToken(context.Context, *CancelOneTimeTokenReq) (*OKResp, error) + mustEmbedUnimplementedTokenServiceServer() +} + +// UnimplementedTokenServiceServer must be embedded to have forward compatible implementations. +type UnimplementedTokenServiceServer struct { +} + +func (UnimplementedTokenServiceServer) NewToken(context.Context, *AuthorizationReq) (*TokenResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewToken not implemented") +} +func (UnimplementedTokenServiceServer) RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") +} +func (UnimplementedTokenServiceServer) CancelToken(context.Context, *CancelTokenReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelToken not implemented") +} +func (UnimplementedTokenServiceServer) ValidationToken(context.Context, *ValidationTokenReq) (*ValidationTokenResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidationToken not implemented") +} +func (UnimplementedTokenServiceServer) CancelTokens(context.Context, *DoTokenByUIDReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelTokens not implemented") +} +func (UnimplementedTokenServiceServer) CancelTokenByDeviceId(context.Context, *DoTokenByDeviceIDReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelTokenByDeviceId not implemented") +} +func (UnimplementedTokenServiceServer) GetUserTokensByDeviceId(context.Context, *DoTokenByDeviceIDReq) (*Tokens, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserTokensByDeviceId not implemented") +} +func (UnimplementedTokenServiceServer) GetUserTokensByUid(context.Context, *QueryTokenByUIDReq) (*Tokens, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserTokensByUid not implemented") +} +func (UnimplementedTokenServiceServer) NewOneTimeToken(context.Context, *CreateOneTimeTokenReq) (*CreateOneTimeTokenResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewOneTimeToken not implemented") +} +func (UnimplementedTokenServiceServer) CancelOneTimeToken(context.Context, *CancelOneTimeTokenReq) (*OKResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelOneTimeToken not implemented") +} +func (UnimplementedTokenServiceServer) mustEmbedUnimplementedTokenServiceServer() {} + +// UnsafeTokenServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TokenServiceServer will +// result in compilation errors. +type UnsafeTokenServiceServer interface { + mustEmbedUnimplementedTokenServiceServer() +} + +func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer) { + s.RegisterService(&TokenService_ServiceDesc, srv) +} + +func _TokenService_NewToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AuthorizationReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).NewToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_NewToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).NewToken(ctx, req.(*AuthorizationReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RefreshTokenReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).RefreshToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_RefreshToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).RefreshToken(ctx, req.(*RefreshTokenReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_CancelToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelTokenReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).CancelToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_CancelToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).CancelToken(ctx, req.(*CancelTokenReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_ValidationToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidationTokenReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).ValidationToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_ValidationToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).ValidationToken(ctx, req.(*ValidationTokenReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_CancelTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DoTokenByUIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).CancelTokens(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_CancelTokens_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).CancelTokens(ctx, req.(*DoTokenByUIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_CancelTokenByDeviceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DoTokenByDeviceIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).CancelTokenByDeviceId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_CancelTokenByDeviceId_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).CancelTokenByDeviceId(ctx, req.(*DoTokenByDeviceIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_GetUserTokensByDeviceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DoTokenByDeviceIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).GetUserTokensByDeviceId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_GetUserTokensByDeviceId_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).GetUserTokensByDeviceId(ctx, req.(*DoTokenByDeviceIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_GetUserTokensByUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenByUIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).GetUserTokensByUid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_GetUserTokensByUid_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).GetUserTokensByUid(ctx, req.(*QueryTokenByUIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_NewOneTimeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOneTimeTokenReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).NewOneTimeToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_NewOneTimeToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).NewOneTimeToken(ctx, req.(*CreateOneTimeTokenReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _TokenService_CancelOneTimeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelOneTimeTokenReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TokenServiceServer).CancelOneTimeToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TokenService_CancelOneTimeToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TokenServiceServer).CancelOneTimeToken(ctx, req.(*CancelOneTimeTokenReq)) + } + return interceptor(ctx, in, info, handler) +} + +// TokenService_ServiceDesc is the grpc.ServiceDesc for TokenService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TokenService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "permission.TokenService", + HandlerType: (*TokenServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "NewToken", + Handler: _TokenService_NewToken_Handler, + }, + { + MethodName: "RefreshToken", + Handler: _TokenService_RefreshToken_Handler, + }, + { + MethodName: "CancelToken", + Handler: _TokenService_CancelToken_Handler, + }, + { + MethodName: "ValidationToken", + Handler: _TokenService_ValidationToken_Handler, + }, + { + MethodName: "CancelTokens", + Handler: _TokenService_CancelTokens_Handler, + }, + { + MethodName: "CancelTokenByDeviceId", + Handler: _TokenService_CancelTokenByDeviceId_Handler, + }, + { + MethodName: "GetUserTokensByDeviceId", + Handler: _TokenService_GetUserTokensByDeviceId_Handler, + }, + { + MethodName: "GetUserTokensByUid", + Handler: _TokenService_GetUserTokensByUid_Handler, + }, + { + MethodName: "NewOneTimeToken", + Handler: _TokenService_NewOneTimeToken_Handler, + }, + { + MethodName: "CancelOneTimeToken", + Handler: _TokenService_CancelOneTimeToken_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "generate/protobuf/service.proto", +}