space-data-module-sdk 0.8.14 → 0.8.16
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/bin/space-data-module.js +91 -0
- package/docs/_shell/consumer-assets.html +5 -0
- package/docs/browser-wasmedge-isomorphic.html +261 -0
- package/docs/byo-wasm-quickstart.html +226 -0
- package/docs/byo-wasm-quickstart.md +204 -0
- package/docs/conformance.html +156 -0
- package/docs/conformance.md +92 -0
- package/docs/emception-shared-memory-verdict.md +209 -0
- package/docs/events-abi.html +313 -0
- package/docs/events-abi.md +530 -0
- package/docs/families/analytics.html +178 -0
- package/docs/families/analytics.md +104 -0
- package/docs/families/attitude.html +157 -0
- package/docs/families/attitude.md +36 -0
- package/docs/families/behavior.html +157 -0
- package/docs/families/behavior.md +36 -0
- package/docs/families/breakup.html +157 -0
- package/docs/families/breakup.md +36 -0
- package/docs/families/conjunction.html +186 -0
- package/docs/families/conjunction.md +121 -0
- package/docs/families/data-source.html +318 -0
- package/docs/families/effects.html +157 -0
- package/docs/families/effects.md +36 -0
- package/docs/families/environment.html +170 -0
- package/docs/families/environment.md +73 -0
- package/docs/families/estimation.html +190 -0
- package/docs/families/estimation.md +128 -0
- package/docs/families/gnc.html +157 -0
- package/docs/families/gnc.md +36 -0
- package/docs/families/maneuver.html +209 -0
- package/docs/families/maneuver.md +206 -0
- package/docs/families/obstruction.html +191 -0
- package/docs/families/obstruction.md +96 -0
- package/docs/families/propagator.html +333 -0
- package/docs/families/propulsion.html +157 -0
- package/docs/families/propulsion.md +36 -0
- package/docs/families/reentry.html +157 -0
- package/docs/families/reentry.md +36 -0
- package/docs/families/rf.html +193 -0
- package/docs/families/rf.md +136 -0
- package/docs/families/scheduler.html +157 -0
- package/docs/families/scheduler.md +36 -0
- package/docs/families/sensor.html +157 -0
- package/docs/families/sensor.md +36 -0
- package/docs/families/signature.html +157 -0
- package/docs/families/signature.md +36 -0
- package/docs/flatsql-host-contract.html +176 -0
- package/docs/flatsql-streaming-standard.html +375 -0
- package/docs/gpu-module-abi.html +233 -0
- package/docs/harness-family-matrix.md +135 -0
- package/docs/index.html +216 -85
- package/docs/isomorphic-pthreads.html +228 -0
- package/docs/isomorphic-pthreads.md +84 -0
- package/docs/isomorphic-sdn-runtime-plan.html +274 -0
- package/docs/language-runtime-matrix.html +182 -0
- package/docs/llms.txt +86 -0
- package/docs/module-bundle-runtime-plan.html +146 -0
- package/docs/module-publication-standard.html +503 -0
- package/docs/node-red-default-node-parity.html +201 -0
- package/docs/propagator-abi.md +73 -21
- package/docs/protect-and-sign.html +181 -0
- package/docs/protect-and-sign.md +120 -0
- package/docs/protocol-installation.html +296 -0
- package/docs/publication-submission.html +158 -0
- package/docs/publication-submission.md +78 -0
- package/docs/secrets-capability.html +206 -0
- package/docs/styles.css +860 -167
- package/docs/testing-harness.html +408 -0
- package/docs/tri-runtime-parity-gate.html +182 -0
- package/docs/tri-runtime-parity.html +203 -0
- package/include/orbpro/orbpro_event_runner.h +951 -0
- package/include/orbpro/orbpro_events_abi.h +565 -0
- package/include/orbpro/orbpro_propagator_abi.h +17 -0
- package/package.json +15 -5
- package/schemas/orbpro/Events.fbs +501 -0
- package/schemas/orbpro/Propagator.fbs +72 -9
- package/schemas/orbpro/reference-frame-crosswalk.json +108 -0
- package/schemas/orbpro/reference-frame.lock.json +98 -0
- package/src/browser.js +13 -0
- package/src/conformance/abiDriver.js +225 -0
- package/src/conformance/index.js +151 -0
- package/src/conformance/propagatorSuite.js +526 -0
- package/src/conformance/selfTest.js +275 -0
- package/src/conformance/selfTestCorpus.js +68 -0
- package/src/conformance/twoBodyReference.js +132 -0
- package/src/generated/orbpro/events-abi.js +206 -0
- package/src/generated/orbpro/events-abi.ts +319 -0
- package/src/generated/orbpro/propagator/reference-frame.js +17 -0
- package/src/generated/orbpro/propagator/reference-frame.ts +91 -1
- package/src/generated/orbpro/propagator-abi.js +17 -0
- package/src/generated/orbpro/propagator-abi.ts +17 -0
- package/src/generated/spacedatastandards/plg/CCT.d.ts +94 -0
- package/src/generated/spacedatastandards/plg/CCT.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/CCT.js +208 -0
- package/src/generated/spacedatastandards/plg/CCT.ts +281 -0
- package/src/generated/spacedatastandards/plg/CCTCategory.d.ts +98 -0
- package/src/generated/spacedatastandards/plg/CCTCategory.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/CCTCategory.js +177 -0
- package/src/generated/spacedatastandards/plg/CCTCategory.ts +269 -0
- package/src/generated/spacedatastandards/plg/CCTCategoryRollup.d.ts +54 -0
- package/src/generated/spacedatastandards/plg/CCTCategoryRollup.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/CCTCategoryRollup.js +106 -0
- package/src/generated/spacedatastandards/plg/CCTCategoryRollup.ts +144 -0
- package/src/generated/spacedatastandards/plg/PLG.d.ts +46 -2
- package/src/generated/spacedatastandards/plg/PLG.d.ts.map +1 -1
- package/src/generated/spacedatastandards/plg/PLG.js +78 -5
- package/src/generated/spacedatastandards/plg/PLG.ts +90 -5
- package/src/generated/spacedatastandards/plg/capabilityClass.d.ts +181 -0
- package/src/generated/spacedatastandards/plg/capabilityClass.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/capabilityClass.js +183 -0
- package/src/generated/spacedatastandards/plg/capabilityClass.ts +208 -0
- package/src/generated/spacedatastandards/plg/main.d.ts +4 -0
- package/src/generated/spacedatastandards/plg/main.d.ts.map +1 -1
- package/src/generated/spacedatastandards/plg/main.js +4 -0
- package/src/generated/spacedatastandards/plg/main.ts +4 -0
- package/src/generated/spacedatastandards/plg/pluginCategory.d.ts +40 -2
- package/src/generated/spacedatastandards/plg/pluginCategory.d.ts.map +1 -1
- package/src/generated/spacedatastandards/plg/pluginCategory.js +40 -2
- package/src/generated/spacedatastandards/plg/pluginCategory.ts +40 -2
- package/src/host/browserModuleHarness.js +8 -0
- package/src/host/wasiThreadHost.js +189 -14
- package/src/index.d.ts +18 -1
- package/src/testing/isomorphicHarness.js +233 -0
- package/src/transport/index.js +16 -0
- package/src/transport/records.js +1015 -3
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Publication and listing
|
|
2
|
+
|
|
3
|
+
The last step of the integrator path: turn a signed artifact into something a
|
|
4
|
+
consumer can discover, fetch and load. Part of this is implemented and part of
|
|
5
|
+
it is still being built, and this page separates the two explicitly.
|
|
6
|
+
|
|
7
|
+
## What is implemented today
|
|
8
|
+
|
|
9
|
+
**The published artifact layout.** A protected artifact carries its records in a
|
|
10
|
+
trailer:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
protected-payload-bytes || REC-flatbuffer-bytes || uint32le(REC length) || "$REC"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`REC`, `MBL`, `PNM` and `ENC` are Space Data Standards FlatBuffer record types.
|
|
17
|
+
The SDK consumes the generated message classes; the schemas are ratified at
|
|
18
|
+
`spacedatastandards.org`. The full contract — which record carries the manifest,
|
|
19
|
+
which carries the bundle metadata, which carries the publication notice, and
|
|
20
|
+
which carries the encryption envelope — is the
|
|
21
|
+
[module publication standard](module-publication-standard.html).
|
|
22
|
+
|
|
23
|
+
**The artifact primitives.** `protect`, `sign` and `verify` are real commands
|
|
24
|
+
with real flags. See [Protect and sign](protect-and-sign.html).
|
|
25
|
+
|
|
26
|
+
**Post-publication loadability is gated.** The tri-runtime parity gate carries a
|
|
27
|
+
fixture for the *published* form of a module — the same artifact after its
|
|
28
|
+
signature and manifest records have been appended as a trailing custom section —
|
|
29
|
+
so the record-stripping and instantiation path is exercised by the gate, not
|
|
30
|
+
assumed. See the [parity gate](tri-runtime-parity-gate.html).
|
|
31
|
+
|
|
32
|
+
**Package distribution.** The publication standard also covers delivery through
|
|
33
|
+
conventional package ecosystems (npm, PyPI, Maven Central, NuGet, Go modules,
|
|
34
|
+
crates.io, Swift Package Manager) for the language bindings that accompany a
|
|
35
|
+
module.
|
|
36
|
+
|
|
37
|
+
## What is still being built
|
|
38
|
+
|
|
39
|
+
These are checked absences in the SDK today, not roadmap decoration:
|
|
40
|
+
|
|
41
|
+
- **No listing-submission command.** There is no `publish`, `submit` or `list`
|
|
42
|
+
subcommand. The CLI offers artifact-level primitives only.
|
|
43
|
+
- **No storefront or marketplace workflow in this repository.** A module
|
|
44
|
+
marketplace is a program in the wider stack; no listing code lives here.
|
|
45
|
+
- **No manifest injection for foreign-compiled binaries.** A BYO vendor's
|
|
46
|
+
artifact cannot yet be stamped with a manifest by a tool. See the
|
|
47
|
+
[BYO-wasm quickstart](byo-wasm-quickstart.html).
|
|
48
|
+
|
|
49
|
+
## The escorted path, which works now
|
|
50
|
+
|
|
51
|
+
Until self-serve submission lands, a vendor can complete the whole path with
|
|
52
|
+
help:
|
|
53
|
+
|
|
54
|
+
1. The vendor builds `module.wasm` on the pinned toolchain and supplies the
|
|
55
|
+
manifest JSON alongside it.
|
|
56
|
+
2. Conformance and the parity gate are run against the artifact — the vendor can
|
|
57
|
+
run both themselves and attach the output, or hand over the artifact and have
|
|
58
|
+
them run.
|
|
59
|
+
3. The artifact is protected and signed, and `verify` is run against the
|
|
60
|
+
published bytes with the intended trusted key set.
|
|
61
|
+
4. The publication records are attached and the module is listed by hand.
|
|
62
|
+
|
|
63
|
+
Nothing in that sequence requires the vendor to have access to a private
|
|
64
|
+
repository, and every gate in it is a real command whose output is the evidence.
|
|
65
|
+
|
|
66
|
+
## Submission checklist
|
|
67
|
+
|
|
68
|
+
Before handing over an artifact, confirm each of these:
|
|
69
|
+
|
|
70
|
+
| Check | Command or evidence |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| Built on the pinned toolchain | Link flags include `-Wl,--shared-memory` and `-Wl,--max-memory=2147483648` |
|
|
73
|
+
| No Emscripten anywhere in the build | Build log; the parity gate's import classifier will catch it |
|
|
74
|
+
| Family ABI conformance passes | `space-data-module conformance <family> --artifact <path>` |
|
|
75
|
+
| Tri-runtime parity passes | `space-data-module parity --wasm <path> --fixture <path> --lanes browser,wasmedge,docker-wasmedge` |
|
|
76
|
+
| Manifest declares family, invoke surface, runtime targets, record types | The manifest JSON |
|
|
77
|
+
| Signed with the intended key | `space-data-module verify --wasm <path> --trusted <hex> --require-signature` |
|
|
78
|
+
| Teardown does not leak | The conformance leak cycles reach steady state |
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="description" content="A module often needs an operator's third-party credential: a Space-Track login," />
|
|
7
|
+
<title>Credential lanes — Space Data Module SDK</title>
|
|
8
|
+
<link rel="stylesheet" href="./styles.css" />
|
|
9
|
+
<!-- SDN_CONSUMER_ASSETS_START -->
|
|
10
|
+
<link rel="stylesheet" href="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" crossorigin="anonymous">
|
|
11
|
+
<script defer src="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" crossorigin="anonymous" data-sdn-wallet-public-client="v1"></script>
|
|
12
|
+
<script defer src="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.52fde607eee38ffa116188201f50258ed50bd18c9f06c1af9678f763147a8fe5.js" integrity="sha384-dgeojhJ8vTszHXIbv7O7nZcEzqD10oUYYJjBmPrV7+kLQEUlXLQD4ek5Q7HOFiO5" crossorigin="anonymous" data-nav-style-url="https://static.spacedatanetwork.org/assets/sdn-stack-nav/1.0.0/sdn-stack-nav.36a36359ce18322185e9ff179f88175bab67d5ad84a14d9c08a54f2ff27267e7.css" data-nav-style-integrity="sha384-c4M8Fg+kYaeOYYtJVr7jJsde24IhSWkWaRyAOHEZU9jozhRck089aw+mnHwxymds" data-wallet-client-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.f611e7e151a3b5c38384272f8894a4c6634f0a29bf925b0e02e0e27f8db0bfff.js" data-wallet-client-integrity="sha384-R+QqsKoWJIS7iWrtPmgJ49DVnb1hSGjZokupbLInJd1PLp8RwQhtF/hnaerc33ci" data-wallet-style-url="https://static.spacedatanetwork.org/assets/hd-wallet-ui/2.0.28/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css" data-wallet-style-integrity="sha384-fICuhN4I9xqOK1F5vGGzl26opuO+xQIvTZXMSV76lWTBiQ6AfzztMGLLDw8yRT8i" data-wallet-client-id="sdn-module-sdk-pages-v1" data-wallet-callback-uri="https://digitalarsenal.github.io/space-data-module-sdk/wallet-callback.html" data-wallet-registry-sha256="e1ce6fe903c9700484a8a87d96581c8cad97063dabf63030b4518a31a3bdaa93"></script>
|
|
13
|
+
<!-- SDN_CONSUMER_ASSETS_END -->
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<a class="skip-link" href="#main">Skip to content</a>
|
|
17
|
+
<sdn-stack-nav active="module-sdk"></sdn-stack-nav>
|
|
18
|
+
<header class="site-header">
|
|
19
|
+
<a class="site-brand" href="./">Space Data Module SDK</a>
|
|
20
|
+
<nav class="header-links" aria-label="Site">
|
|
21
|
+
<a href="./byo-wasm-quickstart.html">Quickstart</a>
|
|
22
|
+
<a href="./conformance.html">Conformance</a>
|
|
23
|
+
<a href="https://github.com/DigitalArsenal/space-data-module-sdk">GitHub</a>
|
|
24
|
+
<a class="stack-button" href="#stack">Stack</a>
|
|
25
|
+
</nav>
|
|
26
|
+
</header>
|
|
27
|
+
<div class="shell">
|
|
28
|
+
<nav class="sidebar" id="sidebar" aria-label="Documentation">
|
|
29
|
+
<h2>Start here</h2><ul>
|
|
30
|
+
<li><a href="./index.html"><span>Harness family matrix</span></a></li>
|
|
31
|
+
<li><a href="./byo-wasm-quickstart.html"><span>BYO-wasm quickstart</span></a></li>
|
|
32
|
+
<li><a href="./conformance.html"><span>Conformance kit</span></a></li>
|
|
33
|
+
<li><a href="./protect-and-sign.html"><span>Protect and sign</span></a></li>
|
|
34
|
+
<li><a href="./publication-submission.html"><span>Publication and listing</span></a></li>
|
|
35
|
+
</ul>
|
|
36
|
+
<h2>Dynamics</h2><ul>
|
|
37
|
+
<li><a href="./families/propagator.html"><span>Propagator</span><span class="tag tag-shipped">shipped</span></a></li>
|
|
38
|
+
<li><a href="./families/maneuver.html"><span>Maneuver</span><span class="tag tag-experimental">experimental</span></a></li>
|
|
39
|
+
<li><a href="./families/propulsion.html"><span>Propulsion</span><span class="tag tag-planned">planned</span></a></li>
|
|
40
|
+
<li><a href="./families/attitude.html"><span>Attitude</span><span class="tag tag-planned">planned</span></a></li>
|
|
41
|
+
<li><a href="./families/gnc.html"><span>GNC</span><span class="tag tag-planned">planned</span></a></li>
|
|
42
|
+
</ul>
|
|
43
|
+
<h2>Environment and interaction</h2><ul>
|
|
44
|
+
<li><a href="./families/rf.html"><span>RF</span><span class="tag tag-designed">designed</span></a></li>
|
|
45
|
+
<li><a href="./families/sensor.html"><span>Sensor</span><span class="tag tag-planned">planned</span></a></li>
|
|
46
|
+
<li><a href="./families/signature.html"><span>Signature</span><span class="tag tag-planned">planned</span></a></li>
|
|
47
|
+
<li><a href="./families/environment.html"><span>Environment</span><span class="tag tag-planned">planned</span></a></li>
|
|
48
|
+
<li><a href="./families/obstruction.html"><span>Obstruction</span><span class="tag tag-designed">designed</span></a></li>
|
|
49
|
+
</ul>
|
|
50
|
+
<h2>Event physics</h2><ul>
|
|
51
|
+
<li><a href="./families/breakup.html"><span>Breakup</span><span class="tag tag-planned">planned</span></a></li>
|
|
52
|
+
<li><a href="./families/reentry.html"><span>Reentry</span><span class="tag tag-planned">planned</span></a></li>
|
|
53
|
+
<li><a href="./families/conjunction.html"><span>Conjunction</span><span class="tag tag-designed">designed</span></a></li>
|
|
54
|
+
<li><a href="./families/effects.html"><span>Effects</span><span class="tag tag-planned">planned</span></a></li>
|
|
55
|
+
</ul>
|
|
56
|
+
<h2>Estimation, data and logic</h2><ul>
|
|
57
|
+
<li><a href="./families/estimation.html"><span>Estimation</span><span class="tag tag-experimental">experimental</span></a></li>
|
|
58
|
+
<li><a href="./families/data-source.html"><span>Data source</span><span class="tag tag-shipped">shipped</span></a></li>
|
|
59
|
+
<li><a href="./families/analytics.html"><span>Analytics</span><span class="tag tag-experimental">experimental</span></a></li>
|
|
60
|
+
<li><a href="./families/scheduler.html"><span>Scheduler</span><span class="tag tag-planned">planned</span></a></li>
|
|
61
|
+
<li><a href="./families/behavior.html"><span>Behavior</span><span class="tag tag-planned">planned</span></a></li>
|
|
62
|
+
</ul>
|
|
63
|
+
<h2>Runtime contract</h2><ul>
|
|
64
|
+
<li><a href="./events-abi.html"><span>Event locator ABI</span></a></li>
|
|
65
|
+
<li><a href="./module-publication-standard.html"><span>Module publication standard</span></a></li>
|
|
66
|
+
<li><a href="./browser-wasmedge-isomorphic.html"><span>Browser / WasmEdge isomorphism</span></a></li>
|
|
67
|
+
<li><a href="./isomorphic-pthreads.html"><span>Isomorphic pthreads</span></a></li>
|
|
68
|
+
<li><a href="./tri-runtime-parity.html"><span>Tri-runtime parity</span></a></li>
|
|
69
|
+
<li><a href="./tri-runtime-parity-gate.html"><span>Tri-runtime parity gate</span></a></li>
|
|
70
|
+
<li><a href="./testing-harness.html"><span>Testing harness</span></a></li>
|
|
71
|
+
<li><a href="./language-runtime-matrix.html"><span>Language and runtime matrix</span></a></li>
|
|
72
|
+
</ul>
|
|
73
|
+
<h2>Host surfaces</h2><ul>
|
|
74
|
+
<li><a href="./flatsql-host-contract.html"><span>FlatSQL host contract</span></a></li>
|
|
75
|
+
<li><a href="./flatsql-streaming-standard.html"><span>FlatSQL streaming standard</span></a></li>
|
|
76
|
+
<li><a href="./secrets-capability.html" aria-current="page"><span>Credential lanes</span></a></li>
|
|
77
|
+
<li><a href="./protocol-installation.html"><span>Protocol installation</span></a></li>
|
|
78
|
+
<li><a href="./gpu-module-abi.html"><span>GPU module ABI</span></a></li>
|
|
79
|
+
<li><a href="./module-bundle-runtime-plan.html"><span>Module bundle runtime</span></a></li>
|
|
80
|
+
<li><a href="./isomorphic-sdn-runtime-plan.html"><span>Isomorphic SDN runtime</span></a></li>
|
|
81
|
+
<li><a href="./node-red-default-node-parity.html"><span>Node-RED node parity</span></a></li>
|
|
82
|
+
</ul>
|
|
83
|
+
</nav>
|
|
84
|
+
<main class="doc" id="main">
|
|
85
|
+
<h1>Credential lanes</h1>
|
|
86
|
+
<p>A module often needs an operator's third-party credential: a Space-Track login, a data-provider API password, an account at whatever service the operator uses. The <code>secrets</code> capability is how that credential reaches the module <strong>without the credential ever living in the module, the manifest, the flow, or a record</strong>.</p>
|
|
87
|
+
<p>The operator enters the credential once on their node. The node seals it at rest under its own key material. A module the operator has explicitly approved can then read exactly that one credential at runtime.</p>
|
|
88
|
+
<p>This document is normative for module authors. The guest-side helper is <code>src/host/cpp/secretsClient.hpp</code>; the reference host implementation is <code>sdn-server/internal/modulert/caps/secrets.go</code>.</p>
|
|
89
|
+
<h2 id="lanes"><a class="anchor" href="#lanes" aria-hidden="true">#</a>Lanes</h2>
|
|
90
|
+
<p>A <strong>lane</strong> is a named credential slot on the node — <code>spacetrack</code>, <code>acme-weather</code>, <code>zephyr_billing</code>. Lane ids are lowercase <code>[a-z0-9_-]{2,64}</code>.</p>
|
|
91
|
+
<p><strong>Lanes are operator-defined.</strong> A few are well-known (<code>spacetrack</code>, <code>edc_cpf</code>, <code>myintelsat</code>) because the node ships a verifier that can probe them, but an operator may create a lane for any service at all. Do not hard-code an assumption that a fixed set exists:</p>
|
|
92
|
+
<ul>
|
|
93
|
+
<li>Take the lane id as <strong>module configuration</strong>, not as a compile-time constant, so an operator can point your module at their own lane.</li>
|
|
94
|
+
<li>Treat "not configured" as a <strong>normal runtime state</strong>, not an error condition that should crash a run.</li>
|
|
95
|
+
<li>A lane may be permanently <strong>unverified</strong>. The node cannot probe a service it knows nothing about, so <code>verified_at</code> stays empty forever for most operator-defined lanes. That is honest, not broken.</li>
|
|
96
|
+
</ul>
|
|
97
|
+
<h2 id="the-approval-contract"><a class="anchor" href="#the-approval-contract" aria-hidden="true">#</a>The approval contract</h2>
|
|
98
|
+
<p>Reading a credential requires <strong>two</strong> things, and neither is something your module can arrange for itself.</p>
|
|
99
|
+
<ol>
|
|
100
|
+
<li><strong>Declare the capability.</strong> Add <code>secrets:<lane></code> to your manifest's <code>capabilities</code> for each lane you read. <code>secrets:spacetrack</code> conveys nothing about <code>secrets:edc_cpf</code>: the host re-checks the exact lane on <strong>every call</strong>, so a module holding one lane's grant is refused on every other lane.</li>
|
|
101
|
+
</ol>
|
|
102
|
+
<ol>
|
|
103
|
+
<li><strong>The operator approves your module's content hash.</strong> Every <code>secrets:*</code> capability is <em>sensitive</em>. The operator records an approval for your module's exact SHA-256 content hash, for that exact lane, in the node's <code>capability_policy.json</code>. Without it the module is <strong>denied at load</strong> — the whole module fails to load, not just the call.</li>
|
|
104
|
+
</ol>
|
|
105
|
+
<p>Recompiling changes the hash and therefore <strong>revokes</strong> the approval. That is deliberate: the approval is for the bytes the operator reviewed, not for a name.</p>
|
|
106
|
+
<p>There is <strong>no enumeration</strong>. There is no <code>secrets.list</code> and no <code>secrets.export</code>. A guest can ask for a lane it is already approved for and nothing else; it can never discover which credentials the node holds. Do not probe lane names.</p>
|
|
107
|
+
<h2 id="handling-the-plaintext"><a class="anchor" href="#handling-the-plaintext" aria-hidden="true">#</a>Handling the plaintext</h2>
|
|
108
|
+
<p><code>secrets.get</code> returns the credential <strong>in the clear</strong>, in your linear memory. There is no way around that — the module's job is to present the password to the provider's own login, so the secret <em>is</em> the message. Once it crosses the boundary the host cannot protect it further, and these rules are yours to keep:</p>
|
|
109
|
+
<ul>
|
|
110
|
+
<li><strong>Never log it.</strong> Not in an error message, not in a trace, not in a progress event, not at debug level.</li>
|
|
111
|
+
<li><strong>Never persist it.</strong> Not through <code>storage.write</code>, not to the filesystem, not into a record, not into a cache that outlives the call.</li>
|
|
112
|
+
<li><strong>Never forward it</strong> anywhere except the provider it belongs to.</li>
|
|
113
|
+
<li><strong>Wipe it</strong> as soon as the provider call is done, on success <em>and</em> failure paths, and keep its lifetime as short as you can.</li>
|
|
114
|
+
</ul>
|
|
115
|
+
<p>If your module also holds <code>http</code>, it is technically capable of exfiltrating the credential. The operator's approval is precisely the decision to trust it not to. Honor that.</p>
|
|
116
|
+
<h2 id="minimal-usage"><a class="anchor" href="#minimal-usage" aria-hidden="true">#</a>Minimal usage</h2>
|
|
117
|
+
<div class="codeblock"><div class="codeblock-head">cpp</div><pre><code>#include "sdm_hostcall_wire.hpp" // must be included first
|
|
118
|
+
#include "secretsClient.hpp"
|
|
119
|
+
|
|
120
|
+
// The lane comes from module configuration — never assume "spacetrack".
|
|
121
|
+
bool fetch_provider_data(const std::string& lane) {
|
|
122
|
+
sdm_secrets::Credential cred;
|
|
123
|
+
if (!sdm_secrets::secrets_get(lane, &cred)) {
|
|
124
|
+
// Not approved for this lane, or the operator has not entered it yet.
|
|
125
|
+
// Report the CONDITION, never the lane's contents.
|
|
126
|
+
log_error("provider credential unavailable");
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const bool ok = provider_login(cred.username, cred.secret);
|
|
131
|
+
sdm_secrets::wipe(&cred); // on every path, including this failure one
|
|
132
|
+
return ok;
|
|
133
|
+
}</code></pre></div>
|
|
134
|
+
<p>Manifest:</p>
|
|
135
|
+
<div class="codeblock"><div class="codeblock-head">json</div><pre><code>{
|
|
136
|
+
"pluginId": "com.example.provider-fetch",
|
|
137
|
+
"capabilities": ["http", "secrets:acme-weather"]
|
|
138
|
+
}</code></pre></div>
|
|
139
|
+
<p>To decide whether a fetch is worth attempting without touching the plaintext:</p>
|
|
140
|
+
<div class="codeblock"><div class="codeblock-head">cpp</div><pre><code>sdm_secrets::Status status;
|
|
141
|
+
if (sdm_secrets::secrets_status(lane, &status) && status.configured) {
|
|
142
|
+
// A credential is present. status.username_masked is safe to show an
|
|
143
|
+
// operator ("o***@acme.example"); status.verified_at is EMPTY when the node
|
|
144
|
+
// has never probed it, which is normal for an operator-defined lane.
|
|
145
|
+
}</code></pre></div>
|
|
146
|
+
<p><code>secrets_status</code> is gated by the <strong>same</strong> per-lane capability, so an unapproved module cannot use it to probe which credentials a node holds.</p>
|
|
147
|
+
<h2 id="wire-shapes"><a class="anchor" href="#wire-shapes" aria-hidden="true">#</a>Wire shapes</h2>
|
|
148
|
+
<p>Both operations are plain JSON meta documents; neither uses binary segments.</p>
|
|
149
|
+
<div class="codeblock"><pre><code>secrets.get -> {"id":"<lane>"}
|
|
150
|
+
<- {"ok":true,"result":{"id":"...","username":"...","secret":"..."}}
|
|
151
|
+
|
|
152
|
+
secrets.status -> {"id":"<lane>"}
|
|
153
|
+
<- {"ok":true,"result":{"id":"...","configured":true,
|
|
154
|
+
"username_masked":"o***@example.com",
|
|
155
|
+
"updated_at":"...","verified_at":"..."}}</code></pre></div>
|
|
156
|
+
<p>A refusal — unapproved lane, unconfigured credential, no keystore on this node — comes back as <code>{"ok":false,...}</code> and <strong>never</strong> carries credential material. Both helpers return <code>false</code> in that case and leave their output parameter untouched. A <code>false</code> return never means "empty credential"; it means no credential was obtained.</p>
|
|
157
|
+
<h2 id="failure-modes-worth-expecting"><a class="anchor" href="#failure-modes-worth-expecting" aria-hidden="true">#</a>Failure modes worth expecting</h2>
|
|
158
|
+
<div class="table-wrap"><table><thead><tr><th>Situation</th><th>What you see</th></tr></thead><tbody><tr><td>Capability not declared in the manifest</td><td>Refused per call (<code>ok:false</code>)</td></tr><tr><td>Declared but not approved by the operator</td><td><strong>Module denied at load</strong></td></tr><tr><td>Approved for a different lane</td><td>Refused per call (<code>ok:false</code>)</td></tr><tr><td>Lane exists but the operator has not filled it in</td><td><code>secrets_get</code> false; <code>secrets_status</code> <code>configured:false</code></td></tr><tr><td>Lane has no verifier on this node</td><td><code>verified_at</code> empty — normal, not an error</td></tr><tr><td>Node has no credential keystore</td><td>Refused per call (<code>ok:false</code>)</td></tr></tbody></table></div>
|
|
159
|
+
|
|
160
|
+
<p class="doc-footer">
|
|
161
|
+
Source of truth for this page:
|
|
162
|
+
<code>docs/secrets-capability.md</code>. Regenerate with
|
|
163
|
+
<code>npm run build:docs</code>.
|
|
164
|
+
</p>
|
|
165
|
+
</main>
|
|
166
|
+
<nav class="rail" aria-label="On this page"><h2>On this page</h2><ul><li><a class="depth-2" href="#lanes">Lanes</a></li>
|
|
167
|
+
<li><a class="depth-2" href="#the-approval-contract">The approval contract</a></li>
|
|
168
|
+
<li><a class="depth-2" href="#handling-the-plaintext">Handling the plaintext</a></li>
|
|
169
|
+
<li><a class="depth-2" href="#minimal-usage">Minimal usage</a></li>
|
|
170
|
+
<li><a class="depth-2" href="#wire-shapes">Wire shapes</a></li>
|
|
171
|
+
<li><a class="depth-2" href="#failure-modes-worth-expecting">Failure modes worth expecting</a></li></ul></nav>
|
|
172
|
+
</div>
|
|
173
|
+
<section id="stack" class="section" aria-labelledby="stack-title">
|
|
174
|
+
<div class="section-head">
|
|
175
|
+
<p class="eyebrow">SDN Stack</p>
|
|
176
|
+
<h2 id="stack-title">Connected sites</h2>
|
|
177
|
+
</div>
|
|
178
|
+
<div class="link-list">
|
|
179
|
+
<a href="https://spacedatastandards.org/">
|
|
180
|
+
<span>Standards</span>
|
|
181
|
+
<small>Canonical schemas, record contracts, and generated bindings.</small>
|
|
182
|
+
</a>
|
|
183
|
+
<a href="https://digitalarsenal.github.io/flatbuffers/">
|
|
184
|
+
<span>FlatBuffers</span>
|
|
185
|
+
<small>Binary encoding, schema tooling, and runtime documentation.</small>
|
|
186
|
+
</a>
|
|
187
|
+
<a href="https://digitalarsenal.github.io/flatsql/">
|
|
188
|
+
<span>FlatSQL</span>
|
|
189
|
+
<small>SQL-style queries over FlatBuffer-backed datasets and streams.</small>
|
|
190
|
+
</a>
|
|
191
|
+
<a href="https://spacedatanetwork.org/">
|
|
192
|
+
<span>SDN</span>
|
|
193
|
+
<small>Distributed publication, discovery, delivery, and marketplace infrastructure.</small>
|
|
194
|
+
</a>
|
|
195
|
+
<a href="https://digitalarsenal.github.io/space-data-module-sdk/" class="active">
|
|
196
|
+
<span>Module SDK</span>
|
|
197
|
+
<small>WASM module packaging, validation, and host compatibility tooling.</small>
|
|
198
|
+
</a>
|
|
199
|
+
</div>
|
|
200
|
+
</section>
|
|
201
|
+
<footer class="site-footer">
|
|
202
|
+
Space Data Module SDK — Apache-2.0. Every ABI page renders a Markdown
|
|
203
|
+
source in <code>docs/</code>; edit the Markdown, never the HTML.
|
|
204
|
+
</footer>
|
|
205
|
+
</body>
|
|
206
|
+
</html>
|