diff options
| author | mo khan <mo@mokhan.ca> | 2025-03-06 13:23:09 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-03-06 13:23:09 -0700 |
| commit | 7f1b5e2417ccd79c556177a5382b43ce385f54ae (patch) | |
| tree | 357e45e89d4f95aeefc3c952d662a467505f2caa /bin/api | |
| parent | 1faacf8dda27d4eef0a4440deda82326262e0a89 (diff) | |
refactor: leave shared code in lib folder and move everything else to the service related code
Diffstat (limited to 'bin/api')
| -rwxr-xr-x | bin/api | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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, |
