5d6ea33166
## What `buildJwtAbility` — the decoder for public-token scope strings (`read:tags:…`, `read:runs:run_abc`, `admin`, …) — now lives in `@trigger.dev/plugins` as the single source of truth. `@trigger.dev/rbac` re-exports it, so the built-in fallback and any auth plugin interpret a token identically. Scope strings are split on only the first **two** colons (`action:type:id`), so a resource id that itself contains colons — e.g. a tag like `user:123` — is matched in full rather than truncated to its first segment. (The fallback already did this; this makes it the one shared implementation.) `@trigger.dev/plugins` is now **private (unpublished)** and gains a `@triggerdotdev/source` export condition, so consumers bundle it from source per-commit like `@trigger.dev/core` instead of resolving a published version — no cross-version coordination. ## Why Two hand-maintained copies of the scope grammar drift, and the difference silently changes what a token grants. One shared decoder removes that class of bug. ## Notes - No changeset: `@trigger.dev/plugins` is now private and `@trigger.dev/rbac` is internal — neither is published. - Unit coverage for the colon-id path lives in `internal-packages/rbac/src/ability.test.ts` (now exercising the shared function).
51 lines
1.1 KiB
JSON
51 lines
1.1 KiB
JSON
{
|
|
"name": "@trigger.dev/plugins",
|
|
"version": "4.5.0-rc.5",
|
|
"description": "Plugin contracts and interfaces for Trigger.dev",
|
|
"license": "MIT",
|
|
"private": true,
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/triggerdotdev/trigger.dev",
|
|
"directory": "packages/plugins"
|
|
},
|
|
"type": "module",
|
|
"files": [
|
|
"dist"
|
|
],
|
|
"dependencies": {
|
|
"@trigger.dev/core": "workspace:*"
|
|
},
|
|
"scripts": {
|
|
"clean": "rimraf dist .turbo",
|
|
"build": "tsup",
|
|
"dev": "tsup --watch",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^20.14.14",
|
|
"rimraf": "6.0.1",
|
|
"tsup": "^8.4.0",
|
|
"typescript": "^5.3.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=18.20.0"
|
|
},
|
|
"main": "./dist/index.cjs",
|
|
"module": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"import": {
|
|
"@triggerdotdev/source": "./src/index.ts",
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
},
|
|
"require": {
|
|
"types": "./dist/index.d.cts",
|
|
"default": "./dist/index.cjs"
|
|
}
|
|
}
|
|
}
|
|
}
|