You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 11ed269
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: info/api-keys.mdx
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,9 +159,16 @@ print(api_key.key) # Save this value now. Kernel won't show it again.
159
159
### Expiry and revocation
160
160
161
161
- Use `expires_at` for an exact expiry, such as minutes from now, instead of `days_to_expire`. A scoped key can't outlive the key that creates it.
162
-
- An expired key is rejected immediately, and a deleted key within about 10 seconds. Neither revokes connection URLs (CDP, WebDriver, live view) the key already obtained. They keep working, including for new connections, until the browser is deleted, so delete the key's browsers to cut off access.
162
+
- Expired and deleted keys can't authenticate new API requests.
163
+
- Deleting a key through the API or dashboard, or rotating it with `expire_in_days: 0`, also ends browser sessions associated with that key. Cleanup runs asynchronously and discards unsaved profile changes.
164
+
- Grace-period expiry and natural expiry do **not** end existing browsers. Delete those browsers explicitly if you need to stop them.
165
+
- If browser cleanup can't be scheduled, deletion or immediate rotation fails without committing the key change.
163
166
- Rotating a scoped key keeps its policy.
164
167
168
+
<Note>
169
+
Automatic cleanup only covers browsers associated with the key. Some browsers created before this behavior was introduced may not have that association. Delete those browsers directly. Cleanup doesn't undo profile changes you've already saved, delete browser pools, or stop app invocations or deployments.
170
+
</Note>
171
+
165
172
Scoped keys can't manage API keys, and they get `403` on endpoints that don't support scoped access yet.
166
173
167
174
## Deployment API keys
@@ -243,7 +250,7 @@ func main() {
243
250
Rename a key when the owner or purpose changes. Delete a key when the workload no longer needs access.
244
251
245
252
<Warning>
246
-
An API key cannot delete itself. Authenticate with a different key when deleting a key, so the request cannot revoke the credential that is authorizing it.
253
+
An API key cannot delete itself. Authenticate with a different key when deleting a key, so the request cannot revoke the credential that is authorizing it. Deleting a key also ends its associated browsers asynchronously and discards their unsaved profile changes.
247
254
</Warning>
248
255
249
256
<CodeGroup>
@@ -376,7 +383,7 @@ After you rotate a key:
376
383
2. Deploy or restart the workload that uses `KERNEL_API_KEY`.
377
384
3. Verify the workload can call Kernel before the grace window ends.
378
385
379
-
To cut over immediately instead of using a grace window, pass `expire_in_days: 0` so the old key stops working as soon as the new one is issued.
386
+
To cut over immediately instead of using a grace window, pass `expire_in_days: 0`. The old key stops working, its associated browsers are ended asynchronously, and unsaved profile changes in those browsers are discarded. With a grace period, existing browsers keep running after the old key expires.
0 commit comments