Week-6, 7, 8
Catching Up: Architecture, Security, and Concurrency in the Heka Auth Service Hey everyone! First of all, I want to start with a huge apology for the radio silence over the last couple of weeks. My schedule has been absolutely packed, and between deep-diving into code and keeping up with project deliverables, I haven't had a spare moment to sit down and share my progress. But I’m back, and I have…
This week has been incredibly productive for the Hiero (LF Decentralized Trust) Heka Identity Platform. The main focus was on two significant PRs: the GPG Contributor Verification Flow and the GitHub OAuth Binding. These projects led to valuable lessons in software architecture, security hardening, and CI pipeline navigation.
Key architectural improvements included strict separation of concerns, moving all GitHub OAuth and GPG challenge flows into the heka-auth-service. The database now relies solely on MikroORM migrations generated directly within the auth service.
Security was a major priority, with several vulnerabilities patched: SSRF attacks prevented by strict username validation, JWT authentication implemented for challenge request endpoints, and payload abuse mitigated by adding maximum length validations to GPG signature DTOs. Additionally, log sanitization was introduced to prevent log injection attacks.
Handling concurrency was a notable challenge. To address race conditions related to GPG challenges, an atomic burn-before-verify pattern was implemented using MikroORM's nativeUpdate. This ensures that only one request successfully updates the consumed status, blocking any replay attacks.
Finally, CI pipeline issues were resolved by fixing a lockfile desync and an outdated dependency issue caused by express@5 pulling in a vulnerable version of body-parser. The package.json now explicitly declares body-parser ^2.3.0, clearing the Snyk check.
Overall, this week highlighted that feature development accounts for only 20% of the work, while the remaining 80% focuses on architecture, concurrency, security, and infrastructure. The heka-auth-service is now significantly more robust and secure.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.