Use external Kong-Role and add end-to-end IAM integration tests - #2
Merged
Conversation
vtavakkoli
marked this pull request as ready for review
July 30, 2026 21:07
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.
Summary
Replace the duplicated local Kong/OIDC implementation with the separately maintained
vtavakkoli/Kong-Rolerepository and add a real Keycloak-to-Kong-to-LOB integration test.Gateway changes
f1fdd2e6e9c4b8b58fd0b3b76e67589d18c1abff.kong/Dockerfile, local declarative v1 configuration, and copiedkong/oidcLua modules.gateway/kong.ymlwith Kong-Role 2.0.0 JWT mode.preferred_usernameas the configured principal because this Keycloak 26.2 direct-grant access token omitssub.realm_access.rolesvalue as an authenticated Kong group.lob1-user,lob2-user, andlob3-userwithout synthetic Kong consumers.Integration test
The
integration-testCompose profile:401, denied role403, and allowed route200behavior.Validated matrix:
200; LOB2/LOB3403200; LOB3403200CI result
The complete GitHub Actions Compose integration passed. It built Kong from the remote repository, verified real RS256 Keycloak tokens, propagated multiple roles, enforced every ACL decision, reached the correct LOB services, and exited with code 0.
Upstream fix discovered by the integration
The test exposed that the previous Kong-Role container depended on unstable LuaRocks resolution. The companion Kong-Role PR vendors pinned
lua-resty-openidc,lua-resty-jwt, andlua-resty-hmacruntime files so the image builds reproducibly.Local command
The PR remains draft for review even though the full integration test now passes.