@webex/plugin-encryption 3.12.0 → 3.13.0-next.10

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.
@@ -0,0 +1,467 @@
1
+ {
2
+ "$schema": "./schemas/repo-context.schema.json",
3
+ "version": 1,
4
+ "repository": {
5
+ "name": "@webex/plugin-encryption",
6
+ "purpose": "Public Webex JS SDK plugin registered as webex.cypher that downloads and decrypts encrypted Webex files. downloadAndDecryptFile reads the KMS key URI and the JWE-encrypted SCR from the keyUri and JWE query parameters of the file URL, or from the options, asks webex.internal.encryption to decrypt the SCR with the KMS key, and returns the internal download of the file decrypted with that SCR, either directly from the URL (the default) or through the Webex files service. register and deregister register the SDK device with WDM through webex.internal.device and track the result in a registered flag. The package main, src/webex.js, is a small CommonJS Webex constructor that loads only the authorization, internal encryption, and cypher plugins; the workspace also builds it as the UMD encryption bundle."
7
+ },
8
+ "commands": {
9
+ "install": "yarn",
10
+ "compile": "yarn workspace @webex/plugin-encryption build",
11
+ "build": "yarn workspace @webex/plugin-encryption build:src",
12
+ "unit-test": "yarn workspace @webex/plugin-encryption test:unit",
13
+ "lint": "yarn workspace @webex/plugin-encryption test:style",
14
+ "browser-test": "yarn workspace @webex/plugin-encryption test:browser",
15
+ "docs-build": "yarn workspace @webex/plugin-encryption build:docs",
16
+ "deploy": "yarn workspace @webex/plugin-encryption deploy:npm"
17
+ },
18
+ "public_interfaces": [
19
+ {
20
+ "name": "@webex/plugin-encryption package main",
21
+ "kind": "package_export",
22
+ "source": "src/webex.js",
23
+ "entrypoints": [
24
+ "const Webex = require('@webex/plugin-encryption')",
25
+ "import Webex from '@webex/plugin-encryption'",
26
+ "Webex.init(attrs)"
27
+ ],
28
+ "audience": "applications that only download and decrypt files",
29
+ "notes": "main and exports['.'] load dist/webex.js, whose CommonJS export is a Webex constructor with authorization, internal encryption, and cypher. Webex.init merges the compiled webex-config module object, so its defaults land under config.default and are not applied, and the types entry declares a default Cypher instead; both are known defects in the module spec Evidence register."
30
+ },
31
+ {
32
+ "name": "cypher plugin registration and types",
33
+ "kind": "package_export",
34
+ "source": "src/index.ts",
35
+ "entrypoints": [
36
+ "require('@webex/plugin-encryption')",
37
+ "import type {FileDownloadOptions, IEncryption} from '@webex/plugin-encryption'"
38
+ ],
39
+ "audience": "SDK bundles (webex, webex-node) and TypeScript consumers",
40
+ "notes": "Registers public plugin cypher with config {cypher: {}}; first registration of the name wins. Requiring the package loads the main, which requires this entry, so the webex and webex-node packages get cypher as a side effect. devMain and the typedoc entry point here, but no workspace resolver reads devMain; types is dist/types/index.d.ts, emitted by yarn build."
41
+ },
42
+ {
43
+ "name": "webex.cypher methods",
44
+ "kind": "plugin_api",
45
+ "source": "src/cypher/index.ts",
46
+ "entrypoints": [
47
+ "webex.cypher.register()",
48
+ "webex.cypher.deregister()",
49
+ "webex.cypher.downloadAndDecryptFile(fileUri, options)",
50
+ "webex.cypher.registered"
51
+ ],
52
+ "audience": "applications",
53
+ "notes": "register and deregister call webex.internal.device and flip the registered flag only on success; registered is a public writable field, so callers can also set it without a device call. downloadAndDecryptFile takes keyUri and JWE from the URL query, else both from options.keyUri and options.jwe, calls internal decryptScr then download with useFileService (default false). decryptScr errors are wrapped with cause (MOD-008); download errors are not (a known defect)."
54
+ },
55
+ {
56
+ "name": "package scripts",
57
+ "kind": "npm_scripts",
58
+ "source": "package.json",
59
+ "entrypoints": [
60
+ "build",
61
+ "build:src",
62
+ "build:docs",
63
+ "test:unit",
64
+ "test:style",
65
+ "test:browser",
66
+ "deploy:npm"
67
+ ],
68
+ "audience": "contributors and CI",
69
+ "notes": "build:src compiles src to dist with webex-legacy-tools and then runs build, which emits declarations to dist/types. test:unit runs jest with an 85% global coverage threshold (jest.config.js). test:browser runs nothing because there is no test/integration directory. build:docs writes typedoc output outside the package. There is no aggregate test script and no test:integration script."
70
+ }
71
+ ],
72
+ "source_of_truth": [
73
+ {
74
+ "surface": "Cypher plugin implementation",
75
+ "paths": [
76
+ "src/index.ts",
77
+ "src/cypher/index.ts",
78
+ "src/cypher/types.ts",
79
+ "src/cypher/constants.ts",
80
+ "src/types.ts",
81
+ "src/config.ts",
82
+ "src/webex.js",
83
+ "src/webex-config.ts"
84
+ ],
85
+ "generated_artifacts": [
86
+ "dist"
87
+ ],
88
+ "refresh_with": [
89
+ "yarn workspace @webex/plugin-encryption build:src"
90
+ ],
91
+ "validate_with": [
92
+ "yarn workspace @webex/plugin-encryption test:unit",
93
+ "yarn workspace @webex/plugin-encryption test:style"
94
+ ]
95
+ },
96
+ {
97
+ "surface": "module specification",
98
+ "paths": [
99
+ "src/docs/README.md"
100
+ ],
101
+ "generated_artifacts": [],
102
+ "refresh_with": [
103
+ "update alongside the behavior change in the same commit"
104
+ ],
105
+ "validate_with": [
106
+ "spec-validator on an independent runtime"
107
+ ]
108
+ }
109
+ ],
110
+ "generated_artifacts": [
111
+ {
112
+ "path": "dist",
113
+ "generated_from": "src",
114
+ "refresh_with": "yarn workspace @webex/plugin-encryption build:src"
115
+ },
116
+ {
117
+ "path": "../../../.sdd/templates/repo-standards/template-map.json",
118
+ "generated_from": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
119
+ "refresh_with": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package."
120
+ }
121
+ ],
122
+ "validation_matrix": [
123
+ {
124
+ "paths": [
125
+ "src/**"
126
+ ],
127
+ "minimum": [
128
+ "yarn workspace @webex/plugin-encryption build:src",
129
+ "yarn workspace @webex/plugin-encryption test:unit",
130
+ "yarn workspace @webex/plugin-encryption test:style"
131
+ ],
132
+ "recommended": [
133
+ "add a test/unit/spec/cypher case for the changed behavior; keep the 85% coverage threshold met"
134
+ ]
135
+ },
136
+ {
137
+ "paths": [
138
+ "src/webex.js",
139
+ "src/webex-config.ts",
140
+ "src/index.ts"
141
+ ],
142
+ "minimum": [
143
+ "yarn workspace @webex/plugin-encryption build:src",
144
+ "yarn workspace @webex/plugin-encryption test:style"
145
+ ],
146
+ "recommended": [
147
+ "no unit case loads these files and the coverage threshold does not measure them; check the built dist/webex.js by hand and the webex and webex-node packages that require this one"
148
+ ]
149
+ }
150
+ ],
151
+ "change_impact": [
152
+ {
153
+ "paths": [
154
+ "src/cypher/index.ts"
155
+ ],
156
+ "affects": [
157
+ "the three webex.cypher methods, their errors, and the registered flag"
158
+ ],
159
+ "refresh_with": [
160
+ "yarn workspace @webex/plugin-encryption build:src"
161
+ ],
162
+ "validate_with": [
163
+ "yarn workspace @webex/plugin-encryption test:unit",
164
+ "yarn workspace @webex/plugin-encryption test:style"
165
+ ],
166
+ "avoid_direct_edits": [
167
+ "dist"
168
+ ],
169
+ "notes": "decryptScr errors are wrapped (MOD-008); the unwrapped download error and the unobservable progress events are known defects in the module spec Evidence register."
170
+ },
171
+ {
172
+ "paths": [
173
+ "src/webex.js",
174
+ "src/webex-config.ts"
175
+ ],
176
+ "affects": [
177
+ "the package main",
178
+ "the UMD encryption bundle built by the workspace"
179
+ ],
180
+ "refresh_with": [
181
+ "yarn workspace @webex/plugin-encryption build:src"
182
+ ],
183
+ "validate_with": [
184
+ "yarn workspace @webex/plugin-encryption test:style"
185
+ ],
186
+ "avoid_direct_edits": [
187
+ "dist"
188
+ ],
189
+ "notes": "The webex-config defaults are not applied today (a known defect in the module spec Evidence register); fixing that changes the device and storage config of every standalone instance."
190
+ },
191
+ {
192
+ "paths": [
193
+ "src/index.ts",
194
+ "src/cypher/types.ts",
195
+ "package.json"
196
+ ],
197
+ "affects": [
198
+ "the registered plugin name",
199
+ "the published types"
200
+ ],
201
+ "refresh_with": [
202
+ "yarn workspace @webex/plugin-encryption build:src"
203
+ ],
204
+ "validate_with": [
205
+ "yarn workspace @webex/plugin-encryption test:unit",
206
+ "yarn workspace @webex/plugin-encryption test:style"
207
+ ],
208
+ "avoid_direct_edits": [
209
+ "dist"
210
+ ],
211
+ "notes": "The types entry and main disagree on the default export (a known defect in the module spec Evidence register)."
212
+ }
213
+ ],
214
+ "evidence_rules": [
215
+ {
216
+ "claim_category": "command_name",
217
+ "sources": [
218
+ "package.json"
219
+ ],
220
+ "requirement": "The script must exist in package.json scripts.",
221
+ "notes": "There is no test, test:integration, or test:coverage script in this package."
222
+ },
223
+ {
224
+ "claim_category": "import_path",
225
+ "sources": [
226
+ "src/index.ts",
227
+ "src/webex.js",
228
+ "package.json"
229
+ ],
230
+ "requirement": "The runtime default export is what package.json main loads (src/webex.js); the typed exports are those of src/index.ts.",
231
+ "notes": "They differ (a known defect in the module spec Evidence register)."
232
+ },
233
+ {
234
+ "claim_category": "behavior_claim",
235
+ "sources": [
236
+ "src",
237
+ "test/unit/spec"
238
+ ],
239
+ "requirement": "Ground every behavioral claim in source or test evidence.",
240
+ "notes": "Commit history is not an evidence source for this package. README.md and developer-quickstart.md are context only (docs/adr/0001-retain-product-docs.md). Dependency specs were consulted where present (internal-plugin-encryption, internal-plugin-device, webex-core, plugin-authorization, webex); test-helper-mock-webex has no spec, so its code was read."
241
+ }
242
+ ],
243
+ "negative_guidance": [
244
+ {
245
+ "rule": "Do not decrypt, fetch keys, or download in this plugin; call webex.internal.encryption.",
246
+ "why": "One implementation of key handling and download rules (module spec Design overview)."
247
+ },
248
+ {
249
+ "rule": "Do not mix a key URI from the URL with a JWE from the options.",
250
+ "why": "They are one pair from one source (INV-001)."
251
+ },
252
+ {
253
+ "rule": "Do not log key URIs, JWEs, SCRs, file bytes, or tokens.",
254
+ "why": "They grant access to encrypted content (INV-003)."
255
+ },
256
+ {
257
+ "rule": "Do not assume src/webex-config.ts defaults apply to Webex.init instances.",
258
+ "why": "They are merged under config.default (a known defect in the module spec Evidence register)."
259
+ },
260
+ {
261
+ "rule": "Do not trust a test:unit result without a fresh build:src of the sibling packages.",
262
+ "why": "The unit spec imports @webex/internal-plugin-encryption by name, which loads its dist."
263
+ }
264
+ ],
265
+ "confidence_policy": {
266
+ "high": {
267
+ "action": "update",
268
+ "expectation": "Source and a unit case agree, as for register, deregister, the options fallback, and the missing-values rejection."
269
+ },
270
+ "medium": {
271
+ "action": "narrow-scope",
272
+ "expectation": "Only source or a generator probe exists, as for the URL-wins rule, Webex.init, and the known defects. Pin current behavior with a unit case before modifying."
273
+ },
274
+ "low": {
275
+ "action": "noop",
276
+ "expectation": "Neither source, tests, nor a dependency's spec or code settles the question, as for why the invalid-URL message names the JWE. Stop and report the gap."
277
+ }
278
+ },
279
+ "repository_topology": {
280
+ "main_entrypoints": [
281
+ {
282
+ "name": "package main",
283
+ "path": "src/webex.js",
284
+ "purpose": "Standalone Webex constructor; also the workspace UMD encryption entry",
285
+ "notes": "package.json main and exports['.'] are dist/webex.js."
286
+ },
287
+ {
288
+ "name": "typed entry",
289
+ "path": "src/index.ts",
290
+ "purpose": "Registers the cypher plugin and exports its types",
291
+ "notes": "package.json devMain; types is dist/types/index.d.ts."
292
+ }
293
+ ],
294
+ "workspace_packages": [
295
+ {
296
+ "name": "@webex/plugin-encryption",
297
+ "paths": [
298
+ "src",
299
+ "test"
300
+ ],
301
+ "notes": "One module; this SDD root is the package directory inside the webex-js-sdk monorepo."
302
+ }
303
+ ],
304
+ "source_surfaces": [
305
+ {
306
+ "name": "Cypher plugin",
307
+ "paths": [
308
+ "src"
309
+ ],
310
+ "notes": "Eight source files. Specified at src/docs/README.md."
311
+ },
312
+ {
313
+ "name": "tests",
314
+ "paths": [
315
+ "test/unit/spec"
316
+ ],
317
+ "notes": "One jest unit file with 11 cases; no integration tests."
318
+ }
319
+ ],
320
+ "generated_surfaces": [
321
+ {
322
+ "name": "build output",
323
+ "paths": [
324
+ "dist"
325
+ ],
326
+ "generated_from": "src",
327
+ "refresh_with": "yarn workspace @webex/plugin-encryption build:src",
328
+ "notes": "JavaScript, source maps, and dist/types declarations. Do not edit by hand."
329
+ },
330
+ {
331
+ "name": "repo-standards template map",
332
+ "paths": [
333
+ "../../../.sdd/templates/repo-standards"
334
+ ],
335
+ "generated_from": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
336
+ "refresh_with": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package.",
337
+ "notes": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package."
338
+ }
339
+ ],
340
+ "validation_entrypoints": [
341
+ {
342
+ "name": "compile",
343
+ "command": "yarn workspace @webex/plugin-encryption build",
344
+ "scope": "src",
345
+ "notes": "tsc emitting declarations only to dist/types."
346
+ },
347
+ {
348
+ "name": "unit-test",
349
+ "command": "yarn workspace @webex/plugin-encryption test:unit",
350
+ "scope": "test/unit/spec",
351
+ "notes": "Jest through webex-legacy-tools with the 85% global coverage threshold over the files the spec loads."
352
+ },
353
+ {
354
+ "name": "lint",
355
+ "command": "yarn workspace @webex/plugin-encryption test:style",
356
+ "scope": "src",
357
+ "notes": "eslint via the local .eslintrc.js; docs/** and *.md are ignored."
358
+ }
359
+ ],
360
+ "sync_paths": [
361
+ {
362
+ "source": "src/cypher/index.ts",
363
+ "targets": [
364
+ "src/docs/README.md",
365
+ "README.md"
366
+ ],
367
+ "mechanism": "Manual; update the module specification in the same change that alters observable behavior, and check the README sample code.",
368
+ "notes": "Keep requirements, invariants, the state machine, and failure modes aligned with src/."
369
+ },
370
+ {
371
+ "source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
372
+ "targets": [
373
+ "../../../.sdd/templates/repo-standards"
374
+ ],
375
+ "mechanism": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package.",
376
+ "notes": "The package holds no templates. It refers to the monorepo root snapshot at ../../../.sdd/templates/repo-standards through layout.monorepo_package.templates_root_path in .sdd/manifest.json. Refresh the root snapshot, not this package."
377
+ }
378
+ ]
379
+ },
380
+ "folder_readme_contract": {
381
+ "required_sections": [
382
+ "purpose",
383
+ "boundaries",
384
+ "key-files",
385
+ "common-tasks"
386
+ ],
387
+ "rules": [
388
+ "Orient the reader before describing detail.",
389
+ "Link to the module specification rather than duplicating it."
390
+ ],
391
+ "example_policy": "Examples are allowed only when verified against src/ or test/.",
392
+ "fallback": "Omit a section rather than inventing content; report unresolved facts as gaps."
393
+ },
394
+ "regression_feedback_rules": [
395
+ {
396
+ "trigger": "downloadAndDecryptFile changes in src/cypher/index.ts.",
397
+ "required_followups": [
398
+ "Add cases for the URL-wins, one-value, invalid-URL, and error-shape paths to test/unit/spec/cypher/index.ts",
399
+ "Update MOD-005 to MOD-008, INV-001, and the download known defects in src/docs/README.md"
400
+ ],
401
+ "notes": "Today the failure cases assert substrings only."
402
+ },
403
+ {
404
+ "trigger": "register or deregister changes.",
405
+ "required_followups": [
406
+ "Assert the registered flag after failures",
407
+ "Update MOD-003, MOD-004, INV-002, and the State machine in src/docs/README.md"
408
+ ],
409
+ "notes": "Concurrent calls are not deduplicated."
410
+ },
411
+ {
412
+ "trigger": "src/webex.js, src/webex-config.ts, or the package.json entries change.",
413
+ "required_followups": [
414
+ "Re-run the main-entry probe or add a unit case that loads the built main",
415
+ "Update MOD-011 and the types and config known defects in src/docs/README.md and check the webex package spec MOD-019"
416
+ ],
417
+ "notes": "These files have no unit coverage."
418
+ }
419
+ ],
420
+ "surface_owners": [
421
+ {
422
+ "surface": "module implementation and specifications",
423
+ "owner": "@webex/web-sdk",
424
+ "edit_boundary": "The monorepo .github/CODEOWNERS default rule assigns @webex/web-sdk; no line names this package."
425
+ }
426
+ ],
427
+ "do_not_edit": [
428
+ "dist",
429
+ "../../../.sdd/templates/repo-standards"
430
+ ],
431
+ "marker_scopes": {
432
+ "sdd": [
433
+ ".sdd/manifest.json",
434
+ "src/docs/README.md",
435
+ "docs"
436
+ ]
437
+ },
438
+ "fallback_rules": [
439
+ "When source and tests disagree, code is the referee and the disagreement is recorded rather than silently resolved.",
440
+ "When neither source nor tests settle a question, report it as a gap instead of inferring.",
441
+ "Commit history is not a valid rationale source for this package.",
442
+ "When a dependency's specification disagrees with that dependency's code, use the code and record the disagreement; when a dependency has no specification, use its code."
443
+ ],
444
+ "downstream_context_pack": {
445
+ "required_human_surfaces": [
446
+ "README.md",
447
+ "docs/index.md",
448
+ "docs/architecture.md",
449
+ "src/docs/README.md"
450
+ ],
451
+ "required_agent_operational_surfaces": [
452
+ "AGENTS.md",
453
+ "docs/specs/README.md"
454
+ ],
455
+ "required_machine_readable_surface": ".sdd/manifest.json",
456
+ "recommended_machine_readable_sections": [
457
+ "public_interfaces",
458
+ "change_impact",
459
+ "evidence_rules",
460
+ "negative_guidance",
461
+ "confidence_policy",
462
+ "repository_topology",
463
+ "folder_readme_contract",
464
+ "regression_feedback_rules"
465
+ ]
466
+ }
467
+ }