@north-light/identity 0.3.483 → 0.3.484

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -22,7 +22,7 @@ export interface IdTokenClaims extends JWTPayload {
22
22
  family_name?: string;
23
23
  picture?: string;
24
24
  }
25
- export type Scope = 'crtr:llm' | 'crtr:act' | 'crtr:schedule' | `crtr:memory:${'read' | 'rw'}:user${'' | `:${string}`}` | 'crtr:memory:manage:user' | `crtr:memory:${'read' | 'rw'}:app:${string}` | `crtr:files:${'read' | 'rw'}:${'user' | `app:${string}`}:${string}` | 'crtr:files:share' | `crtr:${'conversations' | 'objects'}:read:app:${string}` | `crtr:objects:${'message' | 'spawn'}:app:${string}` | `crtr:peer:${string}` | `${string}:${string}`;
25
+ export type Scope = 'crtr:llm' | 'crtr:act' | 'crtr:schedule' | `crtr:memory:${'read' | 'rw'}:user${'' | `:${string}`}` | 'crtr:memory:manage:user' | `crtr:memory:${'read' | 'rw'}:app:${string}` | `crtr:files:${'read' | 'rw'}:${'user' | `app:${string}`}:${string}` | 'crtr:files:share' | `crtr:${'conversations' | 'objects'}:read:app:${string}` | `crtr:objects:${'message' | 'spawn'}:app:${string}` | `crtr:objects:${'read' | 'watch' | 'link' | 'write'}:${'user' | 'node' | `profile:${string}` | `app:${string}`}` | `crtr:peer:${string}` | `${string}:${string}`;
26
26
  /** App-memory form keys omit the app id. */
27
27
  export declare const ENFORCED: ReadonlySet<string>;
28
28
  export declare function parseScope(value: string, grantee?: string): Scope;
package/dist/index.js CHANGED
@@ -31,8 +31,12 @@ function selector(value) {
31
31
  match = /^crtr:files:(read|rw):(user|app:[A-Za-z0-9_-]{1,64}):(.+)$/.exec(value);
32
32
  if (match && validPath(match[3], true))
33
33
  return { kind: 'files', access: match[1], holder: match[2], path: match[3] };
34
- // read, message and spawn are three unrelated scopes: `covers` is exact equality for them.
35
- match = /^crtr:(?:(conversations):read|(objects):(?:read|message|spawn)):app:([A-Za-z0-9_-]{1,64})$/.exec(value);
34
+ // Canvas object scopes `crtr:objects:<read|watch|link|write>:<user|node|profile:<p>|app:<x>>`. They, and the
35
+ // message and spawn scopes below, are unrelated scopes: `covers` is exact equality for every one of them.
36
+ match = /^crtr:objects:(?:read|watch|link|write):(?:user|node|profile:[A-Za-z0-9_-]{1,64}|app:[A-Za-z0-9_-]{1,64})$/.exec(value);
37
+ if (match)
38
+ return { kind: 'objects', value };
39
+ match = /^crtr:(?:(conversations):read|(objects):(?:message|spawn)):app:([A-Za-z0-9_-]{1,64})$/.exec(value);
36
40
  if (match)
37
41
  return { kind: (match[1] ?? match[2]), value };
38
42
  match = /^crtr:peer:([A-Za-z0-9_-]{1,64})$/.exec(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/identity",
3
- "version": "0.3.483",
3
+ "version": "0.3.484",
4
4
  "description": "Northlight access-token verification and scope rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",