What is the recommended strategy for managing token lifecycles in Sanity Content Lake?
20.5K reputation · 23 May 2021, 21:57 UTC
Sanity utilizes API tokens with granular permission levels—Viewer, Editor, and Administrator—to enforce least-privilege access within the Content Lake. These tokens are tied to the project level and are long-lived by default, bypassing individual user session timeouts.
Because the Sanity backend does not provide a built-in automatic expiration timestamp or a native rotation mechanism, credential invalidation is handled manually via the Management Console. This creates a challenge for teams requiring strict security compliance regarding credential rotation and the mitigation of leaked tokens.
When implementing a least-privilege architecture for automated systems, how should token expiration and rotation be handled to avoid manual overhead? Does Sanity provide a programmatic way to rotate tokens without causing downtime for active API integrations?