You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "caibirdme (via GitHub)" <gi...@apache.org> on 2023/04/06 14:50:15 UTC

[GitHub] [apisix] caibirdme opened a new issue, #9257: forward-auth support setting custom response status_code

caibirdme opened a new issue, #9257:
URL: https://github.com/apache/apisix/issues/9257

   ### Description
   
   forward-auth plugin checks the status_code responded from external service, if it's not 2xx, it aborts the request and return the response(and the responded status_code from external service) to the client. But there're two cases that cannot be 
    well handled by forward-auth:
   1. the external auth service returns **200** + `{"status": -1001, "msg":"invalid token"}`
   2. the external auth service returns **4xx** + `{"status": -1001, "msg":"invalid token"}`, but the api calling convention between client and service states that the api will always return **200** + json
   
   To fully solve this problems, we need support custom judgement logic, something like:
   ```yaml
   only_2xx: true
   check_json_body: "$.status != -1001"
   success_status_code: 200 # no matter what apisix receive from auth service, return 200 to client if passed the checking
   fail_status_code: 200 # ... 
   ```
   
   Supporting check_json_body expression is a little bit complicated, especially for deeply nested json and multiple conditions(a and b or c or d ...).
   Maybe support only_2xx + success_status_code + fail_status_code is more feasible.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9257: forward-auth support setting custom response status_code

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9257:
URL: https://github.com/apache/apisix/issues/9257#issuecomment-1504815710

   welcome to PR 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] forward-auth support setting custom response status_code [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #9257:
URL: https://github.com/apache/apisix/issues/9257#issuecomment-2022369666

   This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] forward-auth support setting custom response status_code [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #9257:
URL: https://github.com/apache/apisix/issues/9257#issuecomment-2047109115

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] forward-auth support setting custom response status_code [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #9257: forward-auth support setting custom response status_code
URL: https://github.com/apache/apisix/issues/9257


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org