test: add missing regression coverage for data-mask and saml-auth#13684
Open
shreemaan-abhishek wants to merge 1 commit into
Open
test: add missing regression coverage for data-mask and saml-auth#13684shreemaan-abhishek wants to merge 1 commit into
shreemaan-abhishek wants to merge 1 commit into
Conversation
Both cases are already-supported behavior that no test exercised. data-mask: the plugin handles multi-value query parameters (a table-valued arg, apisix/plugins/data-mask.lua:124-137) and skips the regex action for a non-string JSON field instead of crashing (:190-199). Neither path had a test. Adds four blocks covering both, renumbering the existing access-log tests to TEST 19/20. saml-auth: the HTTP-POST binding was only covered by schema validation; the end-to-end login, single-logout, wrong-callback and login-failure flows ran only against the default HTTP-Redirect binding. Adds saml-auth-post.t, which uses the existing t/lib/keycloak_saml.lua helper and the apisix_keycloak_saml CI service.
AlinsRan
approved these changes
Jul 10, 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
Adds regression tests for two behaviors that APISIX already implements but that no test exercises. Both are pure test additions; no plugin or schema code changes.
data-mask-apisix/plugins/data-mask.luahandles two edge cases that are currently untested:regexaction is applied per entry (data-mask.lua:124-137);regexaction (data-mask.lua:190-199).This adds four blocks covering both paths (multi-value masking, and regex-skipped-without-crash). The existing access-log tests move from TEST 15/16 to TEST 19/20; they are unchanged otherwise.
saml-auth-auth_protocol_binding_method = "HTTP-POST"is currently only reached by schema-validation tests (t/plugin/saml-auth.tTEST 4 and TEST 7). The integration tests all run the default HTTP-Redirect binding, so the POST binding has no end-to-end coverage.This adds
t/plugin/saml-auth-post.twith six blocks: login and logout, single logout across two service providers, a wronglogin_callback_uri, and a failed login. It reuses the existingt/lib/keycloak_saml.luahelper (no changes needed - it already implements the HTTP-POST branch) and theapisix_keycloak_samlservice thatci/pod/docker-compose.plugin.ymlandci/init-plugin-test-service.shalready start and configure.Which issue(s) this PR fixes
Not tied to a GitHub issue. Both gaps were found while comparing test coverage between APISIX and a downstream fork; the code being tested is upstream's and is already correct.
Checklist
Verification
prove -I. t/plugin/data-mask.t- the four new blocks (TEST 15-18) pass, and the renumbered access-log blocks are unchanged.t/plugin/saml-auth-post.tis an integration test and runs against theapisix_keycloak_samlservice configured byci/kcadm_configure_saml.sh; it relies on127.0.0.2resolving to loopback, as several existing plugin tests already do.