Skip to content

feat: adopt JWT-based svc-facs-auth#53

Open
mukama wants to merge 4 commits intotetherto:developfrom
mukama:feat/tdebt-13-global-auth
Open

feat: adopt JWT-based svc-facs-auth#53
mukama wants to merge 4 commits intotetherto:developfrom
mukama:feat/tdebt-13-global-auth

Conversation

@mukama
Copy link
Copy Markdown
Contributor

@mukama mukama commented Apr 14, 2026

Opts app-node into svc-facs-auth's new JWT mode by setting jwtSecret in auth.config.json. Also inlines the permission check in AuthLib via a new _permsMatch helper so a write request now does one JWT verification instead of several.

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.
@mukama mukama changed the base branch from main to develop April 14, 2026 20:08
@mukama mukama changed the title feat: adopt JWT-based svc-facs-auth (TDEBT-13) feat: adopt JWT-based svc-facs-auth Apr 14, 2026
mukama added 2 commits April 15, 2026 16:35
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.
Comment thread workers/lib/auth.js Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants