@camunda/ccma-shared-types 18.5.0 → 18.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-tokens/agent-tokens.d.ts +1 -1
- package/dist/agent-tokens/agent-tokens.js.map +1 -1
- package/dist/approvals/expected-value.d.ts +1 -1
- package/dist/approvals/expected-value.js.map +1 -1
- package/dist/approvals/policy.d.ts +1 -1
- package/dist/approvals/policy.js.map +1 -1
- package/dist/approvals/use-cases.const.d.ts +3 -3
- package/dist/approvals/use-cases.const.js.map +1 -1
- package/dist/charts/chart-metrics.js.map +1 -1
- package/dist/charts/chart-spec.js.map +1 -1
- package/dist/constants/direct-route-lock.const.d.ts +2 -2
- package/dist/constants/direct-route-lock.const.js.map +1 -1
- package/dist/constants/tsuga.const.d.ts +5 -0
- package/dist/constants/tsuga.const.js +5 -0
- package/dist/constants/tsuga.const.js.map +7 -0
- package/dist/dtos/ActiveUsers.dto.d.ts +1 -1
- package/dist/dtos/Annotation.dto.d.ts +1 -1
- package/dist/dtos/Annotation.dto.js.map +1 -1
- package/dist/dtos/ApprovalJob.dto.d.ts +1 -1
- package/dist/dtos/ApprovalJob.dto.js.map +1 -1
- package/dist/dtos/ApprovalSummaryNames.dto.d.ts +1 -1
- package/dist/dtos/ControlV2.dto.js.map +1 -1
- package/dist/dtos/Dashboard.dto.d.ts +1 -1
- package/dist/dtos/Dashboard.dto.js.map +1 -1
- package/dist/dtos/ExternalWebapp.dto.d.ts +1 -1
- package/dist/dtos/FeatureFlags.dto.d.ts +2 -2
- package/dist/dtos/FeatureFlags.dto.js.map +1 -1
- package/dist/dtos/Hdp.dto.d.ts +1 -1
- package/dist/dtos/Leaflet.dto.d.ts +7 -1
- package/dist/dtos/M2mTokenCount.dto.d.ts +1 -1
- package/dist/dtos/PermissionHolders.dto.d.ts +1 -1
- package/dist/dtos/PermissionHolders.dto.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +2 -2
- package/dist/permissions/combo.js.map +1 -1
- package/dist/permissions/console.permissions.d.ts +2 -2
- package/dist/permissions/console.permissions.js.map +1 -1
- package/dist/utils/camundiPermissionAugmenter.utils.d.ts +1 -1
- package/dist/utils/camundiPermissionAugmenter.utils.js.map +1 -1
- package/dist/utils/qa-user.utils.d.ts +1 -1
- package/dist/utils/qa-user.utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/permissions/console.permissions.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { Roles } from '../types/Roles.js'\n\nexport namespace ConsolePermissions {\n export const MULTICLUSTER_ADMIN = 'cmca'\n\n export const CHANNELS_AND_GENERATIONS_ADMIN_DELETE_ALL_CLUSTERS = 'cmgda'\n export const CHANNELS_AND_GENERATIONS_ADMIN_SEE = 'cmgas'\n export const CHANNELS_AND_GENERATIONS_ADMIN = 'cmga'\n export const CHANNELS_AND_GENERATIONS_ADMIN_PATCH_EXISTING_CHANNEL = 'cmgap'\n export const CHANNELS_AND_GENERATIONS_ADMIN_MIGRATE = 'cmgam'\n export const CHANNELS_AND_GENERATIONS_MIGRATE = 'cmgm'\n export const ALL_CHANNELS_AND_GENERATIONS: string[] = [\n CHANNELS_AND_GENERATIONS_ADMIN_SEE,\n CHANNELS_AND_GENERATIONS_ADMIN,\n CHANNELS_AND_GENERATIONS_ADMIN_MIGRATE,\n ]\n export const CLUSTERS_READALLCLUSTERINFO = 'ccrai'\n export const CLUSTERS_DELETE_CLUSTER = 'ccda'\n export const CLUSTERS_CAN_MOVE_TO_OTHER_ORG = 'ccmoo'\n export const CLUSTERS_CAN_SEND_TO_SLEEP = 'ccsts'\n export const CLUSTERS_CAN_CREATE_INTERNAL_BACKUP = 'cccib'\n export const CLUSTERS_CAN_UPDATE_CLUSTERPLANTYPE = 'ccucp'\n export const CLUSTERS_CAN_UPDATE_GENERATION = 'ccug'\n export const CLUSTERS_CAN_UPDATE_GENERATION_YOLO = 'ccugy'\n export const CLUSTERS_CAN_UPDATE_OPTIONAL_TELEMETRY = 'ccuot'\n export const CLUSTERS_CAN_UPDATE_ZEEBE_REBALANCING = 'ccuzr'\n\n export const CLUSTER_PLAN_SEE_ALL = 'ccpa'\n export const CLUSTER_PLAN_CREATE = 'ccpc'\n export const CLUSTER_PLAN_DELETE = 'ccpd'\n\n export const CLUSTER_PLAN_TYPE_CREATE = 'cptc'\n export const CLUSTER_PLAN_TYPE_MODIFY = 'cptm'\n export const CLUSTER_PLAN_TYPE_DELETE = 'cptd'\n export const CLUSTER_PLAN_TYPE_FORCE_DELETE = 'cptfd'\n\n export const CLUSTER_PLAN_MIGRATE = 'ccpm'\n export const CLUSTER_PLAN_CAN_MODIFY = 'ccpmo'\n\n export const M2M_UPDATE_CRD = 'cmuc'\n export const M2M_SIGNUP = 'cms'\n export const M2M_TRIGGER_ALERT = 'cmta'\n export const M2M_DELETE_ORG_CLUSTERS = 'cmdoc'\n export const M2M_UPDATE_ORG_CLUSTERS = 'cmuoc'\n export const M2M_ADD_CLUSTER_USAGE_METRICS = 'cmacm'\n export const M2M_SEND_SSE_EVENT = 'cmsse'\n export const M2M_EXTERNAL_INTERNAL_CLIENT = 'cmeic'\n export const M2M_FETCH_MIGRATION_DATA = 'cmfmd'\n export const M2M_MANAGE_GENERATION_UPGRADE_PATH = 'cmmgup'\n\n /**\n * The one m2m permission of control-backend. It opens every route of\n * `api/admin/approvals` in accounts-backend and in console-backend, which\n * control-backend calls when a four-eyes request has the approvals that it\n * needs.\n *\n * One permission for all of them, by a decision of the team: one grant at\n * Auth0 for the whole approval surface of control-backend. A route that\n * reads it runs an action that people already approved, so the permission\n * goes to the m2m application of control-backend and to no other client.\n *\n * It is NOT the permission that a Camundi needs. A person needs the\n * permission of the action, such as `CLUSTERS_CAN_MOVE_TO_OTHER_ORG`, and\n * control-backend asks for that one before it accepts an approval.\n */\n export const M2M_CONTROL_APPROVALS = 'ctam'\n /**\n * Lets the delete cron of console-backend open a `cluster-ttl-deletion`\n * request in control-backend. That request needs no approval, so the\n * permission goes to the m2m application of console-backend and to no other\n * client.\n */\n export const M2M_CLUSTER_TTL_DELETION = 'cmctd'\n /**\n * Lets console-backend and accounts-backend ask control-backend whether an\n * agent token is still active, and which read permissions it holds. The\n * permission goes to the m2m applications of those two services and to no\n * other client.\n */\n export const M2M_CONTROL_AGENT_STATUS = 'ctas'\n /**\n * Lets CloudBot ask control-backend for a grant of an agent token, for a\n * Slack channel with a binding. The permission goes to the m2m application\n * of CloudBot and to no other client.\n */\n export const M2M_CONTROL_AGENT_GRANTS = 'ctag'\n /**\n * Lets the daily fleet statistics job of control-backend read the cluster\n * list of console-backend (`GET /api/admin/clusters`). It also shows `plan`\n * in each cluster. It opens no other route, and no write. The permission\n * goes to the m2m application of control-backend and to no other client.\n *\n * `CLUSTERS_READALLCLUSTERINFO` also opens the route. That one is the\n * permission of a person, and it opens every read of `api/admin/clusters`.\n */\n export const M2M_READ_CLUSTER_LIST = 'cmrcl'\n /**\n * Lets the daily fleet statistics job of control-backend read the API\n * client counts of console-backend (`GET /api/admin/apiClients/stats`). It\n * opens no other route, and no write. The permission goes to the m2m\n * application of control-backend and to no other client.\n *\n * `CLUSTERS_READALLCLUSTERINFO`, the permission of a person, also opens the\n * route.\n */\n export const M2M_READ_API_CLIENT_STATS = 'cmracs'\n /**\n * Lets a read-only agent (waggle) call the read-only `GET` routes of\n * control-backend with a machine token. It opens no write. The permission\n * goes to one m2m application of the agent on each stage and to no other\n * client.\n *\n * One permission covers all of these routes. It is a documented exception\n * to \"one permission for each action\" in `docs/M2M_PERMISSIONS.md`.\n */\n export const M2M_CONTROL_READ = 'ctcr'\n /**\n * Lets a bot create and change leaflets in control-backend with a machine\n * token (`POST` and `PATCH` of `/api/leaflets`). It opens no delete: only a\n * person deletes a leaflet. The permission goes to the m2m application of\n * the bot that writes leaflets, and to no other client.\n */\n export const M2M_CONTROL_LEAFLETS_WRITE = 'ctlw'\n /**\n * Lets CloudBot call `POST /api/annotations/lookup` of control-backend with\n * a machine token, to warn about a white-glove organization or cluster. The\n * route is a `POST` that only reads. It opens no other route. The permission\n * goes to the m2m application of CloudBot, and to no other client.\n */\n export const M2M_CONTROL_ANNOTATIONS_LOOKUP = 'ctal'\n /**\n * Stands in for the permission of EVERY approval use case of\n * control-backend, for a person who tests the approval flow.\n *\n * A holder can open, approve, reject and run each use case, including one\n * that a later change adds, with no grant of its own permission. The four-eyes\n * rule still holds: nobody approves their own request.\n *\n * It is a permission of a PERSON. No machine route reads it, because a token\n * that a Camundi can get must not run an action with no approval. It goes to\n * no role at Auth0: a person with access to the tenant grants it by hand, and\n * only on a stage where the approval flow is under test.\n */\n export const APPROVALS_ALL_USE_CASES = 'caauc'\n /**\n * Lets a person see, approve, reject and retry a `grant-approval-override`\n * request of control-backend. Without it, a person sees only the requests\n * that they opened or that name them as the grantee. A grant lets one\n * Camundi run requests with no second person, so only the console team\n * approves it. To OPEN the request still needs\n * `AccountsPermissions.CHANGE_ROLE`.\n */\n export const APPROVE_APPROVAL_OVERRIDE_GRANT = 'caaog'\n export const CLUSTER_CREATE_ON_BEHALF = 'cccob'\n export const FEATURE_NEW_HOME = 'cfnh'\n export const FEATURE_TEMPLATE_PICKER = 'cftp'\n export const USER_SETTINGS = 'cus'\n export const CLUSTERS_CAN_OVERRIDE_ENV_VARS = 'ccoev'\n export const CLUSTERS_CAN_CREATE_MODIFICATION_CONFIG = 'ccccmc'\n\n export const DEBUG = 'cdbg'\n export const GOD_TRIGGER_CRONS = 'gtc'\n\n export const RELEASE_TRAIN_PUBLISH = 'crtp'\n\n export const APICLIENT_READ = 'capr'\n export const APICLIENT_DELETE = 'capd'\n\n export interface Features {\n apiClient: {\n read: boolean\n delete: boolean\n }\n multiCluster: {\n admin: boolean\n }\n multiGen: {\n admin: {\n see: boolean\n modify: boolean\n patchExistingChannel: boolean\n migrate: boolean\n deleteAllClustersOfGeneration: boolean\n }\n releaseTrain: {\n publish: boolean\n }\n }\n clusters: {\n canReadAllClusterInfo: boolean\n canDeleteAllClusters: boolean\n canMoveToOtherOrg: boolean\n createOnBehalf: boolean\n canSendToSleep: boolean\n canCreateInternalBackup: boolean\n canUpdateClusterPlanType: boolean\n canOverrideEnvVars: boolean\n canCreateModificationConfig: boolean\n canUpgradeGeneration: boolean\n canUpgradeGenerationYolo: boolean\n canUpdateOptionalTelemetry: boolean\n canUpdateZeebeRebalancing: boolean\n }\n clusterPlan: {\n seeAll: boolean\n create: boolean\n delete: boolean\n type: {\n create: boolean\n modify: boolean\n delete: boolean\n forceDelete: boolean\n }\n migrate: boolean\n modify: boolean\n }\n features: {\n newHome: boolean\n templatePicker: boolean\n userSettings: boolean\n debug: boolean\n }\n m2m: {\n updateCrd: boolean\n signup: boolean\n triggerAlert: boolean\n deleteOrgClusters: boolean\n updateOrgClusters: boolean\n addUsageMetrics: boolean\n sendSseEvent: boolean\n external: {\n internalClient: boolean\n }\n fetchMigrationData: boolean\n manageGenerationUpgradePath: boolean\n /** Every route of `api/admin/approvals`. See `M2M_CONTROL_APPROVALS`. */\n approvals: boolean\n /** The status route of an agent client. See `M2M_CONTROL_AGENT_STATUS`. */\n controlAgentStatus: boolean\n /** The grant route of an agent token. See `M2M_CONTROL_AGENT_GRANTS`. */\n controlAgentGrants: boolean\n /** The cluster list of console. See `M2M_READ_CLUSTER_LIST`. */\n readClusterList: boolean\n /** The API client counts of console. See `M2M_READ_API_CLIENT_STATS`. */\n readApiClientStats: boolean\n /** The read-only routes of control-backend. See `M2M_CONTROL_READ`. */\n controlRead: boolean\n /**\n * The leaflet write routes of control-backend. See\n * `M2M_CONTROL_LEAFLETS_WRITE`.\n */\n controlLeafletsWrite: boolean\n /**\n * The annotation lookup route of control-backend. See\n * `M2M_CONTROL_ANNOTATIONS_LOOKUP`.\n */\n controlAnnotationsLookup: boolean\n }\n }\n\n export function createEmptyFeatures(): Features {\n return {\n apiClient: {\n read: false,\n delete: false,\n },\n multiCluster: { admin: false },\n multiGen: {\n admin: {\n migrate: false,\n modify: false,\n patchExistingChannel: false,\n see: false,\n deleteAllClustersOfGeneration: false,\n },\n releaseTrain: {\n publish: false,\n },\n },\n clusters: {\n canReadAllClusterInfo: false,\n canDeleteAllClusters: false,\n canMoveToOtherOrg: false,\n createOnBehalf: false,\n canSendToSleep: false,\n canCreateInternalBackup: false,\n canUpdateClusterPlanType: false,\n canOverrideEnvVars: false,\n canCreateModificationConfig: false,\n canUpgradeGeneration: false,\n canUpgradeGenerationYolo: false,\n canUpdateOptionalTelemetry: false,\n canUpdateZeebeRebalancing: false,\n },\n clusterPlan: {\n seeAll: false,\n create: false,\n delete: false,\n type: {\n create: false,\n modify: false,\n delete: false,\n forceDelete: false,\n },\n migrate: false,\n modify: false,\n },\n features: {\n newHome: false,\n templatePicker: false,\n userSettings: false,\n debug: false,\n },\n m2m: {\n updateCrd: false,\n signup: false,\n triggerAlert: false,\n deleteOrgClusters: false,\n updateOrgClusters: false,\n addUsageMetrics: false,\n sendSseEvent: false,\n external: {\n internalClient: false,\n },\n fetchMigrationData: false,\n manageGenerationUpgradePath: false,\n approvals: false,\n controlAgentStatus: false,\n controlAgentGrants: false,\n readClusterList: false,\n readApiClientStats: false,\n controlRead: false,\n controlLeafletsWrite: false,\n controlAnnotationsLookup: false,\n },\n }\n }\n\n export const PermissionsAtAuth0: Array<{\n value: string\n description: string\n initialRoles: Roles[]\n }> = [\n {\n value: MULTICLUSTER_ADMIN,\n description: 'can create and delete k8s clusters',\n initialRoles: ['console:admin'],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN_SEE,\n description: 'can go to the admin section for MultiGen, but no touch!',\n initialRoles: [\n 'console:admin',\n 'console:admin:readonly',\n 'support:agent',\n 'supersupport:agent',\n 'accounts:clusterUpdates',\n 'console:C8ReleaseManager',\n 'console:C8UpdateEnforcer',\n ],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN,\n description: 'can create channels, generations and combine them',\n initialRoles: ['console:admin', 'console:C8ReleaseManager'],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN_PATCH_EXISTING_CHANNEL,\n description: 'can modify existing channels and combine them',\n initialRoles: [\n 'console:admin',\n 'accounts:clusterUpdates',\n 'console:C8ReleaseManager',\n ],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN_MIGRATE,\n description:\n 'can migrate clusters of generations to supported other generations',\n initialRoles: ['console:admin', 'console:C8UpdateEnforcer'],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN_DELETE_ALL_CLUSTERS,\n description: 'can delete all clusters of a generation',\n initialRoles: ['console:admin'],\n },\n {\n value: CHANNELS_AND_GENERATIONS_MIGRATE,\n description:\n 'can migrate owned clusters of generations to supported other generations',\n initialRoles: [],\n },\n {\n value: CLUSTERS_READALLCLUSTERINFO,\n description: 'can read clusterInfo for all clusters',\n initialRoles: [\n 'accounts:read',\n 'accounts:onboard',\n 'accounts:orgCreator',\n 'accounts:admin',\n 'accounts:editSalesPlans',\n 'console:admin:readonly',\n 'support:agent',\n 'supersupport:agent',\n 'console:admin',\n 'accounts:trialExtender',\n 'accounts:enterpriseAdmin',\n ],\n },\n {\n value: CLUSTERS_DELETE_CLUSTER,\n description: 'can delete clusters in all orgs',\n initialRoles: ['accounts:admin'],\n },\n {\n value: CLUSTERS_CAN_MOVE_TO_OTHER_ORG,\n description: 'can move a cluster to another org the user is part of',\n // CSMs, TAMs and consultants move a cluster to another org for a\n // customer, thus the capability goes to `console:clusterMover`. The\n // population that holds the role lives in the Camundi permission\n // rules, not in the name of the role.\n initialRoles: ['console:admin', 'console:clusterMover'],\n },\n {\n value: CLUSTER_PLAN_SEE_ALL,\n description: 'can see all ClusterPlans',\n initialRoles: [\n 'console:admin',\n 'accounts:read',\n 'accounts:orgCreator',\n 'accounts:admin',\n 'console:admin:readonly',\n 'support:agent',\n 'supersupport:agent',\n 'accounts:onboard',\n 'accounts:editSalesPlans',\n 'accounts:trialExtender',\n 'accounts:enterpriseAdmin',\n ],\n },\n {\n value: CLUSTER_PLAN_CREATE,\n description: 'can create ClusterPlans',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_DELETE,\n description: 'can delete ClusterPlans',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_TYPE_CREATE,\n description: 'can create ClusterPlanTypes',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_TYPE_DELETE,\n description: 'can delete ClusterPlanTypes',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_TYPE_FORCE_DELETE,\n description: 'can delete ClusterPlanTypes',\n initialRoles: ['console:god'],\n },\n {\n value: CLUSTER_PLAN_TYPE_MODIFY,\n description: 'can modify ClusterPlanTypes',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_MIGRATE,\n description: 'can migrate Clusters from one plan to another',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_CREATE_ON_BEHALF,\n description:\n 'enables accounts to create clusters on signup (not a user permission)',\n initialRoles: [],\n },\n {\n value: M2M_SIGNUP,\n description: 'allows to signal to Console new user signups',\n initialRoles: [],\n },\n { value: M2M_UPDATE_CRD, description: 'may update crds', initialRoles: [] },\n {\n value: M2M_TRIGGER_ALERT,\n description: 'allows Infra and Operate to trigger alerts',\n initialRoles: [],\n },\n {\n value: M2M_DELETE_ORG_CLUSTERS,\n description:\n 'allows trigger console to delete all clusters of an Organization',\n initialRoles: [],\n },\n {\n value: M2M_UPDATE_ORG_CLUSTERS,\n description: 'allows to update clusters of an Organization',\n initialRoles: [],\n },\n {\n value: M2M_ADD_CLUSTER_USAGE_METRICS,\n description: 'allows to trigger update of value metrics',\n initialRoles: [],\n },\n {\n value: M2M_SEND_SSE_EVENT,\n description: 'allows to trigger SSE events',\n initialRoles: [],\n },\n {\n value: M2M_EXTERNAL_INTERNAL_CLIENT,\n description: 'allows to fetch internal clients',\n initialRoles: [],\n },\n // `initialRoles` is empty, and it must stay empty. A machine client holds\n // a grant on its Auth0 application, and never a role. An entry here with a\n // role would give the permission to every person in that role.\n {\n value: M2M_CONTROL_APPROVALS,\n description:\n 'm2m can run the approved actions of control-backend in accounts and console',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CLUSTER_TTL_DELETION,\n description:\n 'm2m can open the request of control-backend that deletes a cluster whose TTL ran out',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_AGENT_STATUS,\n description:\n 'm2m can read from control-backend whether an agent token is active, and its read permissions',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_AGENT_GRANTS,\n description:\n 'm2m can ask control-backend for a grant of an agent token for a Slack channel',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_READ_CLUSTER_LIST,\n description:\n 'm2m can read the cluster list of console for the fleet statistics',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_READ_API_CLIENT_STATS,\n description:\n 'm2m can read the API client counts of console for the fleet statistics',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_READ,\n description: 'm2m can call the read-only routes of control-backend',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_LEAFLETS_WRITE,\n description: 'm2m can create and change leaflets in control-backend',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_ANNOTATIONS_LOOKUP,\n description: 'm2m can look up annotations in control-backend',\n initialRoles: [],\n },\n // No role, on purpose. This permission opens every approval use case, so\n // a person with access to the tenant grants it by hand, for testing.\n {\n value: APPROVALS_ALL_USE_CASES,\n description:\n 'can open, approve, reject and run every approval use case of Control (for testing)',\n initialRoles: [],\n },\n {\n value: APPROVE_APPROVAL_OVERRIDE_GRANT,\n description:\n 'can see, approve, reject and retry the requests for an approval override grant in Control',\n initialRoles: ['consoleTeam'],\n },\n {\n value: M2M_FETCH_MIGRATION_DATA,\n description: 'allows to fetch migration data',\n initialRoles: [],\n },\n {\n value: M2M_MANAGE_GENERATION_UPGRADE_PATH,\n description:\n 'allows to manage upgrade paths for generations via external API',\n initialRoles: [],\n },\n {\n value: FEATURE_NEW_HOME,\n description: 'allows users to see new home',\n initialRoles: ['console:admin'],\n },\n {\n value: USER_SETTINGS,\n description: 'allows users to see user settings',\n initialRoles: ['console:admin', 'betatester:true'],\n },\n {\n value: FEATURE_TEMPLATE_PICKER,\n description: 'allows users to see template picker',\n initialRoles: ['console:admin', 'betatester:true'],\n },\n {\n value: CLUSTERS_CAN_SEND_TO_SLEEP,\n description: 'may send a cluster to sleep and wake up',\n initialRoles: [\n 'console:admin',\n 'accounts:admin',\n 'console:operationsEngineer',\n ],\n },\n {\n value: CLUSTERS_CAN_CREATE_INTERNAL_BACKUP,\n description: 'may create and delete internal (incident) backups',\n initialRoles: ['console:admin', 'console:operationsEngineer'],\n },\n {\n value: DEBUG,\n description: 'can see additional debugging tools',\n initialRoles: ['console:admin:readonly', 'console:admin'],\n },\n {\n value: CLUSTERS_CAN_OVERRIDE_ENV_VARS,\n description:\n 'can set Env Vars on cluster level that override all ClusterPlan Env Vars',\n initialRoles: ['console:admin', 'console:operationsEngineer'],\n },\n {\n value: CLUSTERS_CAN_CREATE_MODIFICATION_CONFIG,\n description: 'can create cluster modification configs',\n initialRoles: ['console:admin', 'console:operationsEngineer'],\n },\n {\n value: CLUSTERS_CAN_UPDATE_CLUSTERPLANTYPE,\n description: 'can update clusterplantype of a running cluster',\n initialRoles: [\n 'console:admin',\n 'accounts:onboard',\n 'console:operationsEngineer',\n 'accounts:enterpriseAdmin',\n ],\n },\n {\n value: CLUSTERS_CAN_UPDATE_GENERATION,\n description: 'can update generation of a running cluster',\n initialRoles: [\n 'console:admin',\n 'accounts:clusterUpdates',\n 'console:C8ReleaseManager',\n ],\n },\n {\n value: CLUSTERS_CAN_UPDATE_GENERATION_YOLO,\n description:\n 'can update generation of a running cluster even if the generation is not reachable',\n initialRoles: ['console:god'],\n },\n {\n value: CLUSTERS_CAN_UPDATE_OPTIONAL_TELEMETRY,\n description:\n 'can enable or disable optional product telemetry for a cluster',\n // A customer asks their CSM or TAM to switch the category off, thus the\n // capability goes to `console:optionalTelemetryManager`. The population\n // that holds the role lives in the Camundi permission rules, not in the\n // name of the role. The console team keeps the permission, to help when\n // a change does not take effect.\n initialRoles: ['console:admin', 'console:optionalTelemetryManager'],\n },\n {\n value: CLUSTERS_CAN_UPDATE_ZEEBE_REBALANCING,\n description:\n 'can turn scheduled Zeebe leader rebalancing on or off for a cluster and set its schedule',\n // The controller team keeps the hand-written rebalancing jobs today, and\n // its subdivision holds `console:operationsEngineer`.\n initialRoles: ['console:admin', 'console:operationsEngineer'],\n },\n {\n value: CLUSTER_PLAN_CAN_MODIFY,\n description: 'can trigger modifications of a clusterplan',\n initialRoles: ['console:admin', 'console:clusterPlanManager'],\n },\n {\n value: RELEASE_TRAIN_PUBLISH,\n description: 'can publish new generations via the release train endpoint',\n initialRoles: ['console:admin', 'console:C8ReleaseManager'],\n },\n {\n value: APICLIENT_READ,\n description: 'can read API Clients Names of Organizations',\n initialRoles: ['accounts:read', 'accounts:orgCreator'],\n },\n {\n value: APICLIENT_DELETE,\n description: 'can delete API clients of organizations',\n initialRoles: ['accounts:god'],\n },\n ]\n}\n"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { Roles } from '../types/Roles.js'\n\nexport namespace ConsolePermissions {\n export const MULTICLUSTER_ADMIN = 'cmca'\n\n export const CHANNELS_AND_GENERATIONS_ADMIN_DELETE_ALL_CLUSTERS = 'cmgda'\n export const CHANNELS_AND_GENERATIONS_ADMIN_SEE = 'cmgas'\n export const CHANNELS_AND_GENERATIONS_ADMIN = 'cmga'\n export const CHANNELS_AND_GENERATIONS_ADMIN_PATCH_EXISTING_CHANNEL = 'cmgap'\n export const CHANNELS_AND_GENERATIONS_ADMIN_MIGRATE = 'cmgam'\n export const CHANNELS_AND_GENERATIONS_MIGRATE = 'cmgm'\n export const ALL_CHANNELS_AND_GENERATIONS: string[] = [\n CHANNELS_AND_GENERATIONS_ADMIN_SEE,\n CHANNELS_AND_GENERATIONS_ADMIN,\n CHANNELS_AND_GENERATIONS_ADMIN_MIGRATE,\n ]\n export const CLUSTERS_READALLCLUSTERINFO = 'ccrai'\n export const CLUSTERS_DELETE_CLUSTER = 'ccda'\n export const CLUSTERS_CAN_MOVE_TO_OTHER_ORG = 'ccmoo'\n export const CLUSTERS_CAN_SEND_TO_SLEEP = 'ccsts'\n export const CLUSTERS_CAN_CREATE_INTERNAL_BACKUP = 'cccib'\n export const CLUSTERS_CAN_UPDATE_CLUSTERPLANTYPE = 'ccucp'\n export const CLUSTERS_CAN_UPDATE_GENERATION = 'ccug'\n export const CLUSTERS_CAN_UPDATE_GENERATION_YOLO = 'ccugy'\n export const CLUSTERS_CAN_UPDATE_OPTIONAL_TELEMETRY = 'ccuot'\n export const CLUSTERS_CAN_UPDATE_ZEEBE_REBALANCING = 'ccuzr'\n\n export const CLUSTER_PLAN_SEE_ALL = 'ccpa'\n export const CLUSTER_PLAN_CREATE = 'ccpc'\n export const CLUSTER_PLAN_DELETE = 'ccpd'\n\n export const CLUSTER_PLAN_TYPE_CREATE = 'cptc'\n export const CLUSTER_PLAN_TYPE_MODIFY = 'cptm'\n export const CLUSTER_PLAN_TYPE_DELETE = 'cptd'\n export const CLUSTER_PLAN_TYPE_FORCE_DELETE = 'cptfd'\n\n export const CLUSTER_PLAN_MIGRATE = 'ccpm'\n export const CLUSTER_PLAN_CAN_MODIFY = 'ccpmo'\n\n export const M2M_UPDATE_CRD = 'cmuc'\n export const M2M_SIGNUP = 'cms'\n export const M2M_TRIGGER_ALERT = 'cmta'\n export const M2M_DELETE_ORG_CLUSTERS = 'cmdoc'\n export const M2M_UPDATE_ORG_CLUSTERS = 'cmuoc'\n export const M2M_ADD_CLUSTER_USAGE_METRICS = 'cmacm'\n export const M2M_SEND_SSE_EVENT = 'cmsse'\n export const M2M_EXTERNAL_INTERNAL_CLIENT = 'cmeic'\n export const M2M_FETCH_MIGRATION_DATA = 'cmfmd'\n export const M2M_MANAGE_GENERATION_UPGRADE_PATH = 'cmmgup'\n\n /**\n * The one m2m permission of control-backend. It opens every route of\n * `api/admin/approvals` in accounts-ng and in console-backend, which\n * control-backend calls when a four-eyes request has the approvals that it\n * needs.\n *\n * One permission for all of them, by a decision of the team: one grant at\n * Auth0 for the whole approval surface of control-backend. A route that\n * reads it runs an action that people already approved, so the permission\n * goes to the m2m application of control-backend and to no other client.\n *\n * It is NOT the permission that a Camundi needs. A person needs the\n * permission of the action, such as `CLUSTERS_CAN_MOVE_TO_OTHER_ORG`, and\n * control-backend asks for that one before it accepts an approval.\n */\n export const M2M_CONTROL_APPROVALS = 'ctam'\n /**\n * Lets the delete cron of console-backend open a `cluster-ttl-deletion`\n * request in control-backend. That request needs no approval, so the\n * permission goes to the m2m application of console-backend and to no other\n * client.\n */\n export const M2M_CLUSTER_TTL_DELETION = 'cmctd'\n /**\n * Lets console-backend and accounts-ng ask control-backend whether an\n * agent token is still active, and which read permissions it holds. The\n * permission goes to the m2m applications of those two services and to no\n * other client.\n */\n export const M2M_CONTROL_AGENT_STATUS = 'ctas'\n /**\n * Lets CloudBot ask control-backend for a grant of an agent token, for a\n * Slack channel with a binding. The permission goes to the m2m application\n * of CloudBot and to no other client.\n */\n export const M2M_CONTROL_AGENT_GRANTS = 'ctag'\n /**\n * Lets the daily fleet statistics job of control-backend read the cluster\n * list of console-backend (`GET /api/admin/clusters`). It also shows `plan`\n * in each cluster. It opens no other route, and no write. The permission\n * goes to the m2m application of control-backend and to no other client.\n *\n * `CLUSTERS_READALLCLUSTERINFO` also opens the route. That one is the\n * permission of a person, and it opens every read of `api/admin/clusters`.\n */\n export const M2M_READ_CLUSTER_LIST = 'cmrcl'\n /**\n * Lets the daily fleet statistics job of control-backend read the API\n * client counts of console-backend (`GET /api/admin/apiClients/stats`). It\n * opens no other route, and no write. The permission goes to the m2m\n * application of control-backend and to no other client.\n *\n * `CLUSTERS_READALLCLUSTERINFO`, the permission of a person, also opens the\n * route.\n */\n export const M2M_READ_API_CLIENT_STATS = 'cmracs'\n /**\n * Lets a read-only agent (waggle) call the read-only `GET` routes of\n * control-backend with a machine token. It opens no write. The permission\n * goes to one m2m application of the agent on each stage and to no other\n * client.\n *\n * One permission covers all of these routes. It is a documented exception\n * to \"one permission for each action\" in `docs/M2M_PERMISSIONS.md`.\n */\n export const M2M_CONTROL_READ = 'ctcr'\n /**\n * Lets a bot create and change leaflets in control-backend with a machine\n * token (`POST` and `PATCH` of `/api/leaflets`). It opens no delete: only a\n * person deletes a leaflet. The permission goes to the m2m application of\n * the bot that writes leaflets, and to no other client.\n */\n export const M2M_CONTROL_LEAFLETS_WRITE = 'ctlw'\n /**\n * Lets CloudBot call `POST /api/annotations/lookup` of control-backend with\n * a machine token, to warn about a white-glove organization or cluster. The\n * route is a `POST` that only reads. It opens no other route. The permission\n * goes to the m2m application of CloudBot, and to no other client.\n */\n export const M2M_CONTROL_ANNOTATIONS_LOOKUP = 'ctal'\n /**\n * Stands in for the permission of EVERY approval use case of\n * control-backend, for a person who tests the approval flow.\n *\n * A holder can open, approve, reject and run each use case, including one\n * that a later change adds, with no grant of its own permission. The four-eyes\n * rule still holds: nobody approves their own request.\n *\n * It is a permission of a PERSON. No machine route reads it, because a token\n * that a Camundi can get must not run an action with no approval. It goes to\n * no role at Auth0: a person with access to the tenant grants it by hand, and\n * only on a stage where the approval flow is under test.\n */\n export const APPROVALS_ALL_USE_CASES = 'caauc'\n /**\n * Lets a person see, approve, reject and retry a `grant-approval-override`\n * request of control-backend. Without it, a person sees only the requests\n * that they opened or that name them as the grantee. A grant lets one\n * Camundi run requests with no second person, so only the console team\n * approves it. To OPEN the request still needs\n * `AccountsPermissions.CHANGE_ROLE`.\n */\n export const APPROVE_APPROVAL_OVERRIDE_GRANT = 'caaog'\n export const CLUSTER_CREATE_ON_BEHALF = 'cccob'\n export const FEATURE_NEW_HOME = 'cfnh'\n export const FEATURE_TEMPLATE_PICKER = 'cftp'\n export const USER_SETTINGS = 'cus'\n export const CLUSTERS_CAN_OVERRIDE_ENV_VARS = 'ccoev'\n export const CLUSTERS_CAN_CREATE_MODIFICATION_CONFIG = 'ccccmc'\n\n export const DEBUG = 'cdbg'\n export const GOD_TRIGGER_CRONS = 'gtc'\n\n export const RELEASE_TRAIN_PUBLISH = 'crtp'\n\n export const APICLIENT_READ = 'capr'\n export const APICLIENT_DELETE = 'capd'\n\n export interface Features {\n apiClient: {\n read: boolean\n delete: boolean\n }\n multiCluster: {\n admin: boolean\n }\n multiGen: {\n admin: {\n see: boolean\n modify: boolean\n patchExistingChannel: boolean\n migrate: boolean\n deleteAllClustersOfGeneration: boolean\n }\n releaseTrain: {\n publish: boolean\n }\n }\n clusters: {\n canReadAllClusterInfo: boolean\n canDeleteAllClusters: boolean\n canMoveToOtherOrg: boolean\n createOnBehalf: boolean\n canSendToSleep: boolean\n canCreateInternalBackup: boolean\n canUpdateClusterPlanType: boolean\n canOverrideEnvVars: boolean\n canCreateModificationConfig: boolean\n canUpgradeGeneration: boolean\n canUpgradeGenerationYolo: boolean\n canUpdateOptionalTelemetry: boolean\n canUpdateZeebeRebalancing: boolean\n }\n clusterPlan: {\n seeAll: boolean\n create: boolean\n delete: boolean\n type: {\n create: boolean\n modify: boolean\n delete: boolean\n forceDelete: boolean\n }\n migrate: boolean\n modify: boolean\n }\n features: {\n newHome: boolean\n templatePicker: boolean\n userSettings: boolean\n debug: boolean\n }\n m2m: {\n updateCrd: boolean\n signup: boolean\n triggerAlert: boolean\n deleteOrgClusters: boolean\n updateOrgClusters: boolean\n addUsageMetrics: boolean\n sendSseEvent: boolean\n external: {\n internalClient: boolean\n }\n fetchMigrationData: boolean\n manageGenerationUpgradePath: boolean\n /** Every route of `api/admin/approvals`. See `M2M_CONTROL_APPROVALS`. */\n approvals: boolean\n /** The status route of an agent client. See `M2M_CONTROL_AGENT_STATUS`. */\n controlAgentStatus: boolean\n /** The grant route of an agent token. See `M2M_CONTROL_AGENT_GRANTS`. */\n controlAgentGrants: boolean\n /** The cluster list of console. See `M2M_READ_CLUSTER_LIST`. */\n readClusterList: boolean\n /** The API client counts of console. See `M2M_READ_API_CLIENT_STATS`. */\n readApiClientStats: boolean\n /** The read-only routes of control-backend. See `M2M_CONTROL_READ`. */\n controlRead: boolean\n /**\n * The leaflet write routes of control-backend. See\n * `M2M_CONTROL_LEAFLETS_WRITE`.\n */\n controlLeafletsWrite: boolean\n /**\n * The annotation lookup route of control-backend. See\n * `M2M_CONTROL_ANNOTATIONS_LOOKUP`.\n */\n controlAnnotationsLookup: boolean\n }\n }\n\n export function createEmptyFeatures(): Features {\n return {\n apiClient: {\n read: false,\n delete: false,\n },\n multiCluster: { admin: false },\n multiGen: {\n admin: {\n migrate: false,\n modify: false,\n patchExistingChannel: false,\n see: false,\n deleteAllClustersOfGeneration: false,\n },\n releaseTrain: {\n publish: false,\n },\n },\n clusters: {\n canReadAllClusterInfo: false,\n canDeleteAllClusters: false,\n canMoveToOtherOrg: false,\n createOnBehalf: false,\n canSendToSleep: false,\n canCreateInternalBackup: false,\n canUpdateClusterPlanType: false,\n canOverrideEnvVars: false,\n canCreateModificationConfig: false,\n canUpgradeGeneration: false,\n canUpgradeGenerationYolo: false,\n canUpdateOptionalTelemetry: false,\n canUpdateZeebeRebalancing: false,\n },\n clusterPlan: {\n seeAll: false,\n create: false,\n delete: false,\n type: {\n create: false,\n modify: false,\n delete: false,\n forceDelete: false,\n },\n migrate: false,\n modify: false,\n },\n features: {\n newHome: false,\n templatePicker: false,\n userSettings: false,\n debug: false,\n },\n m2m: {\n updateCrd: false,\n signup: false,\n triggerAlert: false,\n deleteOrgClusters: false,\n updateOrgClusters: false,\n addUsageMetrics: false,\n sendSseEvent: false,\n external: {\n internalClient: false,\n },\n fetchMigrationData: false,\n manageGenerationUpgradePath: false,\n approvals: false,\n controlAgentStatus: false,\n controlAgentGrants: false,\n readClusterList: false,\n readApiClientStats: false,\n controlRead: false,\n controlLeafletsWrite: false,\n controlAnnotationsLookup: false,\n },\n }\n }\n\n export const PermissionsAtAuth0: Array<{\n value: string\n description: string\n initialRoles: Roles[]\n }> = [\n {\n value: MULTICLUSTER_ADMIN,\n description: 'can create and delete k8s clusters',\n initialRoles: ['console:admin'],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN_SEE,\n description: 'can go to the admin section for MultiGen, but no touch!',\n initialRoles: [\n 'console:admin',\n 'console:admin:readonly',\n 'support:agent',\n 'supersupport:agent',\n 'accounts:clusterUpdates',\n 'console:C8ReleaseManager',\n 'console:C8UpdateEnforcer',\n ],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN,\n description: 'can create channels, generations and combine them',\n initialRoles: ['console:admin', 'console:C8ReleaseManager'],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN_PATCH_EXISTING_CHANNEL,\n description: 'can modify existing channels and combine them',\n initialRoles: [\n 'console:admin',\n 'accounts:clusterUpdates',\n 'console:C8ReleaseManager',\n ],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN_MIGRATE,\n description:\n 'can migrate clusters of generations to supported other generations',\n initialRoles: ['console:admin', 'console:C8UpdateEnforcer'],\n },\n {\n value: CHANNELS_AND_GENERATIONS_ADMIN_DELETE_ALL_CLUSTERS,\n description: 'can delete all clusters of a generation',\n initialRoles: ['console:admin'],\n },\n {\n value: CHANNELS_AND_GENERATIONS_MIGRATE,\n description:\n 'can migrate owned clusters of generations to supported other generations',\n initialRoles: [],\n },\n {\n value: CLUSTERS_READALLCLUSTERINFO,\n description: 'can read clusterInfo for all clusters',\n initialRoles: [\n 'accounts:read',\n 'accounts:onboard',\n 'accounts:orgCreator',\n 'accounts:admin',\n 'accounts:editSalesPlans',\n 'console:admin:readonly',\n 'support:agent',\n 'supersupport:agent',\n 'console:admin',\n 'accounts:trialExtender',\n 'accounts:enterpriseAdmin',\n ],\n },\n {\n value: CLUSTERS_DELETE_CLUSTER,\n description: 'can delete clusters in all orgs',\n initialRoles: ['accounts:admin'],\n },\n {\n value: CLUSTERS_CAN_MOVE_TO_OTHER_ORG,\n description: 'can move a cluster to another org the user is part of',\n // CSMs, TAMs and consultants move a cluster to another org for a\n // customer, thus the capability goes to `console:clusterMover`. The\n // population that holds the role lives in the Camundi permission\n // rules, not in the name of the role.\n initialRoles: ['console:admin', 'console:clusterMover'],\n },\n {\n value: CLUSTER_PLAN_SEE_ALL,\n description: 'can see all ClusterPlans',\n initialRoles: [\n 'console:admin',\n 'accounts:read',\n 'accounts:orgCreator',\n 'accounts:admin',\n 'console:admin:readonly',\n 'support:agent',\n 'supersupport:agent',\n 'accounts:onboard',\n 'accounts:editSalesPlans',\n 'accounts:trialExtender',\n 'accounts:enterpriseAdmin',\n ],\n },\n {\n value: CLUSTER_PLAN_CREATE,\n description: 'can create ClusterPlans',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_DELETE,\n description: 'can delete ClusterPlans',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_TYPE_CREATE,\n description: 'can create ClusterPlanTypes',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_TYPE_DELETE,\n description: 'can delete ClusterPlanTypes',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_TYPE_FORCE_DELETE,\n description: 'can delete ClusterPlanTypes',\n initialRoles: ['console:god'],\n },\n {\n value: CLUSTER_PLAN_TYPE_MODIFY,\n description: 'can modify ClusterPlanTypes',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_PLAN_MIGRATE,\n description: 'can migrate Clusters from one plan to another',\n initialRoles: ['console:admin'],\n },\n {\n value: CLUSTER_CREATE_ON_BEHALF,\n description:\n 'enables accounts to create clusters on signup (not a user permission)',\n initialRoles: [],\n },\n {\n value: M2M_SIGNUP,\n description: 'allows to signal to Console new user signups',\n initialRoles: [],\n },\n { value: M2M_UPDATE_CRD, description: 'may update crds', initialRoles: [] },\n {\n value: M2M_TRIGGER_ALERT,\n description: 'allows Infra and Operate to trigger alerts',\n initialRoles: [],\n },\n {\n value: M2M_DELETE_ORG_CLUSTERS,\n description:\n 'allows trigger console to delete all clusters of an Organization',\n initialRoles: [],\n },\n {\n value: M2M_UPDATE_ORG_CLUSTERS,\n description: 'allows to update clusters of an Organization',\n initialRoles: [],\n },\n {\n value: M2M_ADD_CLUSTER_USAGE_METRICS,\n description: 'allows to trigger update of value metrics',\n initialRoles: [],\n },\n {\n value: M2M_SEND_SSE_EVENT,\n description: 'allows to trigger SSE events',\n initialRoles: [],\n },\n {\n value: M2M_EXTERNAL_INTERNAL_CLIENT,\n description: 'allows to fetch internal clients',\n initialRoles: [],\n },\n // `initialRoles` is empty, and it must stay empty. A machine client holds\n // a grant on its Auth0 application, and never a role. An entry here with a\n // role would give the permission to every person in that role.\n {\n value: M2M_CONTROL_APPROVALS,\n description:\n 'm2m can run the approved actions of control-backend in accounts and console',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CLUSTER_TTL_DELETION,\n description:\n 'm2m can open the request of control-backend that deletes a cluster whose TTL ran out',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_AGENT_STATUS,\n description:\n 'm2m can read from control-backend whether an agent token is active, and its read permissions',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_AGENT_GRANTS,\n description:\n 'm2m can ask control-backend for a grant of an agent token for a Slack channel',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_READ_CLUSTER_LIST,\n description:\n 'm2m can read the cluster list of console for the fleet statistics',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_READ_API_CLIENT_STATS,\n description:\n 'm2m can read the API client counts of console for the fleet statistics',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_READ,\n description: 'm2m can call the read-only routes of control-backend',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_LEAFLETS_WRITE,\n description: 'm2m can create and change leaflets in control-backend',\n initialRoles: [],\n },\n // No role: a machine holds a grant on its application. See the note above.\n {\n value: M2M_CONTROL_ANNOTATIONS_LOOKUP,\n description: 'm2m can look up annotations in control-backend',\n initialRoles: [],\n },\n // No role, on purpose. This permission opens every approval use case, so\n // a person with access to the tenant grants it by hand, for testing.\n {\n value: APPROVALS_ALL_USE_CASES,\n description:\n 'can open, approve, reject and run every approval use case of Control (for testing)',\n initialRoles: [],\n },\n {\n value: APPROVE_APPROVAL_OVERRIDE_GRANT,\n description:\n 'can see, approve, reject and retry the requests for an approval override grant in Control',\n initialRoles: ['consoleTeam'],\n },\n {\n value: M2M_FETCH_MIGRATION_DATA,\n description: 'allows to fetch migration data',\n initialRoles: [],\n },\n {\n value: M2M_MANAGE_GENERATION_UPGRADE_PATH,\n description:\n 'allows to manage upgrade paths for generations via external API',\n initialRoles: [],\n },\n {\n value: FEATURE_NEW_HOME,\n description: 'allows users to see new home',\n initialRoles: ['console:admin'],\n },\n {\n value: USER_SETTINGS,\n description: 'allows users to see user settings',\n initialRoles: ['console:admin', 'betatester:true'],\n },\n {\n value: FEATURE_TEMPLATE_PICKER,\n description: 'allows users to see template picker',\n initialRoles: ['console:admin', 'betatester:true'],\n },\n {\n value: CLUSTERS_CAN_SEND_TO_SLEEP,\n description: 'may send a cluster to sleep and wake up',\n initialRoles: [\n 'console:admin',\n 'accounts:admin',\n 'console:operationsEngineer',\n ],\n },\n {\n value: CLUSTERS_CAN_CREATE_INTERNAL_BACKUP,\n description: 'may create and delete internal (incident) backups',\n initialRoles: ['console:admin', 'console:operationsEngineer'],\n },\n {\n value: DEBUG,\n description: 'can see additional debugging tools',\n initialRoles: ['console:admin:readonly', 'console:admin'],\n },\n {\n value: CLUSTERS_CAN_OVERRIDE_ENV_VARS,\n description:\n 'can set Env Vars on cluster level that override all ClusterPlan Env Vars',\n initialRoles: ['console:admin', 'console:operationsEngineer'],\n },\n {\n value: CLUSTERS_CAN_CREATE_MODIFICATION_CONFIG,\n description: 'can create cluster modification configs',\n initialRoles: ['console:admin', 'console:operationsEngineer'],\n },\n {\n value: CLUSTERS_CAN_UPDATE_CLUSTERPLANTYPE,\n description: 'can update clusterplantype of a running cluster',\n initialRoles: [\n 'console:admin',\n 'accounts:onboard',\n 'console:operationsEngineer',\n 'accounts:enterpriseAdmin',\n ],\n },\n {\n value: CLUSTERS_CAN_UPDATE_GENERATION,\n description: 'can update generation of a running cluster',\n initialRoles: [\n 'console:admin',\n 'accounts:clusterUpdates',\n 'console:C8ReleaseManager',\n ],\n },\n {\n value: CLUSTERS_CAN_UPDATE_GENERATION_YOLO,\n description:\n 'can update generation of a running cluster even if the generation is not reachable',\n initialRoles: ['console:god'],\n },\n {\n value: CLUSTERS_CAN_UPDATE_OPTIONAL_TELEMETRY,\n description:\n 'can enable or disable optional product telemetry for a cluster',\n // A customer asks their CSM or TAM to switch the category off, thus the\n // capability goes to `console:optionalTelemetryManager`. The population\n // that holds the role lives in the Camundi permission rules, not in the\n // name of the role. The console team keeps the permission, to help when\n // a change does not take effect.\n initialRoles: ['console:admin', 'console:optionalTelemetryManager'],\n },\n {\n value: CLUSTERS_CAN_UPDATE_ZEEBE_REBALANCING,\n description:\n 'can turn scheduled Zeebe leader rebalancing on or off for a cluster and set its schedule',\n // The controller team keeps the hand-written rebalancing jobs today, and\n // its subdivision holds `console:operationsEngineer`.\n initialRoles: ['console:admin', 'console:operationsEngineer'],\n },\n {\n value: CLUSTER_PLAN_CAN_MODIFY,\n description: 'can trigger modifications of a clusterplan',\n initialRoles: ['console:admin', 'console:clusterPlanManager'],\n },\n {\n value: RELEASE_TRAIN_PUBLISH,\n description: 'can publish new generations via the release train endpoint',\n initialRoles: ['console:admin', 'console:C8ReleaseManager'],\n },\n {\n value: APICLIENT_READ,\n description: 'can read API Clients Names of Organizations',\n initialRoles: ['accounts:read', 'accounts:orgCreator'],\n },\n {\n value: APICLIENT_DELETE,\n description: 'can delete API clients of organizations',\n initialRoles: ['accounts:god'],\n },\n ]\n}\n"],
|
|
5
5
|
"mappings": "AAQO,IAAU;AAAA,CAAV,CAAUA,wBAAV;AACE,EAAMA,oBAAA,qBAAqB;AAE3B,EAAMA,oBAAA,qDAAqD;AAC3D,EAAMA,oBAAA,qCAAqC;AAC3C,EAAMA,oBAAA,iCAAiC;AACvC,EAAMA,oBAAA,wDAAwD;AAC9D,EAAMA,oBAAA,yCAAyC;AAC/C,EAAMA,oBAAA,mCAAmC;AACzC,EAAMA,oBAAA,+BAAyC;AAAA,IACpDA,oBAAA;AAAA,IACAA,oBAAA;AAAA,IACAA,oBAAA;AAAA,EACF;AACO,EAAMA,oBAAA,8BAA8B;AACpC,EAAMA,oBAAA,0BAA0B;AAChC,EAAMA,oBAAA,iCAAiC;AACvC,EAAMA,oBAAA,6BAA6B;AACnC,EAAMA,oBAAA,sCAAsC;AAC5C,EAAMA,oBAAA,sCAAsC;AAC5C,EAAMA,oBAAA,iCAAiC;AACvC,EAAMA,oBAAA,sCAAsC;AAC5C,EAAMA,oBAAA,yCAAyC;AAC/C,EAAMA,oBAAA,wCAAwC;AAE9C,EAAMA,oBAAA,uBAAuB;AAC7B,EAAMA,oBAAA,sBAAsB;AAC5B,EAAMA,oBAAA,sBAAsB;AAE5B,EAAMA,oBAAA,2BAA2B;AACjC,EAAMA,oBAAA,2BAA2B;AACjC,EAAMA,oBAA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IAC9D;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aAAa;AAAA,MACb,cAAc;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aAAa;AAAA,MACb,cAAc;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aACE;AAAA,MACF,cAAc,CAAC,aAAa;AAAA,IAC9B;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMF,cAAc,CAAC,iBAAiB,kCAAkC;AAAA,IACpE;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aACE;AAAA;AAAA;AAAA,MAGF,cAAc,CAAC,iBAAiB,4BAA4B;AAAA,IAC9D;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aAAa;AAAA,MACb,cAAc,CAAC,iBAAiB,4BAA4B;AAAA,IAC9D;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aAAa;AAAA,MACb,cAAc,CAAC,iBAAiB,0BAA0B;AAAA,IAC5D;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aAAa;AAAA,MACb,cAAc,CAAC,iBAAiB,qBAAqB;AAAA,IACvD;AAAA,IACA;AAAA,MACE,OAAOA,oBAAA;AAAA,MACP,aAAa;AAAA,MACb,cAAc,CAAC,cAAc;AAAA,IAC/B;AAAA,EACF;AAAA,GAxsBe;",
|
|
6
6
|
"names": ["ConsolePermissions"]
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ import type { Roles } from '../types/Roles.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Where the HiBob employee list is cached, in the Redis of the fleet.
|
|
5
5
|
*
|
|
6
|
-
* accounts-
|
|
6
|
+
* accounts-ng writes the entry. Every other service only reads it, and
|
|
7
7
|
* each one must address it with these two names: a service that reads another
|
|
8
8
|
* key finds nothing, adds no permission of a role, and says nothing about it.
|
|
9
9
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/camundiPermissionAugmenter.utils.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport { default as CAMUNDI_PERMISSION_RULES } from '../config/camundi-permission-rules.js'\nimport {\n type CamundiPermissionRules,\n DEPARTMENT,\n DIVISION,\n type HibobEmployee,\n SUB_DIVISION,\n} from '../config/camundi-permission-rules.types.js'\nimport { expandRolesToPermissions } from '../permissions/roleExpansion.utils.js'\nimport type { Roles } from '../types/Roles.js'\n\n/**\n * Where the HiBob employee list is cached, in the Redis of the fleet.\n *\n * accounts-
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport { default as CAMUNDI_PERMISSION_RULES } from '../config/camundi-permission-rules.js'\nimport {\n type CamundiPermissionRules,\n DEPARTMENT,\n DIVISION,\n type HibobEmployee,\n SUB_DIVISION,\n} from '../config/camundi-permission-rules.types.js'\nimport { expandRolesToPermissions } from '../permissions/roleExpansion.utils.js'\nimport type { Roles } from '../types/Roles.js'\n\n/**\n * Where the HiBob employee list is cached, in the Redis of the fleet.\n *\n * accounts-ng writes the entry. Every other service only reads it, and\n * each one must address it with these two names: a service that reads another\n * key finds nothing, adds no permission of a role, and says nothing about it.\n *\n * They live here, and not in a server package, because both server layers read\n * them. `shared-backend-server` serves the Express services and\n * `shared-backend-fastify` serves the Fastify services, and two copies of one\n * string is how the two engines come apart.\n */\nexport const HIBOB_CACHE_NAMESPACE = 'hibobUsersCache'\nexport const HIBOB_CACHE_KEY = 'allUsers'\n\n/**\n * Determines which permission rules apply to a given employee based on their\n * department, division, and subdivision.\n *\n * @param employee - HiBob employee data\n * @param rules - Permission rules configuration\n * @returns Array of roles that should be granted to the employee\n */\nexport function getApplicableRolesForEmployee(\n employee: HibobEmployee,\n rules: CamundiPermissionRules = CAMUNDI_PERMISSION_RULES,\n): Roles[] {\n const applicableRoles = new Set<Roles>()\n\n // Extract employee organizational data - use only direct field paths\n const department = employee[DEPARTMENT]?.value || ''\n const division = employee[DIVISION]?.value || ''\n const subdivision = employee[SUB_DIVISION]?.value || ''\n\n // Check department rules\n if (department && rules.departmentRules[department]) {\n for (const role of rules.departmentRules[department]) {\n applicableRoles.add(role)\n }\n }\n\n // Check division rules\n if (division && rules.divisionRules[division]) {\n for (const role of rules.divisionRules[division]) {\n applicableRoles.add(role)\n }\n }\n\n // Check subdivision rules\n if (subdivision && rules.subdivisionRules[subdivision]) {\n for (const role of rules.subdivisionRules[subdivision]) {\n applicableRoles.add(role)\n }\n }\n\n return Array.from(applicableRoles)\n}\n\n/**\n * Augments user permissions based on their Camunda employee status and organizational position.\n *\n * @param userEmail - Email of the user\n * @param currentPermissions - Current permissions from JWT\n * @param employees - List of all HiBob employees\n * @returns Augmented permissions array (original + new permissions from rules)\n */\nexport function augmentCamundiPermissions(\n userEmail: string,\n currentPermissions: string[],\n employees: HibobEmployee[],\n): {\n augmentedPermissions: string[]\n hibobEmployee?: HibobEmployee\n applicableRoles?: Roles[]\n} {\n // Early return if not a Camundi email\n if (!userEmail.toLowerCase().endsWith('@camunda.com')) {\n return { augmentedPermissions: currentPermissions }\n }\n\n // Find the employee in HiBob data\n const employee = employees.find((emp) => {\n const empEmail = emp.email || emp['/root/email']?.value\n return empEmail?.toLowerCase() === userEmail.toLowerCase()\n })\n\n if (!employee) {\n // Employee not found in HiBob - return original permissions\n return { augmentedPermissions: currentPermissions }\n }\n\n // Get applicable roles based on organizational structure\n const applicableRoles = getApplicableRolesForEmployee(employee)\n\n if (applicableRoles.length === 0) {\n // No rules apply to this employee\n return {\n augmentedPermissions: currentPermissions,\n hibobEmployee: employee,\n applicableRoles,\n }\n }\n\n // Expand roles to permissions\n const newPermissions = expandRolesToPermissions(applicableRoles)\n\n // Merge with existing permissions (deduplication via Set)\n const mergedPermissions = new Set([...currentPermissions, ...newPermissions])\n\n return {\n augmentedPermissions: Array.from(mergedPermissions),\n hibobEmployee: employee,\n applicableRoles,\n }\n}\n\nexport function isManager(\n userEmail: string,\n employees: HibobEmployee[],\n): boolean {\n // Early return if not a Camundi email\n if (!userEmail.toLowerCase().endsWith('@camunda.com')) {\n return false\n }\n return employees.some(\n (emp) =>\n emp['/work/reportsTo']?.value?.email?.toLowerCase() ===\n userEmail.toLowerCase(),\n )\n}\n"],
|
|
5
5
|
"mappings": "AAMA,SAAS,WAAW,gCAAgC;AACpD;AAAA,EAEE;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,gCAAgC;AAelC,MAAM,wBAAwB;AAC9B,MAAM,kBAAkB;AAUxB,SAAS,8BACd,UACA,QAAgC,0BACvB;AACT,QAAM,kBAAkB,oBAAI,IAAW;AAGvC,QAAM,aAAa,SAAS,UAAU,GAAG,SAAS;AAClD,QAAM,WAAW,SAAS,QAAQ,GAAG,SAAS;AAC9C,QAAM,cAAc,SAAS,YAAY,GAAG,SAAS;AAGrD,MAAI,cAAc,MAAM,gBAAgB,UAAU,GAAG;AACnD,eAAW,QAAQ,MAAM,gBAAgB,UAAU,GAAG;AACpD,sBAAgB,IAAI,IAAI;AAAA,IAC1B;AAAA,EACF;AAGA,MAAI,YAAY,MAAM,cAAc,QAAQ,GAAG;AAC7C,eAAW,QAAQ,MAAM,cAAc,QAAQ,GAAG;AAChD,sBAAgB,IAAI,IAAI;AAAA,IAC1B;AAAA,EACF;AAGA,MAAI,eAAe,MAAM,iBAAiB,WAAW,GAAG;AACtD,eAAW,QAAQ,MAAM,iBAAiB,WAAW,GAAG;AACtD,sBAAgB,IAAI,IAAI;AAAA,IAC1B;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,eAAe;AACnC;AAUO,SAAS,0BACd,WACA,oBACA,WAKA;AAEA,MAAI,CAAC,UAAU,YAAY,EAAE,SAAS,cAAc,GAAG;AACrD,WAAO,EAAE,sBAAsB,mBAAmB;AAAA,EACpD;AAGA,QAAM,WAAW,UAAU,KAAK,CAAC,QAAQ;AACvC,UAAM,WAAW,IAAI,SAAS,IAAI,aAAa,GAAG;AAClD,WAAO,UAAU,YAAY,MAAM,UAAU,YAAY;AAAA,EAC3D,CAAC;AAED,MAAI,CAAC,UAAU;AAEb,WAAO,EAAE,sBAAsB,mBAAmB;AAAA,EACpD;AAGA,QAAM,kBAAkB,8BAA8B,QAAQ;AAE9D,MAAI,gBAAgB,WAAW,GAAG;AAEhC,WAAO;AAAA,MACL,sBAAsB;AAAA,MACtB,eAAe;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAGA,QAAM,iBAAiB,yBAAyB,eAAe;AAG/D,QAAM,oBAAoB,oBAAI,IAAI,CAAC,GAAG,oBAAoB,GAAG,cAAc,CAAC;AAE5E,SAAO;AAAA,IACL,sBAAsB,MAAM,KAAK,iBAAiB;AAAA,IAClD,eAAe;AAAA,IACf;AAAA,EACF;AACF;AAEO,SAAS,UACd,WACA,WACS;AAET,MAAI,CAAC,UAAU,YAAY,EAAE,SAAS,cAAc,GAAG;AACrD,WAAO;AAAA,EACT;AACA,SAAO,UAAU;AAAA,IACf,CAAC,QACC,IAAI,iBAAiB,GAAG,OAAO,OAAO,YAAY,MAClD,UAAU,YAAY;AAAA,EAC1B;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The email of a user that the QA route of accounts-
|
|
2
|
+
* The email of a user that the QA route of accounts-ng creates
|
|
3
3
|
* (`POST /external/qa/organizations`). The route builds the email with this
|
|
4
4
|
* function, and every reader that must find a QA user calls
|
|
5
5
|
* `isQaUserEmail`. Thus the two cannot drift.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/qa-user.utils.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nconst QA_USER_EMAIL_PREFIX = 'qa-user-'\nconst QA_USER_EMAIL_DOMAIN = '@ultrawombat.com'\n\n// The QA route builds the id with `uuidv4()`: five groups of hex digits.\nconst QA_USER_EMAIL_PATTERN =\n /^qa-user-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}@ultrawombat\\.com$/\n\n/**\n * The email of a user that the QA route of accounts-
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nconst QA_USER_EMAIL_PREFIX = 'qa-user-'\nconst QA_USER_EMAIL_DOMAIN = '@ultrawombat.com'\n\n// The QA route builds the id with `uuidv4()`: five groups of hex digits.\nconst QA_USER_EMAIL_PATTERN =\n /^qa-user-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}@ultrawombat\\.com$/\n\n/**\n * The email of a user that the QA route of accounts-ng creates\n * (`POST /external/qa/organizations`). The route builds the email with this\n * function, and every reader that must find a QA user calls\n * `isQaUserEmail`. Thus the two cannot drift.\n */\nexport function qaUserEmail(userId: string): string {\n return `${QA_USER_EMAIL_PREFIX}${userId}${QA_USER_EMAIL_DOMAIN}`\n}\n\n/**\n * True when the email belongs to a user from an automated QA run. A token has\n * no QA claim, but it carries the email, thus the email is the marker. The id\n * in the email must be a UUID, so a person with the address\n * `qa-user-admin@ultrawombat.com` is no QA user.\n */\nexport function isQaUserEmail(email: string | undefined): boolean {\n return email !== undefined && QA_USER_EMAIL_PATTERN.test(email.toLowerCase())\n}\n"],
|
|
5
5
|
"mappings": "AAMA,MAAM,uBAAuB;AAC7B,MAAM,uBAAuB;AAG7B,MAAM,wBACJ;AAQK,SAAS,YAAY,QAAwB;AAClD,SAAO,GAAG,oBAAoB,GAAG,MAAM,GAAG,oBAAoB;AAChE;AAQO,SAAS,cAAc,OAAoC;AAChE,SAAO,UAAU,UAAa,sBAAsB,KAAK,MAAM,YAAY,CAAC;AAC9E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED