Mubit keys
Your app sends a Mubit key in place of a provider key. Each key works for your project only.
Only an admin creates, rotates and revokes keys. A member sees Ask an admin of {org} for a key. Admins create, rotate and revoke keys. in place of the buttons.
Create a key
- In the sidebar, open Mubit keys.
- Select Create key.
- Enter a Name, such as the name of your app.
- Leave Permission at Inference: calls this project.
- Select Create key.
- Copy the key. The console says
Copy this key now. It won't be shown again.
Inference and read-only keys
A key has one of two permissions. You choose it when you create the key.
- Inference: calls this project: for apps that send calls. Your app needs this one.
- Read only: reads its records: reads this project's records. Calls sent with it are refused with
403 key_permission.
The key list
Each row shows a key's:
- Name;
- Key: its first characters and a mask, never the whole key;
- Permission:
InferenceorRead only; - Created;
- Expires: the date the key stops working, or
never; - Last used:
never, or up to about 90 seconds behind the key's last call; - Status:
Active,RevokedorExpired.
Before a key's Expires date, replace it, as Replace a key without stopping your app shows.
Rotate a key
Rotating gives a key a new secret. The key keeps its name and its permission, and its lifetime starts again from now.
Rotating leaves no time to switch over. Mubit stops accepting the old secret within about 30 seconds, and the dialog says how soon. An app that still sends the old secret then gets 401 invalid_key. To change the key of an app that is running, follow Replace a key without stopping your app instead.
- On the key's row, open the menu.
- Select Rotate…. The dialog
Rotate {name}?opens and says how soon the old secret stops working. - Select Rotate key.
- Copy the new secret. It is shown once.
- Put the new secret in your app.
You can rotate an active or an expired key. A revoked key can't be rotated: create a new key instead.
Replace a key without stopping your app
Rotating stops the old secret within seconds. For an app that is running, use a second key:
- Create a key with the same permission.
- Put the new key in your app, and deploy it.
- Check that the app's calls work with the new key. Its Last used shows a time within about 90 seconds of its first call.
- Revoke the old key.
Revoke a key
- On the key's row, open the menu.
- Select Revoke…. The dialog
Revoke {name}?opens. - Select Revoke key.
The key's status reads Revoked. The line under the list says how soon Mubit refuses a revoked key: A revoked key is refused within a minute. After that, calls with the key get 401 invalid_key.
The console can't turn a revoked key back on or rotate it. To call again, create a new key and put it in your app.