Errors
The AdminError the Admin SDK throws, and its codes.
import { AdminError } from "@nylorun/admin";
try {
await admin.keys.put("backend");
} catch (error) {
if (error instanceof AdminError && error.code === "key_role_mismatch") {
// an application key was sent to the Management API
}
throw error;
}Every failure is an AdminError.
| Field | Type | Purpose |
|---|---|---|
code | ErrorCode | The cause, from the error registry |
status | number | undefined | The HTTP status, when the Runtime answered |
details | unknown | Extra data from the Runtime |
Codes
| Code | Cause |
|---|---|
connection_missing | No URL and management key resolved |
incompatible_host | The Runtime does not serve protocol 8 with the Management API |
key_role_mismatch | An application key was sent to the Management API (403) |
subject_invalid | A management key was sent with Nylorun-Subject or Nylorun-Scopes (403) |
origin_rejected | A key was sent from a browser (403) |
Other codes come from the Runtime and are listed on each endpoint page.
Connect
Point the Admin SDK at a Tenant with a management key.
Get who the caller is GET
The subject, scopes, agents and sandbox grants of the credential that sends it: an application key (alone or acting for a subject), a management key (`via: management:<principalId>`, no scopes, no agents), or a trusted issuer's token (`via: issuer:<name>`).