From 27e5b886ad9e9e4c0d831162dbae9d9025fb2903 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 6 Mar 2025 11:24:42 -0700 Subject: refactor: use protobuf3 and define twirp service --- bin/api | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin/api') diff --git a/bin/api b/bin/api index 212e31a..15e63b7 100755 --- a/bin/api +++ b/bin/api @@ -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 = ::Ability::Stub.new('localhost:50051', :this_channel_is_insecure) # TODO:: memorize client - reply = client.allowed(AllowRequest.new(subject: "", permission: 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: "")) puts "***" * 10 puts reply.inspect puts "***" * 10 @@ -119,6 +119,7 @@ end if __FILE__ == $0 app = Rack::Builder.new do + use Rack::CommonLogger use Rack::Reloader run API.new end.to_app -- cgit v1.2.3