summaryrefslogtreecommitdiff
path: root/bin/api
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-03-06 11:24:42 -0700
committermo khan <mo@mokhan.ca>2025-03-06 11:24:42 -0700
commit27e5b886ad9e9e4c0d831162dbae9d9025fb2903 (patch)
tree32c00563a2d93d82dbeefece715a2cbaeba6d41b /bin/api
parent0fb8fe928b9ca6f907d532789038f8b8fdcca42c (diff)
refactor: use protobuf3 and define twirp service
Diffstat (limited to 'bin/api')
-rwxr-xr-xbin/api5
1 files changed, 3 insertions, 2 deletions
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