9.4.2
RESTHeart 9.4.2
This release is primarily a stabilization and hardening pass on the restheart-accounts module, driven by extensive testing against a real, complex production application. That real-world exercise surfaced a number of edge cases in the invite flow, JWT handling, multi-tenancy, and account lifecycle — all now fixed. It also adds a new built-in metrics and monitoring stack.
Hardening of restheart-accounts
Extensive testing on a real complex app drove fixes across the whole module:
Account lifecycle
- Replaced the
statusfield with a roles-based user lifecycle; thestatusfield has been removed from accounts. - Removed consent requirements from account activation.
Invite workflow
- New
accept-inviteendpoint andauth_invitationscollection for inviting existing users. - Invite token storage unified in
auth_invitationsacross all user types. - Refactored invite flow; added ACL and full invitation test coverage; made test setup idempotent to prevent state leakage and handle already-accepted invitations.
- Handle
OPTIONSrequests inAcceptInviteService; fixed email lookup inResendInviteService; team name now derived from memberships.
Team membership
- Added endpoints to remove members and update member roles.
Multi-tenancy
- Tenant IDs changed from
StringtoBsonValueto supportObjectIdtypes, with extended JSON representation. - JWT tenant claim now uses
tenantClaimNamefrom config instead of a hardcodedtenant. MembershipProvider.activeMembership()now used instead of hardcoded tenant-field lookups in email verification, password reset, and resend-invite services.- Added
mclientinjection toSwitchTenantService.
Security & JWT
- Account operations now restricted to the
ownerrole; invite access restricted and role handling updated. - Added
issued-at(iat) claim to issued JWTs. - JWTs now include
authDbandaccount-properties-claims.
Email templates
- Fixed custom mail templates being ignored.
- Fixed variable names in default templates; added responsive email styles.
New: Metrics & Monitoring
- Built-in metrics and monitoring with a real-time dashboard and Prometheus integration (with docs).
- Added metrics static resources and an HTML monitor; requests metrics collector enabled in config.
Other
- Fallback class loader support in
ResourcesExtractorfor plugin resources. - Fixed OAuth error URL construction and added an email-mismatch check for OAuth-with-invite.