summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-03-06 11:37:01 -0700
committermo khan <mo@mokhan.ca>2025-03-06 11:37:01 -0700
commitbad76558aca0719db95f5572c7847fd971051186 (patch)
treeac04873ec207edead082cdf8dc4e304c4cde9ad0 /lib
parent27e5b886ad9e9e4c0d831162dbae9d9025fb2903 (diff)
refactor: move protobuf rpc services to lib/authx/rpc
Diffstat (limited to 'lib')
-rw-r--r--lib/ability_pb.rb16
-rw-r--r--lib/ability_services_pb.rb22
-rw-r--r--lib/ability_twirp.rb15
-rw-r--r--lib/authx.rb3
-rw-r--r--lib/authx/rpc.rb4
-rw-r--r--lib/authx/rpc/ability_pb.rb18
-rw-r--r--lib/authx/rpc/ability_services_pb.rb24
-rw-r--r--lib/authx/rpc/ability_twirp.rb17
8 files changed, 66 insertions, 53 deletions
diff --git a/lib/ability_pb.rb b/lib/ability_pb.rb
deleted file mode 100644
index 5929bba7..00000000
--- a/lib/ability_pb.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: ability.proto
-
-require 'google/protobuf'
-
-
-descriptor_data = "\n\rability.proto\x12\x05\x61uthx\"E\n\x0c\x41llowRequest\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\x12\n\npermission\x18\x02 \x01(\t\x12\x10\n\x08resource\x18\x03 \x01(\t\"\x1c\n\nAllowReply\x12\x0e\n\x06result\x18\x01 \x01(\x08\x32>\n\x07\x41\x62ility\x12\x33\n\x07\x41llowed\x12\x13.authx.AllowRequest\x1a\x11.authx.AllowReply\"\x00\x62\x06proto3"
-
-pool = Google::Protobuf::DescriptorPool.generated_pool
-pool.add_serialized_file(descriptor_data)
-
-module Authx
- AllowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authx.AllowRequest").msgclass
- AllowReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authx.AllowReply").msgclass
-end
diff --git a/lib/ability_services_pb.rb b/lib/ability_services_pb.rb
deleted file mode 100644
index ca55ef69..00000000
--- a/lib/ability_services_pb.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# Source: ability.proto for package 'authx'
-
-require 'grpc'
-require 'ability_pb'
-
-module Authx
- module Ability
- class Service
-
- include ::GRPC::GenericService
-
- self.marshal_class_method = :encode
- self.unmarshal_class_method = :decode
- self.service_name = 'authx.Ability'
-
- rpc :Allowed, ::Authx::AllowRequest, ::Authx::AllowReply
- end
-
- Stub = Service.rpc_stub_class
- end
-end
diff --git a/lib/ability_twirp.rb b/lib/ability_twirp.rb
deleted file mode 100644
index 497400e1..00000000
--- a/lib/ability_twirp.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
-require 'twirp'
-require_relative 'ability_pb.rb'
-
-module Authx
- class AbilityService < ::Twirp::Service
- package 'authx'
- service 'Ability'
- rpc :Allowed, AllowRequest, AllowReply, :ruby_method => :allowed
- end
-
- class AbilityClient < ::Twirp::Client
- client_for AbilityService
- end
-end
diff --git a/lib/authx.rb b/lib/authx.rb
new file mode 100644
index 00000000..81bc8ff5
--- /dev/null
+++ b/lib/authx.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+require "authx/rpc"
diff --git a/lib/authx/rpc.rb b/lib/authx/rpc.rb
new file mode 100644
index 00000000..78edbc46
--- /dev/null
+++ b/lib/authx/rpc.rb
@@ -0,0 +1,4 @@
+# frozen_string_literal: true
+
+require "authx/rpc/ability_pb"
+require "authx/rpc/ability_twirp"
diff --git a/lib/authx/rpc/ability_pb.rb b/lib/authx/rpc/ability_pb.rb
new file mode 100644
index 00000000..b360db28
--- /dev/null
+++ b/lib/authx/rpc/ability_pb.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: ability.proto
+
+require 'google/protobuf'
+
+
+descriptor_data = "\n\rability.proto\x12\tauthx.rpc\"E\n\x0c\x41llowRequest\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\x12\n\npermission\x18\x02 \x01(\t\x12\x10\n\x08resource\x18\x03 \x01(\t\"\x1c\n\nAllowReply\x12\x0e\n\x06result\x18\x01 \x01(\x08\x32\x46\n\x07\x41\x62ility\x12;\n\x07\x41llowed\x12\x17.authx.rpc.AllowRequest\x1a\x15.authx.rpc.AllowReply\"\x00\x62\x06proto3"
+
+pool = Google::Protobuf::DescriptorPool.generated_pool
+pool.add_serialized_file(descriptor_data)
+
+module Authx
+ module Rpc
+ AllowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authx.rpc.AllowRequest").msgclass
+ AllowReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("authx.rpc.AllowReply").msgclass
+ end
+end
diff --git a/lib/authx/rpc/ability_services_pb.rb b/lib/authx/rpc/ability_services_pb.rb
new file mode 100644
index 00000000..a6c3b175
--- /dev/null
+++ b/lib/authx/rpc/ability_services_pb.rb
@@ -0,0 +1,24 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# Source: ability.proto for package 'authx.rpc'
+
+require 'grpc'
+require 'ability_pb'
+
+module Authx
+ module Rpc
+ module Ability
+ class Service
+
+ include ::GRPC::GenericService
+
+ self.marshal_class_method = :encode
+ self.unmarshal_class_method = :decode
+ self.service_name = 'authx.rpc.Ability'
+
+ rpc :Allowed, ::Authx::Rpc::AllowRequest, ::Authx::Rpc::AllowReply
+ end
+
+ Stub = Service.rpc_stub_class
+ end
+ end
+end
diff --git a/lib/authx/rpc/ability_twirp.rb b/lib/authx/rpc/ability_twirp.rb
new file mode 100644
index 00000000..120e9a99
--- /dev/null
+++ b/lib/authx/rpc/ability_twirp.rb
@@ -0,0 +1,17 @@
+# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
+require 'twirp'
+require_relative 'ability_pb.rb'
+
+module Authx
+ module Rpc
+ class AbilityService < ::Twirp::Service
+ package 'authx.rpc'
+ service 'Ability'
+ rpc :Allowed, AllowRequest, AllowReply, :ruby_method => :allowed
+ end
+
+ class AbilityClient < ::Twirp::Client
+ client_for AbilityService
+ end
+ end
+end