feat(auth): Complete Auth Service implementation and fix Consul health checks
- Add VerifyPassword RPC to Identity Service - Added to proto file and generated code - Implemented in Identity Service gRPC server - Added to Identity Service client interface and gRPC client - Complete RefreshToken implementation - Store refresh tokens in database using RefreshToken entity - Validate refresh tokens with expiration checking - Revoke refresh tokens on logout and token rotation - Integrate Authz Service for role retrieval - Added AuthzServiceClient to Auth Service - Get user roles during login and token refresh - Gracefully handle Authz Service failures - Require JWT secret in configuration - Removed default secret fallback - Service fails to start if JWT secret is not configured - Fix Consul health checks for Docker - Services now register with Docker service names (e.g., audit-service) - Allows Consul (in Docker) to reach services via Docker DNS - Health checks use gRPC service names instead of localhost This completes all TODOs in auth_service_fx.go and fixes the Consul health check failures in Docker environments.
This commit is contained in:
658
api/proto/generated/authz.pb.go
Normal file
658
api/proto/generated/authz.pb.go
Normal file
@@ -0,0 +1,658 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.10
|
||||
// protoc v6.30.2
|
||||
// source: authz.proto
|
||||
|
||||
package authzv1
|
||||
|
||||
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)
|
||||
)
|
||||
|
||||
// Permission represents a permission in the system.
|
||||
type Permission struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Permission) Reset() {
|
||||
*x = Permission{}
|
||||
mi := &file_authz_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Permission) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Permission) ProtoMessage() {}
|
||||
|
||||
func (x *Permission) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_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 Permission.ProtoReflect.Descriptor instead.
|
||||
func (*Permission) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Permission) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Permission) GetCode() string {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Permission) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Permission) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Role represents a role in the system.
|
||||
type Role struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Permissions []string `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"` // Permission codes
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Role) Reset() {
|
||||
*x = Role{}
|
||||
mi := &file_authz_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Role) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Role) ProtoMessage() {}
|
||||
|
||||
func (x *Role) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_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 Role.ProtoReflect.Descriptor instead.
|
||||
func (*Role) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Role) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Role) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Role) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Role) GetPermissions() []string {
|
||||
if x != nil {
|
||||
return x.Permissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// AuthorizeRequest contains user ID and permission to check.
|
||||
type AuthorizeRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Permission string `protobuf:"bytes,2,opt,name=permission,proto3" json:"permission,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AuthorizeRequest) Reset() {
|
||||
*x = AuthorizeRequest{}
|
||||
mi := &file_authz_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AuthorizeRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AuthorizeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AuthorizeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_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 AuthorizeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AuthorizeRequest) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *AuthorizeRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AuthorizeRequest) GetPermission() string {
|
||||
if x != nil {
|
||||
return x.Permission
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// AuthorizeResponse indicates authorization result.
|
||||
type AuthorizeResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"`
|
||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AuthorizeResponse) Reset() {
|
||||
*x = AuthorizeResponse{}
|
||||
mi := &file_authz_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AuthorizeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AuthorizeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *AuthorizeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_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 AuthorizeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*AuthorizeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *AuthorizeResponse) GetAuthorized() bool {
|
||||
if x != nil {
|
||||
return x.Authorized
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AuthorizeResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// HasPermissionRequest contains user ID and permission to check.
|
||||
type HasPermissionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Permission string `protobuf:"bytes,2,opt,name=permission,proto3" json:"permission,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *HasPermissionRequest) Reset() {
|
||||
*x = HasPermissionRequest{}
|
||||
mi := &file_authz_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *HasPermissionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HasPermissionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *HasPermissionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_proto_msgTypes[4]
|
||||
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 HasPermissionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*HasPermissionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *HasPermissionRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HasPermissionRequest) GetPermission() string {
|
||||
if x != nil {
|
||||
return x.Permission
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// HasPermissionResponse indicates if the user has the permission.
|
||||
type HasPermissionResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
HasPermission bool `protobuf:"varint,1,opt,name=has_permission,json=hasPermission,proto3" json:"has_permission,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *HasPermissionResponse) Reset() {
|
||||
*x = HasPermissionResponse{}
|
||||
mi := &file_authz_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *HasPermissionResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HasPermissionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *HasPermissionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_proto_msgTypes[5]
|
||||
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 HasPermissionResponse.ProtoReflect.Descriptor instead.
|
||||
func (*HasPermissionResponse) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *HasPermissionResponse) GetHasPermission() bool {
|
||||
if x != nil {
|
||||
return x.HasPermission
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetUserPermissionsRequest contains a user ID.
|
||||
type GetUserPermissionsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetUserPermissionsRequest) Reset() {
|
||||
*x = GetUserPermissionsRequest{}
|
||||
mi := &file_authz_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetUserPermissionsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetUserPermissionsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetUserPermissionsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_proto_msgTypes[6]
|
||||
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 GetUserPermissionsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetUserPermissionsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *GetUserPermissionsRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetUserPermissionsResponse contains all permissions for the user.
|
||||
type GetUserPermissionsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Permissions []*Permission `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetUserPermissionsResponse) Reset() {
|
||||
*x = GetUserPermissionsResponse{}
|
||||
mi := &file_authz_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetUserPermissionsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetUserPermissionsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetUserPermissionsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_proto_msgTypes[7]
|
||||
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 GetUserPermissionsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetUserPermissionsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *GetUserPermissionsResponse) GetPermissions() []*Permission {
|
||||
if x != nil {
|
||||
return x.Permissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetUserRolesRequest contains a user ID.
|
||||
type GetUserRolesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetUserRolesRequest) Reset() {
|
||||
*x = GetUserRolesRequest{}
|
||||
mi := &file_authz_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetUserRolesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetUserRolesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetUserRolesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_proto_msgTypes[8]
|
||||
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 GetUserRolesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetUserRolesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *GetUserRolesRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetUserRolesResponse contains all roles for the user.
|
||||
type GetUserRolesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Roles []*Role `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetUserRolesResponse) Reset() {
|
||||
*x = GetUserRolesResponse{}
|
||||
mi := &file_authz_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetUserRolesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetUserRolesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetUserRolesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_authz_proto_msgTypes[9]
|
||||
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 GetUserRolesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetUserRolesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_authz_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *GetUserRolesResponse) GetRoles() []*Role {
|
||||
if x != nil {
|
||||
return x.Roles
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_authz_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_authz_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\vauthz.proto\x12\bauthz.v1\"f\n" +
|
||||
"\n" +
|
||||
"Permission\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||
"\x04code\x18\x02 \x01(\tR\x04code\x12\x12\n" +
|
||||
"\x04name\x18\x03 \x01(\tR\x04name\x12 \n" +
|
||||
"\vdescription\x18\x04 \x01(\tR\vdescription\"n\n" +
|
||||
"\x04Role\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||
"\x04name\x18\x02 \x01(\tR\x04name\x12 \n" +
|
||||
"\vdescription\x18\x03 \x01(\tR\vdescription\x12 \n" +
|
||||
"\vpermissions\x18\x04 \x03(\tR\vpermissions\"K\n" +
|
||||
"\x10AuthorizeRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1e\n" +
|
||||
"\n" +
|
||||
"permission\x18\x02 \x01(\tR\n" +
|
||||
"permission\"M\n" +
|
||||
"\x11AuthorizeResponse\x12\x1e\n" +
|
||||
"\n" +
|
||||
"authorized\x18\x01 \x01(\bR\n" +
|
||||
"authorized\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\"O\n" +
|
||||
"\x14HasPermissionRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1e\n" +
|
||||
"\n" +
|
||||
"permission\x18\x02 \x01(\tR\n" +
|
||||
"permission\">\n" +
|
||||
"\x15HasPermissionResponse\x12%\n" +
|
||||
"\x0ehas_permission\x18\x01 \x01(\bR\rhasPermission\"4\n" +
|
||||
"\x19GetUserPermissionsRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\"T\n" +
|
||||
"\x1aGetUserPermissionsResponse\x126\n" +
|
||||
"\vpermissions\x18\x01 \x03(\v2\x14.authz.v1.PermissionR\vpermissions\".\n" +
|
||||
"\x13GetUserRolesRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\"<\n" +
|
||||
"\x14GetUserRolesResponse\x12$\n" +
|
||||
"\x05roles\x18\x01 \x03(\v2\x0e.authz.v1.RoleR\x05roles2\xd6\x02\n" +
|
||||
"\fAuthzService\x12D\n" +
|
||||
"\tAuthorize\x12\x1a.authz.v1.AuthorizeRequest\x1a\x1b.authz.v1.AuthorizeResponse\x12P\n" +
|
||||
"\rHasPermission\x12\x1e.authz.v1.HasPermissionRequest\x1a\x1f.authz.v1.HasPermissionResponse\x12_\n" +
|
||||
"\x12GetUserPermissions\x12#.authz.v1.GetUserPermissionsRequest\x1a$.authz.v1.GetUserPermissionsResponse\x12M\n" +
|
||||
"\fGetUserRoles\x12\x1d.authz.v1.GetUserRolesRequest\x1a\x1e.authz.v1.GetUserRolesResponseBGZEgit.dcentral.systems/toolz/goplt/api/proto/generated/authz/v1;authzv1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_authz_proto_rawDescOnce sync.Once
|
||||
file_authz_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_authz_proto_rawDescGZIP() []byte {
|
||||
file_authz_proto_rawDescOnce.Do(func() {
|
||||
file_authz_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_authz_proto_rawDesc), len(file_authz_proto_rawDesc)))
|
||||
})
|
||||
return file_authz_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_authz_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||
var file_authz_proto_goTypes = []any{
|
||||
(*Permission)(nil), // 0: authz.v1.Permission
|
||||
(*Role)(nil), // 1: authz.v1.Role
|
||||
(*AuthorizeRequest)(nil), // 2: authz.v1.AuthorizeRequest
|
||||
(*AuthorizeResponse)(nil), // 3: authz.v1.AuthorizeResponse
|
||||
(*HasPermissionRequest)(nil), // 4: authz.v1.HasPermissionRequest
|
||||
(*HasPermissionResponse)(nil), // 5: authz.v1.HasPermissionResponse
|
||||
(*GetUserPermissionsRequest)(nil), // 6: authz.v1.GetUserPermissionsRequest
|
||||
(*GetUserPermissionsResponse)(nil), // 7: authz.v1.GetUserPermissionsResponse
|
||||
(*GetUserRolesRequest)(nil), // 8: authz.v1.GetUserRolesRequest
|
||||
(*GetUserRolesResponse)(nil), // 9: authz.v1.GetUserRolesResponse
|
||||
}
|
||||
var file_authz_proto_depIdxs = []int32{
|
||||
0, // 0: authz.v1.GetUserPermissionsResponse.permissions:type_name -> authz.v1.Permission
|
||||
1, // 1: authz.v1.GetUserRolesResponse.roles:type_name -> authz.v1.Role
|
||||
2, // 2: authz.v1.AuthzService.Authorize:input_type -> authz.v1.AuthorizeRequest
|
||||
4, // 3: authz.v1.AuthzService.HasPermission:input_type -> authz.v1.HasPermissionRequest
|
||||
6, // 4: authz.v1.AuthzService.GetUserPermissions:input_type -> authz.v1.GetUserPermissionsRequest
|
||||
8, // 5: authz.v1.AuthzService.GetUserRoles:input_type -> authz.v1.GetUserRolesRequest
|
||||
3, // 6: authz.v1.AuthzService.Authorize:output_type -> authz.v1.AuthorizeResponse
|
||||
5, // 7: authz.v1.AuthzService.HasPermission:output_type -> authz.v1.HasPermissionResponse
|
||||
7, // 8: authz.v1.AuthzService.GetUserPermissions:output_type -> authz.v1.GetUserPermissionsResponse
|
||||
9, // 9: authz.v1.AuthzService.GetUserRoles:output_type -> authz.v1.GetUserRolesResponse
|
||||
6, // [6:10] is the sub-list for method output_type
|
||||
2, // [2:6] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_authz_proto_init() }
|
||||
func file_authz_proto_init() {
|
||||
if File_authz_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_authz_proto_rawDesc), len(file_authz_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 10,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_authz_proto_goTypes,
|
||||
DependencyIndexes: file_authz_proto_depIdxs,
|
||||
MessageInfos: file_authz_proto_msgTypes,
|
||||
}.Build()
|
||||
File_authz_proto = out.File
|
||||
file_authz_proto_goTypes = nil
|
||||
file_authz_proto_depIdxs = nil
|
||||
}
|
||||
Reference in New Issue
Block a user