Skip to main content
From the release that introduces app authorizations, an installed app reaches its own secrets only through the roles the workspace installing it grants. This changes how the per-user OAuth connectors store and replay their members’ refresh tokens, and it does not happen by itself on an existing platform. Two scripts do it for every workspace at once. This page is for the platform administrator who upgrades a Prisme.ai platform, SaaS or self-hosted. When it is done, every installed connector is granted its roles, and the scheduled synchronizations of its members work as before the upgrade.
This is a breaking change. Until the steps below are done, a connector installed in a workspace answers Unknown role on its scheduled synchronizations, and its members cannot store a connection for them. Plan the upgrade in one maintenance window and run the steps in order.

Connectors concerned

Confluence, Figma, GitLab, Google Workspace, HubSpot, Jira, Microsoft Teams, Monday.com, OneNote, Outlook, Power BI, Salesforce and SharePoint.

Before you start

You need:
  • A platform super admin access token. It lists every workspace and manages the security of each. Keep it in an environment variable, never in a file you share.
  • The URL of the database holding the workspace secrets. It is the permissions storage, configured by PERMISSIONS_STORAGE_DRIVER and PERMISSIONS_STORAGE_HOST (see Environment variables). The script only renames secrets and never reads their values.
  • Node.js 20 or later, on a machine that reaches the API and that database.
  • The scripts of the release. They are in the scripts/ folder of the prismeai-workspaces sources of the release you upgrade to: grant-app-authorizations.mjs and migrate-secret-app-namespace.mjs. Run them from the root of those sources, which holds the workspaces/ folder they read. If you do not have access to these sources, ask Prisme.ai support for the scripts of your release.
Install their dependencies once, from that root:
Then set the variables the scripts read:
Both scripts only simulate by default: they print what they would do and change nothing. Add --apply to make the change. Each can be run again: what is already done is skipped.

Upgrade

1

Deploy the platform services

Bump the services to the target release and deploy them, as in Updates → Upgrade the platform services. Do not update the products yet.
2

List the installed connectors

The script writes every installed instance of the connectors above to instances.json and ends with the number of workspaces read and of errors. Rerun it if it reports errors. Both scripts take this file.
3

Move the stored refresh tokens

Simulate first:
Use --driver mongo for a MongoDB permissions storage. Each WOULD MOVE line is a token that will be renamed, and the last line gives the totals. When they match what you expect, run the same command with --apply.
4

Update the products

Pull the products from the Platform workspace, as in Updates → Update the products. This publishes the new versions of the connectors, which declare the roles they need.
5

Grant the installed connectors their roles

Simulate first:
Each WOULD GRANT line is a role an installed connector will be granted. Run the same command with --apply. The script grants each instance what an owner would grant from Imports, and nothing else.
6

Run the token move a second time

It should find nothing to move. If it lists tokens, run it with --apply.

Check the result

  • Run the grant simulation again: it should end with 0 to grant.
  • In Builder, open a workspace that installs one of these connectors, then Imports: the connector is no longer shown as pending.
  • A member connected to one of these connectors sees their scheduled synchronizations run again.

What the scripts leave aside

Each script prints the instances or tokens it does not change, with a reason. Nothing is changed for them.

If a step was missed

  • A member connected between the product update and the grant. Their connection works for what they do themselves, but no token was stored for the scheduled synchronizations. They connect again once the grant is done.
  • A workspace installs one of these connectors after the upgrade. An owner grants it from Imports right after the installation, as for any app that asks for authorizations.