@suveren/gateway 0.4.0 → 0.5.0

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.
Files changed (98) hide show
  1. package/bin/suveren-gateway.js +59 -0
  2. package/content/integrations/calendar.json +116 -22
  3. package/content/integrations/gmail.json +3 -0
  4. package/dist/control-plane/index.mjs +67 -7
  5. package/dist/mcp-server/http.mjs +98 -17
  6. package/dist/ui/assets/index-DedRWpBs.js +105 -0
  7. package/dist/ui/index.html +1 -1
  8. package/lib/autostart-templates.d.mts +37 -0
  9. package/lib/autostart-templates.mjs +208 -0
  10. package/node_modules/jose/README.md +13 -13
  11. package/node_modules/jose/dist/types/index.d.ts +6 -5
  12. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +17 -11
  13. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +7 -19
  14. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +17 -11
  15. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +7 -19
  16. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +18 -13
  17. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +20 -21
  18. package/node_modules/jose/dist/types/jwk/embedded.d.ts +8 -12
  19. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -15
  20. package/node_modules/jose/dist/types/jwks/local.d.ts +12 -21
  21. package/node_modules/jose/dist/types/jwks/remote.d.ts +34 -165
  22. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +2 -13
  23. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +17 -13
  24. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +2 -13
  25. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +17 -13
  26. package/node_modules/jose/dist/types/jws/general/sign.d.ts +16 -17
  27. package/node_modules/jose/dist/types/jws/general/verify.d.ts +18 -15
  28. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +17 -11
  29. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +10 -34
  30. package/node_modules/jose/dist/types/jwt/sign.d.ts +2 -13
  31. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +4 -13
  32. package/node_modules/jose/dist/types/jwt/verify.d.ts +14 -13
  33. package/node_modules/jose/dist/types/key/export.d.ts +0 -14
  34. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +7 -14
  35. package/node_modules/jose/dist/types/key/generate_secret.d.ts +16 -14
  36. package/node_modules/jose/dist/types/key/import.d.ts +18 -28
  37. package/node_modules/jose/dist/types/types.d.ts +242 -223
  38. package/node_modules/jose/dist/types/util/base64url.d.ts +11 -4
  39. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -9
  40. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -8
  41. package/node_modules/jose/dist/types/util/errors.d.ts +128 -121
  42. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +3 -21
  43. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +5 -153
  44. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +16 -111
  45. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +15 -3
  46. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -48
  47. package/node_modules/jose/dist/webapi/jwk/embedded.js +5 -3
  48. package/node_modules/jose/dist/webapi/jwks/local.js +27 -47
  49. package/node_modules/jose/dist/webapi/jwks/remote.js +3 -3
  50. package/node_modules/jose/dist/webapi/jws/compact/sign.js +5 -2
  51. package/node_modules/jose/dist/webapi/jws/compact/verify.js +3 -15
  52. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +7 -57
  53. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +3 -89
  54. package/node_modules/jose/dist/webapi/jws/general/sign.js +18 -5
  55. package/node_modules/jose/dist/webapi/jws/general/verify.js +21 -3
  56. package/node_modules/jose/dist/webapi/jwt/decrypt.js +4 -4
  57. package/node_modules/jose/dist/webapi/jwt/sign.js +2 -3
  58. package/node_modules/jose/dist/webapi/jwt/unsecured.js +4 -3
  59. package/node_modules/jose/dist/webapi/jwt/verify.js +5 -5
  60. package/node_modules/jose/dist/webapi/key/export.js +34 -1
  61. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +32 -82
  62. package/node_modules/jose/dist/webapi/key/import.js +8 -8
  63. package/node_modules/jose/dist/webapi/lib/asn1.js +29 -65
  64. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +1 -0
  65. package/node_modules/jose/dist/webapi/lib/content_encryption.js +20 -77
  66. package/node_modules/jose/dist/webapi/lib/crypto_key.js +13 -127
  67. package/node_modules/jose/dist/webapi/lib/helpers.js +23 -0
  68. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +143 -0
  69. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +181 -0
  70. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +109 -0
  71. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +11 -96
  72. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +74 -0
  73. package/node_modules/jose/dist/webapi/lib/jws_sign.js +68 -0
  74. package/node_modules/jose/dist/webapi/lib/jws_verify.js +108 -0
  75. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +9 -8
  76. package/node_modules/jose/dist/webapi/lib/key.js +170 -0
  77. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +16 -0
  78. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +7 -0
  79. package/node_modules/jose/dist/webapi/lib/key_management.js +186 -29
  80. package/node_modules/jose/dist/webapi/lib/{validate_crit.js → options.js} +18 -0
  81. package/node_modules/jose/dist/webapi/lib/signing.js +20 -52
  82. package/node_modules/jose/dist/webapi/util/base64url.js +11 -3
  83. package/node_modules/jose/dist/webapi/util/decode_jwt.js +2 -2
  84. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -15
  85. package/node_modules/jose/dist/webapi/util/errors.js +1 -1
  86. package/node_modules/jose/package.json +2 -4
  87. package/package.json +2 -1
  88. package/profiles/email/0.4.profile.json +2 -1
  89. package/dist/ui/assets/index-BDQY7Z3H.js +0 -105
  90. package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -15
  91. package/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
  92. package/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
  93. package/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
  94. package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -34
  95. package/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -166
  96. package/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -42
  97. package/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
  98. package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
@@ -1,6 +1,4 @@
1
- import { decode as b64u } from './base64url.js';
2
- import { decoder } from '../lib/buffer_utils.js';
3
- import { isObject } from '../lib/type_checks.js';
1
+ import { parseJoseHeader } from '../lib/helpers.js';
4
2
  export function decodeProtectedHeader(token) {
5
3
  let protectedB64u;
6
4
  if (typeof token === 'string') {
@@ -18,17 +16,9 @@ export function decodeProtectedHeader(token) {
18
16
  throw new TypeError('Token does not contain a Protected Header');
19
17
  }
20
18
  }
21
- try {
22
- if (typeof protectedB64u !== 'string' || !protectedB64u) {
23
- throw new Error();
24
- }
25
- const result = JSON.parse(decoder.decode(b64u(protectedB64u)));
26
- if (!isObject(result)) {
27
- throw new Error();
28
- }
29
- return result;
30
- }
31
- catch {
32
- throw new TypeError('Invalid Token or Protected Header formatting');
19
+ const invalid = 'Invalid Token or Protected Header formatting';
20
+ if (typeof protectedB64u !== 'string' || !protectedB64u) {
21
+ throw new TypeError(invalid);
33
22
  }
23
+ return parseJoseHeader(protectedB64u, TypeError, invalid);
34
24
  }
@@ -76,7 +76,7 @@ export class JWKSNoMatchingKey extends JOSEError {
76
76
  }
77
77
  }
78
78
  export class JWKSMultipleMatchingKeys extends JOSEError {
79
- [Symbol.asyncIterator];
79
+ [Symbol.asyncIterator] = async function* () { };
80
80
  static code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
81
81
  code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
82
82
  constructor(message = 'multiple matching keys found in the JSON Web Key Set', options) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "6.2.4",
3
+ "version": "6.2.5",
4
4
  "description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
5
5
  "keywords": [
6
6
  "akp",
@@ -193,8 +193,6 @@
193
193
  "!dist/**/*.bundle.js",
194
194
  "!dist/**/*.umd.js",
195
195
  "!dist/**/*.min.js",
196
- "!dist/types/runtime/*",
197
- "!dist/types/lib/*",
198
- "!dist/deno/**/*"
196
+ "!dist/types/lib/**"
199
197
  ]
200
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suveren/gateway",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Suveren gateway — local agent gateway built in compliance with the Human Agency Protocol (HAP). Runs the UI, control plane, and MCP server in one Node process.",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -12,6 +12,7 @@
12
12
  },
13
13
  "files": [
14
14
  "bin",
15
+ "lib",
15
16
  "dist",
16
17
  "scripts",
17
18
  "content",
@@ -50,8 +50,9 @@
50
50
  "type": "number",
51
51
  "required": false,
52
52
  "displayName": "Max email age (days)",
53
- "description": "Maximum age in days for email search",
53
+ "description": "Maximum age in days for email search. Enforced locally by the Gatekeeper, never by the Authority Server: reads carry no receipt, so no signed check ever reads this value. Set it on the integration instead, where it is live-editable. Kept in the schema as the fallback for grants issued before that setting existed.",
54
54
  "unit": "days",
55
+ "enforcedBy": "gatekeeper",
55
56
  "boundType": {
56
57
  "kind": "per_transaction",
57
58
  "of": "read_age_days"