Fixes for Directory Sync, company domains and Admin Portal access
Directory Sync, company groups and domains now keep what each change meant, and adding a log stream needs access to the company's trail.
Improved
1- EnterpriseBehaviour change: adding a company log stream or changing one now also needs Activity at Can view, since a stream receives the company's whole trail. Through the company API, POST and PATCH /log-streams now need audit:read as well as streams:write. Testing a stream, rotating its secret and removing it are unchanged.
Fixed
11- EnterpriseThe daily directory reconcile no longer removes someone a directory event changed while it was reading. Before, a person added or reactivated during the run could be blocked from the reconcile's older copy.
- EnterpriseWhen the directory reactivates someone, Directory Sync now lifts only a block it placed itself. A person blocked any other way, by your team in the console for instance, stays blocked until it is lifted by hand.
- EnterpriseWhen a company deletes its directory, everyone it provisioned now loses the workspaces and roles it gave them, even if the first try fails partway: provisioning stays on until the last person is done, so the retry finishes. Before, a failure partway left the rest with that access for good. Deleting one directory group now works the same way.
- EnterpriseUnbinding a workspace from a company now ends the access the company's groups gave to it: people who were in it through a group are taken out, and the workspace leaves the groups. Before, they kept being joined to it at the group's role, even once it was bound to another company, and removing one by hand was undone on the next apply.
- EnterpriseTwo company admins saving groups at about the same time no longer undo each other's change for the people applied late in the run. A re-apply after a change to role mappings likewise reads each person just before applying them, so it no longer gives back a role a directory event or sign-in had just taken away.
- EnterpriseA domain removed in the console no longer comes back at the next sync while WorkOS has yet to delete it; BuildBase keeps retrying the delete. Two syncs of one verification, such as the WorkOS event and the app's own refresh, now announce enterprise.domain_verified once. An update from an older copy no longer drops a domain added since.
- EnterpriseRevoking a company's API keys from two places at once now announces each key once: one enterprise.key_revoked webhook and one trail entry. Deleting a company role now sends enterprise.group_updated for each group it is cleared from.
- EnterpriseWhen a company admin is removed or their company role narrowed, ending their Admin Portal session is now retried for about two hours if WorkOS fails, and a list of setup link holders that cannot be read is checked again rather than taken as nobody. If the session still cannot be ended, the company's trail records enterprise_portal_revoke_failed with the person. Before, one failed call was only logged and the session stayed open.
- SecurityA company's rules for one of its workspaces, keeping outsiders out and stricter session rules, now also hold when the workspace id in a request is written in capital letters. Before, an id spelled that way passed both checks and the workspace was served.
- EnterpriseA token exchange (POST /api/v1/public/token/exchange) that forwards a network's allowed-company-ids header now meets its own refusals first, such as a company that does not let your team sign in as its people. Before, such an exchange answered tenant_restricted and wrote the person's email into another company's trail.
- EnterpriseA workload identity exchange refused with 429 or 503, or for a scope the credential does not give, no longer uses up the workload's token. Retrying with the same token now works, instead of being refused as replayed and written to the company's trail as a replay.