feat: adopt JWT-based svc-facs-auth#53
Open
mukama wants to merge 4 commits intotetherto:developfrom
Open
Conversation
Tokens coming from svc-facs-auth are now HS256-signed JWTs. Adds jwtSecret and lowers ttl to 900s in the config example so the app-node LRU-backed jti denylist (15-min maxAge) fully covers any revocation window. Inlines the permission check in AuthLib via a new _permsMatch helper so a single call collapses from ~4 JWT verifications per write request to 1.
svc-facs-auth#17 keeps the facility's getTokenPerms/tokenHasPerms synchronous in both legacy and JWT modes for backward compat. The await added in the earlier commit was harmless (await of a value is a no-op) but no longer needed — reverting it brings the line back to the main baseline.
Reverts the { superAdmin, write: hasWrite, permissions } destructure
rename back to const perms = await this.getTokenPerms(token) from
main. Access via perms.superAdmin / perms.write / perms.permissions
matches the original style. No behavioural change.
tekwani
reviewed
May 5, 2026
tekwani
approved these changes
May 6, 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.
Opts app-node into svc-facs-auth's new JWT mode by setting
jwtSecretin auth.config.json. Also inlines the permission check in AuthLib via a new_permsMatchhelper so a write request now does one JWT verification instead of several.