From 7f1b5e2417ccd79c556177a5382b43ce385f54ae Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 6 Mar 2025 13:23:09 -0700 Subject: refactor: leave shared code in lib folder and move everything else to the service related code --- bin/api | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bin/api') diff --git a/bin/api b/bin/api index 06500207..3d618a27 100755 --- a/bin/api +++ b/bin/api @@ -21,7 +21,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 'authx' +require 'authx/rpc' $scheme = ENV.fetch("SCHEME", "http") $port = ENV.fetch("PORT", 8284).to_i @@ -95,8 +95,6 @@ class API private def authorized?(request, permission, resource = Organization.new(id: 1)) - # TODO:: Check the JWT for the appropriate claim - # Connect to the Authz RPC endpoint Ability.allowed?(subject, permission, resource) token = request&.get_header('HTTP_AUTHORIZATION')&.split(' ', 2)&.last response = rpc.allowed( subject: token, -- cgit v1.2.3