diff options
| author | mo khan <mo@mokhan.ca> | 2025-03-06 11:37:01 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-03-06 11:37:01 -0700 |
| commit | bad76558aca0719db95f5572c7847fd971051186 (patch) | |
| tree | ac04873ec207edead082cdf8dc4e304c4cde9ad0 /bin/api | |
| parent | 27e5b886ad9e9e4c0d831162dbae9d9025fb2903 (diff) | |
refactor: move protobuf rpc services to lib/authx/rpc
Diffstat (limited to 'bin/api')
| -rwxr-xr-x | bin/api | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -18,7 +18,7 @@ end lib_path = Pathname.new(__FILE__).parent.parent.join('lib').realpath.to_s $LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path) -require 'ability_services_pb' +require 'authx' GRPC.logger = Logger.new($stderr, level: :debug) $scheme = ENV.fetch("SCHEME", "http") @@ -79,8 +79,8 @@ class API def authorized?(request, permission) # TODO:: Check the JWT for the appropriate claim # Connect to the Authz RPC endpoint Ability.allowed?(subject, permission, resource) - client = ::Authx::Ability::Stub.new('localhost:50051', :this_channel_is_insecure) # TODO:: memorize client - reply = client.allowed(::Authx::AllowRequest.new(subject: "", permission: permission, resource: "")) + client = ::Authx::Rpc::Ability::Stub.new('localhost:50051', :this_channel_is_insecure) # TODO:: memorize client + reply = client.allowed(::Authx::Rpc::AllowRequest.new(subject: "", permission: permission, resource: "")) puts "***" * 10 puts reply.inspect puts "***" * 10 |
