test: decode baseline tests and CI fixes - #34
Conversation
Add t/decode.t, which decodes LDAP responses through a shim that resolves to the current rasn decoder and will re-point at the pure-Lua decoder once it lands, establishing a behavioral baseline against the shipping implementation. Refresh the slapd cert (expired 2023) and fix the CI workflow (runner image, OpenLDAP image, readiness check).
📝 WalkthroughWalkthroughAdds LDAP decoding helpers and comprehensive Test::Nginx coverage, refreshes the certificate fixture, and modernizes CI dependency installation with active OpenLDAP readiness checks. ChangesLDAP decoding test integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
17-17: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winAvoid persisting the checkout token for the test step.
make testexecutes repository code after checkout. Disable credential persistence unless a later step needs authenticated Git access.actions/checkoutdocumentspersist-credentials: falseas the opt-out. (github.com)Suggested change
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml at line 17, Update the actions/checkout step in the CI workflow to set persist-credentials to false, ensuring the checkout token is not retained for the subsequent make test step. Keep the existing pinned checkout action reference unchanged.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/ci.yml:
- Line 17: Update the actions/checkout step in the CI workflow to set
persist-credentials to false, ensuring the checkout token is not retained for
the subsequent make test step. Keep the existing pinned checkout action
reference unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 588efa27-7e79-46f2-9e9f-780f51d5f0e2
⛔ Files ignored due to path filters (2)
t/certs/localhost_slapd_cert.pemis excluded by!**/*.pemt/certs/localhost_slapd_key.pemis excluded by!**/*.pem
📒 Files selected for processing (6)
.github/workflows/ci.yml.gitignoret/certs/mycacert.crtt/decode.tt/lib/ldap_decode.luat/lib/ldap_hex.lua
The bitnamilegacy OpenLDAP image seeds ou=groups alongside ou=users, so single-level search returns 2 (not 1) and whole-subtree returns 6 (not 5, which was the old bitnami/openldap:2.6 count). Verified against bitnamilegacy/openldap:2.6.10-debian-12-r4.
TEST 4 asserted 2 results but only checked res[1]; verify res[2] too so both immediate children under the base are covered.
Splits #32 into 3 stacked, independently-reviewable PRs. This is 1/3.
1/3 — decode baseline + CI (this PR, ~160 LoC + cert regen)
Fix CI (retired runner, moved OpenLDAP image, slapd cert expired 2023) and add
t/decode.t, which checks decode output against the currentrasndecoder through a shim that re-points at the pure-Lua decoder once it lands. No production code changed.2/3 — pure-Lua decoder, additive (~4,300 LoC: ~510 code / ~3,800 tests)
Add
asn1.decode/protocol.decode_message+ unit and hardening tests. Nothing calls it yet —rasnstill decodes — so the parser is reviewed in isolation.3/3 — cutover, drop Rust, features (~1,400 added / ~250 deleted)
Switch the client to the pure-Lua decoder, remove the Rust toolchain, ship the builtin rockspec; add the pinned-connection session, RFC 4515 filter escaping, and
resty.ldapcompat. Thet/decode.tbaseline then runs against the new decoder and proves it matches the old one.