Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

View File

@@ -0,0 +1,472 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.14.0
// source: protobufs/authentication.proto
package authentication
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
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)
)
type AuthToken struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
Roles string `protobuf:"bytes,2,opt,name=roles,proto3" json:"roles,omitempty"`
}
func (x *AuthToken) Reset() {
*x = AuthToken{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthToken) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthToken) ProtoMessage() {}
func (x *AuthToken) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_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 AuthToken.ProtoReflect.Descriptor instead.
func (*AuthToken) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{0}
}
func (x *AuthToken) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *AuthToken) GetRoles() string {
if x != nil {
return x.Roles
}
return ""
}
type AuthCode struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
Redirect string `protobuf:"bytes,2,opt,name=redirect,proto3" json:"redirect,omitempty"`
}
func (x *AuthCode) Reset() {
*x = AuthCode{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthCode) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthCode) ProtoMessage() {}
func (x *AuthCode) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_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 AuthCode.ProtoReflect.Descriptor instead.
func (*AuthCode) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{1}
}
func (x *AuthCode) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
func (x *AuthCode) GetRedirect() string {
if x != nil {
return x.Redirect
}
return ""
}
type AuthJWT struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Jwt string `protobuf:"bytes,1,opt,name=jwt,proto3" json:"jwt,omitempty"`
}
func (x *AuthJWT) Reset() {
*x = AuthJWT{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthJWT) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthJWT) ProtoMessage() {}
func (x *AuthJWT) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_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 AuthJWT.ProtoReflect.Descriptor instead.
func (*AuthJWT) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{2}
}
func (x *AuthJWT) GetJwt() string {
if x != nil {
return x.Jwt
}
return ""
}
type AuthTokens struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AccessToken *AuthJWT `protobuf:"bytes,1,opt,name=accessToken,proto3" json:"accessToken,omitempty"`
IdToken *AuthJWT `protobuf:"bytes,2,opt,name=idToken,proto3" json:"idToken,omitempty"`
RefreshToken *AuthToken `protobuf:"bytes,3,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"`
}
func (x *AuthTokens) Reset() {
*x = AuthTokens{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthTokens) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthTokens) ProtoMessage() {}
func (x *AuthTokens) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_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 AuthTokens.ProtoReflect.Descriptor instead.
func (*AuthTokens) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{3}
}
func (x *AuthTokens) GetAccessToken() *AuthJWT {
if x != nil {
return x.AccessToken
}
return nil
}
func (x *AuthTokens) GetIdToken() *AuthJWT {
if x != nil {
return x.IdToken
}
return nil
}
func (x *AuthTokens) GetRefreshToken() *AuthToken {
if x != nil {
return x.RefreshToken
}
return nil
}
type ValidationResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
}
func (x *ValidationResult) Reset() {
*x = ValidationResult{}
if protoimpl.UnsafeEnabled {
mi := &file_protobufs_authentication_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ValidationResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ValidationResult) ProtoMessage() {}
func (x *ValidationResult) ProtoReflect() protoreflect.Message {
mi := &file_protobufs_authentication_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 ValidationResult.ProtoReflect.Descriptor instead.
func (*ValidationResult) Descriptor() ([]byte, []int) {
return file_protobufs_authentication_proto_rawDescGZIP(), []int{4}
}
func (x *ValidationResult) GetValid() bool {
if x != nil {
return x.Valid
}
return false
}
func (x *ValidationResult) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
var File_protobufs_authentication_proto protoreflect.FileDescriptor
var file_protobufs_authentication_proto_rawDesc = []byte{
0x0a, 0x1e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68,
0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x22, 0x37, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 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, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x3a, 0x0a, 0x08, 0x41, 0x75, 0x74,
0x68, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x64,
0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x64,
0x69, 0x72, 0x65, 0x63, 0x74, 0x22, 0x1b, 0x0a, 0x07, 0x41, 0x75, 0x74, 0x68, 0x4a, 0x57, 0x54,
0x12, 0x10, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6a,
0x77, 0x74, 0x22, 0xb9, 0x01, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x73, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x4a, 0x57, 0x54, 0x52,
0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x31, 0x0a, 0x07,
0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41,
0x75, 0x74, 0x68, 0x4a, 0x57, 0x54, 0x52, 0x07, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
0x3d, 0x0a, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x42,
0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x32, 0xed, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x43, 0x6f, 0x64, 0x65, 0x1a, 0x1a, 0x2e, 0x61,
0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75,
0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0d, 0x52, 0x65,
0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x75,
0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74,
0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x1a, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0b, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x12, 0x19, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x20,
0x2e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x22, 0x00, 0x42, 0x2b, 0x5a, 0x29, 0x66, 0x69, 0x73, 0x6b, 0x65, 0x72, 0x69, 0x6e, 0x63, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63,
0x2f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_protobufs_authentication_proto_rawDescOnce sync.Once
file_protobufs_authentication_proto_rawDescData = file_protobufs_authentication_proto_rawDesc
)
func file_protobufs_authentication_proto_rawDescGZIP() []byte {
file_protobufs_authentication_proto_rawDescOnce.Do(func() {
file_protobufs_authentication_proto_rawDescData = protoimpl.X.CompressGZIP(file_protobufs_authentication_proto_rawDescData)
})
return file_protobufs_authentication_proto_rawDescData
}
var file_protobufs_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_protobufs_authentication_proto_goTypes = []interface{}{
(*AuthToken)(nil), // 0: authentication.AuthToken
(*AuthCode)(nil), // 1: authentication.AuthCode
(*AuthJWT)(nil), // 2: authentication.AuthJWT
(*AuthTokens)(nil), // 3: authentication.AuthTokens
(*ValidationResult)(nil), // 4: authentication.ValidationResult
}
var file_protobufs_authentication_proto_depIdxs = []int32{
2, // 0: authentication.AuthTokens.accessToken:type_name -> authentication.AuthJWT
2, // 1: authentication.AuthTokens.idToken:type_name -> authentication.AuthJWT
0, // 2: authentication.AuthTokens.refreshToken:type_name -> authentication.AuthToken
1, // 3: authentication.Authentication.GetTokens:input_type -> authentication.AuthCode
0, // 4: authentication.Authentication.RefreshTokens:input_type -> authentication.AuthToken
0, // 5: authentication.Authentication.VerifyToken:input_type -> authentication.AuthToken
3, // 6: authentication.Authentication.GetTokens:output_type -> authentication.AuthTokens
3, // 7: authentication.Authentication.RefreshTokens:output_type -> authentication.AuthTokens
4, // 8: authentication.Authentication.VerifyToken:output_type -> authentication.ValidationResult
6, // [6:9] is the sub-list for method output_type
3, // [3:6] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_protobufs_authentication_proto_init() }
func file_protobufs_authentication_proto_init() {
if File_protobufs_authentication_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_protobufs_authentication_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthToken); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protobufs_authentication_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthCode); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protobufs_authentication_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthJWT); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protobufs_authentication_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthTokens); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protobufs_authentication_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ValidationResult); 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_protobufs_authentication_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_protobufs_authentication_proto_goTypes,
DependencyIndexes: file_protobufs_authentication_proto_depIdxs,
MessageInfos: file_protobufs_authentication_proto_msgTypes,
}.Build()
File_protobufs_authentication_proto = out.File
file_protobufs_authentication_proto_rawDesc = nil
file_protobufs_authentication_proto_goTypes = nil
file_protobufs_authentication_proto_depIdxs = nil
}

View File

@@ -0,0 +1,173 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package authentication
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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// AuthenticationClient is the client API for Authentication 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.
type AuthenticationClient interface {
GetTokens(ctx context.Context, in *AuthCode, opts ...grpc.CallOption) (*AuthTokens, error)
RefreshTokens(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*AuthTokens, error)
VerifyToken(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*ValidationResult, error)
}
type authenticationClient struct {
cc grpc.ClientConnInterface
}
func NewAuthenticationClient(cc grpc.ClientConnInterface) AuthenticationClient {
return &authenticationClient{cc}
}
func (c *authenticationClient) GetTokens(ctx context.Context, in *AuthCode, opts ...grpc.CallOption) (*AuthTokens, error) {
out := new(AuthTokens)
err := c.cc.Invoke(ctx, "/authentication.Authentication/GetTokens", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authenticationClient) RefreshTokens(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*AuthTokens, error) {
out := new(AuthTokens)
err := c.cc.Invoke(ctx, "/authentication.Authentication/RefreshTokens", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authenticationClient) VerifyToken(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*ValidationResult, error) {
out := new(ValidationResult)
err := c.cc.Invoke(ctx, "/authentication.Authentication/VerifyToken", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthenticationServer is the server API for Authentication service.
// All implementations must embed UnimplementedAuthenticationServer
// for forward compatibility
type AuthenticationServer interface {
GetTokens(context.Context, *AuthCode) (*AuthTokens, error)
RefreshTokens(context.Context, *AuthToken) (*AuthTokens, error)
VerifyToken(context.Context, *AuthToken) (*ValidationResult, error)
mustEmbedUnimplementedAuthenticationServer()
}
// UnimplementedAuthenticationServer must be embedded to have forward compatible implementations.
type UnimplementedAuthenticationServer struct {
}
func (UnimplementedAuthenticationServer) GetTokens(context.Context, *AuthCode) (*AuthTokens, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTokens not implemented")
}
func (UnimplementedAuthenticationServer) RefreshTokens(context.Context, *AuthToken) (*AuthTokens, error) {
return nil, status.Errorf(codes.Unimplemented, "method RefreshTokens not implemented")
}
func (UnimplementedAuthenticationServer) VerifyToken(context.Context, *AuthToken) (*ValidationResult, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyToken not implemented")
}
func (UnimplementedAuthenticationServer) mustEmbedUnimplementedAuthenticationServer() {}
// UnsafeAuthenticationServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthenticationServer will
// result in compilation errors.
type UnsafeAuthenticationServer interface {
mustEmbedUnimplementedAuthenticationServer()
}
func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer) {
s.RegisterService(&Authentication_ServiceDesc, srv)
}
func _Authentication_GetTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthCode)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthenticationServer).GetTokens(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/authentication.Authentication/GetTokens",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthenticationServer).GetTokens(ctx, req.(*AuthCode))
}
return interceptor(ctx, in, info, handler)
}
func _Authentication_RefreshTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthToken)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthenticationServer).RefreshTokens(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/authentication.Authentication/RefreshTokens",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthenticationServer).RefreshTokens(ctx, req.(*AuthToken))
}
return interceptor(ctx, in, info, handler)
}
func _Authentication_VerifyToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthToken)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthenticationServer).VerifyToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/authentication.Authentication/VerifyToken",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthenticationServer).VerifyToken(ctx, req.(*AuthToken))
}
return interceptor(ctx, in, info, handler)
}
// Authentication_ServiceDesc is the grpc.ServiceDesc for Authentication service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Authentication_ServiceDesc = grpc.ServiceDesc{
ServiceName: "authentication.Authentication",
HandlerType: (*AuthenticationServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetTokens",
Handler: _Authentication_GetTokens_Handler,
},
{
MethodName: "RefreshTokens",
Handler: _Authentication_RefreshTokens_Handler,
},
{
MethodName: "VerifyToken",
Handler: _Authentication_VerifyToken_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "protobufs/authentication.proto",
}