Function: generateWorkspaceScopeName()
function generateWorkspaceScopeName(workspaceName): string;
Defined in: src/iam/scope-name.ts:25
Generate a workspace scope name the way Strata Cloud Manager does: ws_<name>_<suffix>, where
<name> is the workspace display name lower-cased with every non-alphanumeric run collapsed to
_, and <suffix> is six random lowercase alphanumerics.
Scope names are tenant-unique and immutable, so the suffix keeps repeated display names
(Production, production, Production 2) from colliding without a lookup.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspaceName | string | The workspace display name the scope will grant access to. |
Returns
string
A fresh scope name. Pure apart from the random suffix; never contacts SCM.
Example
import { generateWorkspaceScopeName } from '@cdot65/prisma-airs-sdk';
generateWorkspaceScopeName('Truffles'); // => 'ws_truffles_k3x9qa'
generateWorkspaceScopeName('Recipe Gen (EU)'); // => 'ws_recipe_gen_eu_7mz01b'