- Restructure handlers into file_commands/file_queries/file_handlers - Add gRPC auth client, JWT middleware, rate limiting, request ID - Add common utilities: logger, sanitizer, s3_errors - Add unit tests for config, mediator, auth, request_id, sanitize - Add proto definitions and generated code - Remove old web UI pages - Add .dockerignore and .env.example
357 lines
10 KiB
Go
357 lines
10 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.11
|
|
// protoc (unknown)
|
|
// source: auth.proto
|
|
|
|
package proto
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
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 ValidateTokenRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ValidateTokenRequest) Reset() {
|
|
*x = ValidateTokenRequest{}
|
|
mi := &file_auth_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ValidateTokenRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ValidateTokenRequest) ProtoMessage() {}
|
|
|
|
func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_auth_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ValidateTokenRequest.ProtoReflect.Descriptor instead.
|
|
func (*ValidateTokenRequest) Descriptor() ([]byte, []int) {
|
|
return file_auth_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *ValidateTokenRequest) GetToken() string {
|
|
if x != nil {
|
|
return x.Token
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ValidateTokenResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"`
|
|
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
|
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
|
|
Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"`
|
|
Roles []string `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles,omitempty"`
|
|
Permissions []string `protobuf:"bytes,6,rep,name=permissions,proto3" json:"permissions,omitempty"`
|
|
ExpiresAt int64 `protobuf:"varint,7,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) Reset() {
|
|
*x = ValidateTokenResponse{}
|
|
mi := &file_auth_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*ValidateTokenResponse) ProtoMessage() {}
|
|
|
|
func (x *ValidateTokenResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_auth_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use ValidateTokenResponse.ProtoReflect.Descriptor instead.
|
|
func (*ValidateTokenResponse) Descriptor() ([]byte, []int) {
|
|
return file_auth_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) GetValid() bool {
|
|
if x != nil {
|
|
return x.Valid
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) GetUserId() string {
|
|
if x != nil {
|
|
return x.UserId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) GetUsername() string {
|
|
if x != nil {
|
|
return x.Username
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) GetEmail() string {
|
|
if x != nil {
|
|
return x.Email
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) GetRoles() []string {
|
|
if x != nil {
|
|
return x.Roles
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) GetPermissions() []string {
|
|
if x != nil {
|
|
return x.Permissions
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *ValidateTokenResponse) GetExpiresAt() int64 {
|
|
if x != nil {
|
|
return x.ExpiresAt
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type CheckPermissionRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
|
Permission string `protobuf:"bytes,2,opt,name=permission,proto3" json:"permission,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *CheckPermissionRequest) Reset() {
|
|
*x = CheckPermissionRequest{}
|
|
mi := &file_auth_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *CheckPermissionRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*CheckPermissionRequest) ProtoMessage() {}
|
|
|
|
func (x *CheckPermissionRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_auth_proto_msgTypes[2]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use CheckPermissionRequest.ProtoReflect.Descriptor instead.
|
|
func (*CheckPermissionRequest) Descriptor() ([]byte, []int) {
|
|
return file_auth_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *CheckPermissionRequest) GetToken() string {
|
|
if x != nil {
|
|
return x.Token
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *CheckPermissionRequest) GetPermission() string {
|
|
if x != nil {
|
|
return x.Permission
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type CheckPermissionResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Allowed bool `protobuf:"varint,1,opt,name=allowed,proto3" json:"allowed,omitempty"`
|
|
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
|
Roles []string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *CheckPermissionResponse) Reset() {
|
|
*x = CheckPermissionResponse{}
|
|
mi := &file_auth_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *CheckPermissionResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*CheckPermissionResponse) ProtoMessage() {}
|
|
|
|
func (x *CheckPermissionResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_auth_proto_msgTypes[3]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use CheckPermissionResponse.ProtoReflect.Descriptor instead.
|
|
func (*CheckPermissionResponse) Descriptor() ([]byte, []int) {
|
|
return file_auth_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *CheckPermissionResponse) GetAllowed() bool {
|
|
if x != nil {
|
|
return x.Allowed
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *CheckPermissionResponse) GetUserId() string {
|
|
if x != nil {
|
|
return x.UserId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *CheckPermissionResponse) GetRoles() []string {
|
|
if x != nil {
|
|
return x.Roles
|
|
}
|
|
return nil
|
|
}
|
|
|
|
var File_auth_proto protoreflect.FileDescriptor
|
|
|
|
const file_auth_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\n" +
|
|
"auth.proto\x12\x04auth\",\n" +
|
|
"\x14ValidateTokenRequest\x12\x14\n" +
|
|
"\x05token\x18\x01 \x01(\tR\x05token\"\xcf\x01\n" +
|
|
"\x15ValidateTokenResponse\x12\x14\n" +
|
|
"\x05valid\x18\x01 \x01(\bR\x05valid\x12\x17\n" +
|
|
"\auser_id\x18\x02 \x01(\tR\x06userId\x12\x1a\n" +
|
|
"\busername\x18\x03 \x01(\tR\busername\x12\x14\n" +
|
|
"\x05email\x18\x04 \x01(\tR\x05email\x12\x14\n" +
|
|
"\x05roles\x18\x05 \x03(\tR\x05roles\x12 \n" +
|
|
"\vpermissions\x18\x06 \x03(\tR\vpermissions\x12\x1d\n" +
|
|
"\n" +
|
|
"expires_at\x18\a \x01(\x03R\texpiresAt\"N\n" +
|
|
"\x16CheckPermissionRequest\x12\x14\n" +
|
|
"\x05token\x18\x01 \x01(\tR\x05token\x12\x1e\n" +
|
|
"\n" +
|
|
"permission\x18\x02 \x01(\tR\n" +
|
|
"permission\"b\n" +
|
|
"\x17CheckPermissionResponse\x12\x18\n" +
|
|
"\aallowed\x18\x01 \x01(\bR\aallowed\x12\x17\n" +
|
|
"\auser_id\x18\x02 \x01(\tR\x06userId\x12\x14\n" +
|
|
"\x05roles\x18\x03 \x03(\tR\x05roles2\xa7\x01\n" +
|
|
"\vAuthService\x12H\n" +
|
|
"\rValidateToken\x12\x1a.auth.ValidateTokenRequest\x1a\x1b.auth.ValidateTokenResponse\x12N\n" +
|
|
"\x0fCheckPermission\x12\x1c.auth.CheckPermissionRequest\x1a\x1d.auth.CheckPermissionResponseB`\n" +
|
|
"\bcom.authB\tAuthProtoP\x01Z\x19rag/file-system/api/proto\xa2\x02\x03AXX\xaa\x02\x04Auth\xca\x02\x04Auth\xe2\x02\x10Auth\\GPBMetadata\xea\x02\x04Authb\x06proto3"
|
|
|
|
var (
|
|
file_auth_proto_rawDescOnce sync.Once
|
|
file_auth_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_auth_proto_rawDescGZIP() []byte {
|
|
file_auth_proto_rawDescOnce.Do(func() {
|
|
file_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_auth_proto_rawDesc), len(file_auth_proto_rawDesc)))
|
|
})
|
|
return file_auth_proto_rawDescData
|
|
}
|
|
|
|
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
|
var file_auth_proto_goTypes = []any{
|
|
(*ValidateTokenRequest)(nil), // 0: auth.ValidateTokenRequest
|
|
(*ValidateTokenResponse)(nil), // 1: auth.ValidateTokenResponse
|
|
(*CheckPermissionRequest)(nil), // 2: auth.CheckPermissionRequest
|
|
(*CheckPermissionResponse)(nil), // 3: auth.CheckPermissionResponse
|
|
}
|
|
var file_auth_proto_depIdxs = []int32{
|
|
0, // 0: auth.AuthService.ValidateToken:input_type -> auth.ValidateTokenRequest
|
|
2, // 1: auth.AuthService.CheckPermission:input_type -> auth.CheckPermissionRequest
|
|
1, // 2: auth.AuthService.ValidateToken:output_type -> auth.ValidateTokenResponse
|
|
3, // 3: auth.AuthService.CheckPermission:output_type -> auth.CheckPermissionResponse
|
|
2, // [2:4] is the sub-list for method output_type
|
|
0, // [0:2] is the sub-list for method input_type
|
|
0, // [0:0] is the sub-list for extension type_name
|
|
0, // [0:0] is the sub-list for extension extendee
|
|
0, // [0:0] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_auth_proto_init() }
|
|
func file_auth_proto_init() {
|
|
if File_auth_proto != nil {
|
|
return
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_auth_proto_rawDesc), len(file_auth_proto_rawDesc)),
|
|
NumEnums: 0,
|
|
NumMessages: 4,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_auth_proto_goTypes,
|
|
DependencyIndexes: file_auth_proto_depIdxs,
|
|
MessageInfos: file_auth_proto_msgTypes,
|
|
}.Build()
|
|
File_auth_proto = out.File
|
|
file_auth_proto_goTypes = nil
|
|
file_auth_proto_depIdxs = nil
|
|
}
|