summaryrefslogtreecommitdiff
path: root/bin/api
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-03-06 13:23:09 -0700
committermo khan <mo@mokhan.ca>2025-03-06 13:23:09 -0700
commit7f1b5e2417ccd79c556177a5382b43ce385f54ae (patch)
tree357e45e89d4f95aeefc3c952d662a467505f2caa /bin/api
parent1faacf8dda27d4eef0a4440deda82326262e0a89 (diff)
refactor: leave shared code in lib folder and move everything else to the service related code
Diffstat (limited to 'bin/api')
-rwxr-xr-xbin/api4
1 files changed, 1 insertions, 3 deletions
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,