diff options
| author | mo khan <mo@mokhan.ca> | 2025-03-06 11:24:42 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-03-06 11:24:42 -0700 |
| commit | 27e5b886ad9e9e4c0d831162dbae9d9025fb2903 (patch) | |
| tree | 32c00563a2d93d82dbeefece715a2cbaeba6d41b /bin/api | |
| parent | 0fb8fe928b9ca6f907d532789038f8b8fdcca42c (diff) | |
refactor: use protobuf3 and define twirp service
Diffstat (limited to 'bin/api')
| -rwxr-xr-x | bin/api | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |
