@frockbot/kernel-do 0.3.15 → 0.3.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frockbot/kernel-do",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -12,8 +12,8 @@
12
12
  "typecheck": "tsc --noEmit -p tsconfig.json"
13
13
  },
14
14
  "dependencies": {
15
- "@frockbot/kernel-composition": "0.3.15",
16
- "@frockbot/kernel-contracts": "0.3.15",
15
+ "@frockbot/kernel-composition": "0.3.17",
16
+ "@frockbot/kernel-contracts": "0.3.17",
17
17
  "cordis": "4.0.0-rc.8"
18
18
  },
19
19
  "devDependencies": {
@@ -58,7 +58,12 @@ describe("Applet ids", () => {
58
58
  expect(appletIdV1("user-42", "d".repeat(32))).toBe(
59
59
  `user-42.${"d".repeat(32)}`,
60
60
  );
61
- expect(() => appletIdV1("User-42", "d".repeat(32))).toThrow();
61
+ // A User id as Better Auth mints it: mixed case, 32 characters.
62
+ expect(appletIdV1("vgpqfaCcwnPlzjYdb2mIfNcOW1YV0SkG", "d".repeat(32))).toBe(
63
+ `vgpqfaCcwnPlzjYdb2mIfNcOW1YV0SkG.${"d".repeat(32)}`,
64
+ );
65
+ expect(() => appletIdV1("user 42", "d".repeat(32))).toThrow();
66
+ expect(() => appletIdV1("", "d".repeat(32))).toThrow();
62
67
  expect(() => appletIdV1("user-42", "nope")).toThrow();
63
68
  });
64
69
 
package/src/applets.ts CHANGED
@@ -413,7 +413,9 @@ async function sha256Hex(value: string): Promise<string> {
413
413
  }
414
414
 
415
415
  const APPLET_SECRET_V1 = /^[0-9a-f]{32}$/;
416
- const APPLET_OWNER_V1 = /^[a-z0-9][a-z0-9-]{0,63}$/;
416
+ // A User id as the auth layer mints it: mixed case, underscore allowed. Must
417
+ // agree with `APPLET_ID_V1`'s owner half.
418
+ const APPLET_OWNER_V1 = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,95}$/;
417
419
 
418
420
  /**
419
421
  * `<publicUserId>.<random>` — ADR 0015's share-id shape, reused.