Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-1515

3scale batcher policy doesn't work with OIDC auth mode

    XMLWordPrintable

Details

    • Hide

      Enable OpenID Connect authentication mode and the 3scale Batcher policy. Send a valid request including the JWT to the gateway.

      Show
      Enable OpenID Connect authentication mode and the 3scale Batcher policy. Send a valid request including the JWT to the gateway.
    • +

    Description

      3scale batcher policy should be compatible with all supported authentication modes. When using it with OIDC mode enabled the following error log message can be found:

      Unable to find source-code formatter for language: log. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      [error] 28#28: *2706 lua entry thread aborted: runtime error: ...rc/src/apicast/policy/3scale_batcher/reports_batcher.lua:94: attempt to index local 'report' (a nil value)
      stack traceback:
      coroutine 0:
      	...rc/src/apicast/policy/3scale_batcher/reports_batcher.lua: in function 'get_all'
      	...src/src/apicast/policy/3scale_batcher/3scale_batcher.lua:83: in function 'func'
      	/opt/app-root/src/src/resty/concurrent/timer_task.lua:71: in function 'run_periodic'
      	/opt/app-root/src/src/resty/concurrent/timer_task.lua:85: in function </opt/app-root/src/src/resty/concurrent/timer_task.lua:84>
      

      This is due to the regex not including the following pattern:

      "service_id:(?<service_id>[\\w-]+),app_id:(?<app_id>[\\w-]+),metric:(?<metric>[\\w-]+)"
      

      This is a valid use case for calls to the /oauth_authrep endpoint which only require the app_id credential and in OIDC mode is the only credential extracted from the JWT.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rhn-support-keprice Kevin Price
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: