test(openid-connect): stop logout tests from calling live IdPs#13608
Merged
AlinsRan merged 2 commits intoJun 26, 2026
Conversation
TEST 36/38 fetched the discovery document from the live samples.auth0.com / accounts.google.com endpoints. On CI runners that cannot validate the upstream TLS certificate this fails deterministically: accessing discovery url (https://samples.auth0.com/.well-known/openid-configuration) failed: 20: unable to get local issuer certificate Point both tests at the in-tree mock discovery served on 127.0.0.1:1980 so the logout flow is exercised without any external dependency: - TEST 36 keeps using the existing discovery document (no end_session_endpoint) and covers the redirect_after_logout_uri path. - TEST 38 uses a new mock that advertises an end_session_endpoint and covers the end_session_endpoint path, which was previously untested. Also fix the assertions: `string.find(loc, ...) ~= -1` is always true (find returns nil or a number, never -1), so the redirect target was never actually validated. They now unescape the Location header and match with a plain-text find.
nic-6443
approved these changes
Jun 26, 2026
membphis
approved these changes
Jun 26, 2026
shreemaan-abhishek
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
t/plugin/openid-connect.tTEST 36 and TEST 38 fetch the OIDC discoverydocument from the live
samples.auth0.com/accounts.google.comendpoints. On CI runners that cannot validate the upstream TLS certificate
this fails deterministically (it is environmental, reruns do not help):
Example failure (linux_openresty
t/plugin/[l-z]*.tbucket):https://github.com/apache/apisix/actions/runs/28147860875/job/83374909107
This PR removes the external dependency by pointing both tests at the in-tree
mock discovery already served on
127.0.0.1:1980, so the logout flow isexercised entirely locally:
end_session_endpoint) and covers theredirect_after_logout_uripath.end_session_endpoint, covering theend_session_endpointpath which waspreviously not tested at all.
It also fixes the assertions. The old checks used
string.find(location, ...) ~= -1, which is always true (string.findreturns
nilor a number, never-1), so the redirect target was neveractually validated — and
string.findwas treating the expected value as aLua pattern. The assertions now unescape the
Locationheader and match witha plain-text
find, so they verify the real redirect (including thepercent-encoded
post_logout_redirect_uri).Checklist