You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(serenity): mint dedicated Semrush IMS token for member-add instead of caller token
The /serenity/members grant is now authenticated by a token minted for a dedicated
Semrush IMS technical account (SEMRUSH_IMS_TECH_ID/SECRET, client_credentials) rather
than the calling user's IMS token. This lets the "user hits 401/403 → provision them"
flow add a user who is not yet a member of the workspace: the mint identity holds the
member-management rights, the end user need not.
- add src/support/serenity/semrush-ims-token.js: mintSemrushImsToken(env, log) —
client_credentials mint; token endpoint host from IMS_HOST; scope override via
SEMRUSH_IMS_TECH_SCOPE; 503 on missing config, 502 on IMS failure; never logs secrets.
- controllers/serenity.js addMembers: org-level authorize + validation first, THEN mint
the dedicated token, THEN call the transport (no more caller/promise-token path here).
- rest-transport addWorkspaceMembers doc updated (bearer = minted dedicated IMS token).
- tests: mint unit tests + addMembers uses-minted-token / mint-after-gate / mint-config
failure; .env.example documents the new vars.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments