@voltro/protocol 0.1.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,52 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `@voltro/*` packages are recorded here. The format
4
+ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
+
6
+ ## Stability contract — read this before you pin a version
7
+
8
+ Voltro is **`0.x` — pre-1.0, and deliberately so.** Under SemVer, `0.y.z` means
9
+ "anything MAY change." We hold to exactly that, stated out loud:
10
+
11
+ - **Pin exact versions.** Depend on `@voltro/runtime@0.4.2`, never `^0.4.2` or
12
+ `~0.4.2`. There is no compatible-range promise below 1.0.
13
+ - **Every MINOR may break.** Breaking changes land on a minor bump (`0.4.x →
14
+ 0.5.0`); patches (`0.4.1 → 0.4.2`) are additive or fixes only. This is the
15
+ standard `0.x` reading of SemVer — the minor slot carries breaking under `0.x`.
16
+ - **Read this changelog before upgrading.** The `⚠ BREAKING` section of each
17
+ release lists every incompatible change with its migration. It is the only
18
+ migration path we provide — there is no deprecation cycle, no compat shim.
19
+ - **All packages release together (lockstep).** One coordinated version across
20
+ the whole framework; the git tag is the source of truth.
21
+
22
+ This is not a placeholder disclaimer — it is the contract. The framework is
23
+ refactored aggressively while it has no external stability obligations, and that
24
+ velocity is the point. A stable-core tier and per-package `1.0` graduation are
25
+ planned, but not yet; until then, treat the whole surface as movable and pin
26
+ exact.
27
+
28
+ The **public API** of each package is its `publishConfig.exports` entry points,
29
+ minus anything marked `@internal` (those are cross-package internals and are
30
+ stripped from the published `.d.ts`). Importing a deep path that isn't an
31
+ exported entry point is unsupported.
32
+
33
+ ---
34
+
35
+ ## [Unreleased]
36
+
37
+ _Changes staged for the next release accumulate here (rolled up from
38
+ `.changes/*.md` at tag time — see `.changes/README.md`)._
39
+
40
+ ---
41
+
42
+ ## [0.1.0]
43
+
44
+ Initial pre-release baseline. This is the starting point the changelog tracks
45
+ from; it is not an exhaustive history of prior development. The framework ships
46
+ as `@voltro/*` packages spanning the runtime, database/query layer, web client
47
+ and router, durable workflows, the CLI, and the plugin ecosystem
48
+ (auth, storage, mail, billing, observability, and more). Not published to a
49
+ public registry yet.
50
+
51
+ Subsequent releases record their deltas from here under dated headings, with
52
+ `⚠ BREAKING` first.
package/LICENSE ADDED
@@ -0,0 +1,57 @@
1
+ Voltro — Proprietary Software License
2
+
3
+ Copyright (c) 2026 Voltro UG. All rights reserved.
4
+
5
+ This software and all associated source code, documentation, and other
6
+ materials (the "Software") are the proprietary property of Voltro UG
7
+ ("Voltro"). This is NOT open-source software.
8
+
9
+ Your access to and use of the Software is governed exclusively by the Voltro
10
+ Terms of Service at:
11
+
12
+ https://voltro.cloud/legal/terms
13
+
14
+ By downloading, installing, or using the Software you agree to those Terms.
15
+ Subject to and conditioned on your continued compliance with them, Voltro
16
+ grants you a limited, non-exclusive, non-transferable, non-sublicensable,
17
+ revocable license to use the Software. All rights not expressly granted in the
18
+ Terms are reserved by Voltro. If you do not agree to the Terms, you have no
19
+ license and may not use the Software.
20
+
21
+ The Terms of Service — including the scope of permitted use, plan
22
+ entitlements, fees, and pricing — may change from time to time. The version in
23
+ force is the one published at the URL above. Commercial terms and pricing are
24
+ NOT part of this notice and are not fixed by, or granted in perpetuity by, the
25
+ version of the Software in which this file appears.
26
+
27
+ Permitted use — your own software. Voltro is a development framework. You may
28
+ use the Software to build, run, and commercially distribute your own
29
+ applications and services, and to charge your own customers for them, without
30
+ owing Voltro any share of that revenue or any further permission beyond the
31
+ Terms. Applications you build with the Software are yours.
32
+
33
+ Prohibited use — reselling Voltro. You may NOT redistribute, resell,
34
+ sublicense, publish, or otherwise provide the Software itself — in whole or in
35
+ part, in source or compiled form — to third parties as a library, framework,
36
+ SDK, template, starter, or development tool for them to build upon, whether
37
+ standalone or repackaged. Shipping the Software as a non-separable, bundled
38
+ dependency inside an application you deliver (for example, compiled into your
39
+ deployed app) is permitted; extracting or re-exposing it as a reusable
40
+ component for others is not.
41
+
42
+ Except as expressly permitted above or by the Terms, you may not copy, modify,
43
+ merge, publish, sublicense, sell, distribute, or create derivative works of the
44
+ Software, in whole or in part.
45
+
46
+ Third-party open-source components distributed alongside the Software are the
47
+ property of their respective owners and are licensed under their own terms; see
48
+ THIRD-PARTY-NOTICES.md where provided. Nothing in this notice limits your
49
+ rights, or extends Voltro's, in those components.
50
+
51
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
+ FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
54
+ VOLTRO BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM,
55
+ OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR ITS USE.
56
+
57
+ For licensing inquiries, contact Voltro UG.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ <div align="center">
2
+
3
+ # @voltro/protocol
4
+
5
+ **The Voltro wire + plugin contract — defineQuery/Mutation/Action/Stream, definePlugin, sessions / JWT / API-keys, and the RPC protocol.**
6
+
7
+ [📖 Documentation](https://docs.voltro.dev/docs/data/wire-protocol) · [Changelog](./CHANGELOG.md) · [voltro.dev](https://voltro.dev) · [Voltro Cloud](https://voltro.cloud)
8
+
9
+ </div>
10
+
11
+ ---
12
+
13
+ ```sh
14
+ npm install @voltro/protocol
15
+ ```
16
+
17
+ > ### [→ Read the documentation for @voltro/protocol](https://docs.voltro.dev/docs/data/wire-protocol)
18
+
19
+ Installation, guides, the full API reference, and examples all live in the
20
+ **[Voltro documentation](https://docs.voltro.dev/docs/intro/getting-started)** — the single source of truth. This README is
21
+ deliberately short so there is nothing here to drift out of date.
22
+
23
+ ## License
24
+
25
+ Proprietary. © 2026 Voltro UG. Your use is governed by the
26
+ [Terms of Service](https://voltro.cloud/legal/terms). See the bundled `LICENSE`.
package/SECURITY.md ADDED
@@ -0,0 +1,56 @@
1
+ # Security Policy
2
+
3
+ We take the security of Voltro and the applications built on it seriously. This
4
+ document explains how to report a vulnerability and what to expect in return.
5
+
6
+ ## Reporting a vulnerability
7
+
8
+ **Please do not open public issues or discuss suspected vulnerabilities in
9
+ public channels.** Report them privately by email:
10
+
11
+ **security contact: [support@voltro.dev](mailto:support@voltro.dev)**
12
+ (subject line: `SECURITY`).
13
+
14
+ Include, where you can:
15
+
16
+ - the affected package(s) and version(s) (e.g. `@voltro/runtime@x.y.z`);
17
+ - a description of the issue and its impact;
18
+ - a minimal reproduction or proof of concept;
19
+ - any suggested remediation.
20
+
21
+ If you'd like to encrypt your report, ask in a first plain email and we'll
22
+ arrange a key.
23
+
24
+ ## What to expect
25
+
26
+ - **Acknowledgement** of your report within **3 business days**.
27
+ - An initial assessment (severity, affected surface) and a remediation plan as
28
+ soon as we've reproduced the issue.
29
+ - **Coordinated disclosure:** we'll agree a disclosure timeline with you and
30
+ credit you in the release notes if you wish. Please give us reasonable time to
31
+ ship a fix before any public disclosure.
32
+
33
+ We do not currently run a paid bug-bounty program, but we genuinely appreciate
34
+ responsible disclosure and will credit reporters.
35
+
36
+ ## Software Bill of Materials (SBOM)
37
+
38
+ A CycloneDX SBOM of the third-party runtime dependency graph is generated for the
39
+ published packages (`pnpm gen:sbom` → `sbom.cdx.json`). If your procurement or
40
+ security team needs it, request it at
41
+ [support@voltro.dev](mailto:support@voltro.dev).
42
+
43
+ ## Supported versions
44
+
45
+ Voltro is pre-1.0 and ships in lockstep: **only the latest published minor of
46
+ each `@voltro/*` package receives security fixes.** Please upgrade to the latest
47
+ release before reporting, and pin exact versions in production.
48
+
49
+ ## Scope
50
+
51
+ In scope: the published `@voltro/*` packages and the framework's own code.
52
+
53
+ Out of scope: vulnerabilities in third-party dependencies that are already
54
+ tracked upstream (we monitor these via a production-dependency audit gate in
55
+ CI), and issues that require a non-default, explicitly-unsafe configuration. If
56
+ you're unsure, report it anyway — we'd rather hear about it.
@@ -0,0 +1,347 @@
1
+ # Third-Party Notices — @voltro/protocol
2
+
3
+ This package depends on the open-source software listed below. Each is the
4
+ property of its respective copyright holders and is used under the terms of
5
+ its license. This file is provided for attribution; it grants no rights in
6
+ @voltro/protocol itself, which is proprietary (see LICENSE).
7
+
8
+ Generated from the resolved runtime dependency closure (6 packages).
9
+
10
+ ---
11
+
12
+ ## @effect/sql@0.51.1
13
+
14
+ License: MIT
15
+
16
+ ```
17
+ MIT License
18
+
19
+ Copyright (c) 2023-present The Contributors
20
+
21
+ Permission is hereby granted, free of charge, to any person obtaining a copy
22
+ of this software and associated documentation files (the "Software"), to deal
23
+ in the Software without restriction, including without limitation the rights
24
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
+ copies of the Software, and to permit persons to whom the Software is
26
+ furnished to do so, subject to the following conditions:
27
+
28
+ The above copyright notice and this permission notice shall be included in all
29
+ copies or substantial portions of the Software.
30
+
31
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
+ SOFTWARE.
38
+ ```
39
+
40
+ ## jose@6.2.3
41
+
42
+ License: MIT
43
+
44
+ ```
45
+ The MIT License (MIT)
46
+
47
+ Copyright (c) 2018 Filip Skokan
48
+
49
+ Permission is hereby granted, free of charge, to any person obtaining a copy
50
+ of this software and associated documentation files (the "Software"), to deal
51
+ in the Software without restriction, including without limitation the rights
52
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
+ copies of the Software, and to permit persons to whom the Software is
54
+ furnished to do so, subject to the following conditions:
55
+
56
+ The above copyright notice and this permission notice shall be included in all
57
+ copies or substantial portions of the Software.
58
+
59
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
+ SOFTWARE.
66
+ ```
67
+
68
+ ## layerr@3.0.0
69
+
70
+ License: MIT
71
+
72
+ ```
73
+ MIT License
74
+
75
+ Copyright (c) 2020 Perry Mitchell
76
+
77
+ Permission is hereby granted, free of charge, to any person obtaining a copy
78
+ of this software and associated documentation files (the "Software"), to deal
79
+ in the Software without restriction, including without limitation the rights
80
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
81
+ copies of the Software, and to permit persons to whom the Software is
82
+ furnished to do so, subject to the following conditions:
83
+
84
+ The above copyright notice and this permission notice shall be included in all
85
+ copies or substantial portions of the Software.
86
+
87
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
90
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
92
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
93
+ SOFTWARE.
94
+ ```
95
+
96
+ ## typeid-js@1.2.0
97
+
98
+ License: Apache-2.0
99
+
100
+ ```
101
+ Apache License
102
+ Version 2.0, January 2004
103
+ http://www.apache.org/licenses/
104
+
105
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
106
+
107
+ 1. Definitions.
108
+
109
+ "License" shall mean the terms and conditions for use, reproduction,
110
+ and distribution as defined by Sections 1 through 9 of this document.
111
+
112
+ "Licensor" shall mean the copyright owner or entity authorized by
113
+ the copyright owner that is granting the License.
114
+
115
+ "Legal Entity" shall mean the union of the acting entity and all
116
+ other entities that control, are controlled by, or are under common
117
+ control with that entity. For the purposes of this definition,
118
+ "control" means (i) the power, direct or indirect, to cause the
119
+ direction or management of such entity, whether by contract or
120
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
121
+ outstanding shares, or (iii) beneficial ownership of such entity.
122
+
123
+ "You" (or "Your") shall mean an individual or Legal Entity
124
+ exercising permissions granted by this License.
125
+
126
+ "Source" form shall mean the preferred form for making modifications,
127
+ including but not limited to software source code, documentation
128
+ source, and configuration files.
129
+
130
+ "Object" form shall mean any form resulting from mechanical
131
+ transformation or translation of a Source form, including but
132
+ not limited to compiled object code, generated documentation,
133
+ and conversions to other media types.
134
+
135
+ "Work" shall mean the work of authorship, whether in Source or
136
+ Object form, made available under the License, as indicated by a
137
+ copyright notice that is included in or attached to the work
138
+ (an example is provided in the Appendix below).
139
+
140
+ "Derivative Works" shall mean any work, whether in Source or Object
141
+ form, that is based on (or derived from) the Work and for which the
142
+ editorial revisions, annotations, elaborations, or other modifications
143
+ represent, as a whole, an original work of authorship. For the purposes
144
+ of this License, Derivative Works shall not include works that remain
145
+ separable from, or merely link (or bind by name) to the interfaces of,
146
+ the Work and Derivative Works thereof.
147
+
148
+ "Contribution" shall mean any work of authorship, including
149
+ the original version of the Work and any modifications or additions
150
+ to that Work or Derivative Works thereof, that is intentionally
151
+ submitted to Licensor for inclusion in the Work by the copyright owner
152
+ or by an individual or Legal Entity authorized to submit on behalf of
153
+ the copyright owner. For the purposes of this definition, "submitted"
154
+ means any form of electronic, verbal, or written communication sent
155
+ to the Licensor or its representatives, including but not limited to
156
+ communication on electronic mailing lists, source code control systems,
157
+ and issue tracking systems that are managed by, or on behalf of, the
158
+ Licensor for the purpose of discussing and improving the Work, but
159
+ excluding communication that is conspicuously marked or otherwise
160
+ designated in writing by the copyright owner as "Not a Contribution."
161
+
162
+ "Contributor" shall mean Licensor and any individual or Legal Entity
163
+ on behalf of whom a Contribution has been received by Licensor and
164
+ subsequently incorporated within the Work.
165
+
166
+ 2. Grant of Copyright License. Subject to the terms and conditions of
167
+ this License, each Contributor hereby grants to You a perpetual,
168
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
169
+ copyright license to reproduce, prepare Derivative Works of,
170
+ publicly display, publicly perform, sublicense, and distribute the
171
+ Work and such Derivative Works in Source or Object form.
172
+
173
+ 3. Grant of Patent License. Subject to the terms and conditions of
174
+ this License, each Contributor hereby grants to You a perpetual,
175
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
176
+ (except as stated in this section) patent license to make, have made,
177
+ use, offer to sell, sell, import, and otherwise transfer the Work,
178
+ where such license applies only to those patent claims licensable
179
+ by such Contributor that are necessarily infringed by their
180
+ Contribution(s) alone or by combination of their Contribution(s)
181
+ with the Work to which such Contribution(s) was submitted. If You
182
+ institute patent litigation against any entity (including a
183
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
184
+ or a Contribution incorporated within the Work constitutes direct
185
+ or contributory patent infringement, then any patent licenses
186
+ granted to You under this License for that Work shall terminate
187
+ as of the date such litigation is filed.
188
+
189
+ 4. Redistribution. You may reproduce and distribute copies of the
190
+ Work or Derivative Works thereof in any medium, with or without
191
+ modifications, and in Source or Object form, provided that You
192
+ meet the following conditions:
193
+
194
+ (a) You must give any other recipients of the Work or
195
+ Derivative Works a copy of this License; and
196
+
197
+ (b) You must cause any modified files to carry prominent notices
198
+ stating that You changed the files; and
199
+
200
+ (c) You must retain, in the Source form of any Derivative Works
201
+ that You distribute, all copyright, patent, trademark, and
202
+ attribution notices from the Source form of the Work,
203
+ excluding those notices that do not pertain to any part of
204
+ the Derivative Works; and
205
+
206
+ (d) If the Work includes a "NOTICE" text file as part of its
207
+ distribution, then any Derivative Works that You distribute must
208
+ include a readable copy of the attribution notices contained
209
+ within such NOTICE file, excluding those notices that do not
210
+ pertain to any part of the Derivative Works, in at least one
211
+ of the following places: within a NOTICE text file distributed
212
+ as part of the Derivative Works; within the Source form or
213
+ documentation, if provided along with the Derivative Works; or,
214
+ within a display generated by the Derivative Works, if and
215
+ wherever such third-party notices normally appear. The contents
216
+ of the NOTICE file are for informational purposes only and
217
+ do not modify the License. You may add Your own attribution
218
+ notices within Derivative Works that You distribute, alongside
219
+ or as an addendum to the NOTICE text from the Work, provided
220
+ that such additional attribution notices cannot be construed
221
+ as modifying the License.
222
+
223
+ You may add Your own copyright statement to Your modifications and
224
+ may provide additional or different license terms and conditions
225
+ for use, reproduction, or distribution of Your modifications, or
226
+ for any such Derivative Works as a whole, provided Your use,
227
+ reproduction, and distribution of the Work otherwise complies with
228
+ the conditions stated in this License.
229
+
230
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
231
+ any Contribution intentionally submitted for inclusion in the Work
232
+ by You to the Licensor shall be under the terms and conditions of
233
+ this License, without any additional terms or conditions.
234
+ Notwithstanding the above, nothing herein shall supersede or modify
235
+ the terms of any separate license agreement you may have executed
236
+ with Licensor regarding such Contributions.
237
+
238
+ 6. Trademarks. This License does not grant permission to use the trade
239
+ names, trademarks, service marks, or product names of the Licensor,
240
+ except as required for reasonable and customary use in describing the
241
+ origin of the Work and reproducing the content of the NOTICE file.
242
+
243
+ 7. Disclaimer of Warranty. Unless required by applicable law or
244
+ agreed to in writing, Licensor provides the Work (and each
245
+ Contributor provides its Contributions) on an "AS IS" BASIS,
246
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
247
+ implied, including, without limitation, any warranties or conditions
248
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
249
+ PARTICULAR PURPOSE. You are solely responsible for determining the
250
+ appropriateness of using or redistributing the Work and assume any
251
+ risks associated with Your exercise of permissions under this License.
252
+
253
+ 8. Limitation of Liability. In no event and under no legal theory,
254
+ whether in tort (including negligence), contract, or otherwise,
255
+ unless required by applicable law (such as deliberate and grossly
256
+ negligent acts) or agreed to in writing, shall any Contributor be
257
+ liable to You for damages, including any direct, indirect, special,
258
+ incidental, or consequential damages of any character arising as a
259
+ result of this License or out of the use or inability to use the
260
+ Work (including but not limited to damages for loss of goodwill,
261
+ work stoppage, computer failure or malfunction, or any and all
262
+ other commercial damages or losses), even if such Contributor
263
+ has been advised of the possibility of such damages.
264
+
265
+ 9. Accepting Warranty or Additional Liability. While redistributing
266
+ the Work or Derivative Works thereof, You may choose to offer,
267
+ and charge a fee for, acceptance of support, warranty, indemnity,
268
+ or other liability obligations and/or rights consistent with this
269
+ License. However, in accepting such obligations, You may act only
270
+ on Your own behalf and on Your sole responsibility, not on behalf
271
+ of any other Contributor, and only if You agree to indemnify,
272
+ defend, and hold each Contributor harmless for any liability
273
+ incurred by, or claims asserted against, such Contributor by reason
274
+ of your accepting any such warranty or additional liability.
275
+
276
+ END OF TERMS AND CONDITIONS
277
+
278
+ APPENDIX: How to apply the Apache License to your work.
279
+
280
+ To apply the Apache License to your work, attach the following
281
+ boilerplate notice, with the fields enclosed by brackets "[]"
282
+ replaced with your own identifying information. (Don't include
283
+ the brackets!) The text should be enclosed in the appropriate
284
+ comment syntax for the file format. We also recommend that a
285
+ file or class name and description of purpose be included on the
286
+ same "printed page" as the copyright notice for easier
287
+ identification within third-party archives.
288
+
289
+ Copyright [yyyy] [name of copyright owner]
290
+
291
+ Licensed under the Apache License, Version 2.0 (the "License");
292
+ you may not use this file except in compliance with the License.
293
+ You may obtain a copy of the License at
294
+
295
+ http://www.apache.org/licenses/LICENSE-2.0
296
+
297
+ Unless required by applicable law or agreed to in writing, software
298
+ distributed under the License is distributed on an "AS IS" BASIS,
299
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
300
+ See the License for the specific language governing permissions and
301
+ limitations under the License.
302
+ ```
303
+
304
+ ## ulidx@2.4.1
305
+
306
+ License: MIT
307
+
308
+ ```
309
+ MIT License
310
+
311
+ Copyright (c) 2021 Perry Mitchell
312
+
313
+ Permission is hereby granted, free of charge, to any person obtaining a copy
314
+ of this software and associated documentation files (the "Software"), to deal
315
+ in the Software without restriction, including without limitation the rights
316
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
317
+ copies of the Software, and to permit persons to whom the Software is
318
+ furnished to do so, subject to the following conditions:
319
+
320
+ The above copyright notice and this permission notice shall be included in all
321
+ copies or substantial portions of the Software.
322
+
323
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
324
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
325
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
326
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
327
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
328
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
329
+ SOFTWARE.
330
+ ```
331
+
332
+ ## uuid@11.1.1
333
+
334
+ License: MIT
335
+
336
+ ```
337
+ The MIT License (MIT)
338
+
339
+ Copyright (c) 2010-2020 Robert Kieffer and other contributors
340
+
341
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
342
+
343
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
344
+
345
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
346
+ ```
347
+
@@ -0,0 +1,88 @@
1
+ import { Schema } from 'effect';
2
+
3
+ export declare interface ApiKeyRecord {
4
+ readonly id: string;
5
+ /** The key's organization id (D5 active org). */
6
+ readonly tenantId: string;
7
+ readonly scopes: ReadonlyArray<string>;
8
+ }
9
+
10
+ export declare const apiKeyStrategy: (options: ApiKeyStrategyOptions) => AuthStrategy;
11
+
12
+ export declare interface ApiKeyStrategyOptions {
13
+ /** Token prefix gate, e.g. `'awb_'`. A bearer token without it is
14
+ * SKIPPED (another strategy may own it). Empty = match any bearer. */
15
+ readonly prefix?: string;
16
+ /** App-supplied lookup: SHA-256 hex of the token → the key row (null =
17
+ * unknown/revoked → `failed`). Apps store key HASHES, never the raw
18
+ * token, and look up by hash (constant-time at the DB). */
19
+ readonly resolveKey: (tokenSha256Hex: string) => Promise<ApiKeyRecord | null> | ApiKeyRecord | null;
20
+ /** Strategy id (logs + `metadata.provider`). Default 'voltro-apikey'. */
21
+ readonly id?: string;
22
+ }
23
+
24
+ /** Pluggable auth strategy. Strategies are SYNC-fast on no-match
25
+ * (cookie-name lookup) and cache any JWKS / DB roundtrips on match
26
+ * so steady-state verification stays CPU-local. */
27
+ declare interface AuthStrategy {
28
+ /** Stable id (`'voltro-password'`, `'workos'`, `'kinde'`, …). Used
29
+ * in logs + `Subject.metadata.provider`. */
30
+ readonly id: string;
31
+ readonly resolve: (input: AuthStrategyInput) => Promise<StrategyResolution> | StrategyResolution;
32
+ }
33
+
34
+ /** Per-call input the framework hands every strategy. */
35
+ declare interface AuthStrategyInput {
36
+ readonly headers: Readonly<Record<string, string | undefined>>;
37
+ readonly clientId: number;
38
+ }
39
+
40
+ /** A strategy's verdict on a request.
41
+ * - `matched`: this strategy claims the request; here's the Subject.
42
+ * - `skip`: not my request (e.g. cookie absent); try next strategy.
43
+ * - `failed`: this IS my request BUT validation failed (signature
44
+ * mismatch, expired JWT). Composer bails to anonymous + logs;
45
+ * silently falling through would mask attacks. */
46
+ declare type StrategyResolution = {
47
+ readonly kind: 'matched';
48
+ readonly subject: Subject;
49
+ } | {
50
+ readonly kind: 'skip';
51
+ } | {
52
+ readonly kind: 'failed';
53
+ readonly reason: string;
54
+ };
55
+
56
+ declare const Subject: Schema.Union<[Schema.Struct<{
57
+ type: Schema.Literal<["user"]>;
58
+ id: typeof Schema.String;
59
+ tenantId: typeof Schema.String;
60
+ scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
61
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
62
+ }>, Schema.Struct<{
63
+ type: Schema.Literal<["apiKey"]>;
64
+ id: typeof Schema.String;
65
+ tenantId: typeof Schema.String;
66
+ scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
67
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
68
+ }>, Schema.Struct<{
69
+ type: Schema.Literal<["serviceAccount"]>;
70
+ id: typeof Schema.String;
71
+ tenantId: typeof Schema.String;
72
+ scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
73
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
74
+ }>, Schema.Struct<{
75
+ type: Schema.Literal<["anonymous"]>;
76
+ id: typeof Schema.Null;
77
+ tenantId: Schema.NullOr<typeof Schema.String>;
78
+ }>, Schema.Struct<{
79
+ type: Schema.Literal<["system"]>;
80
+ id: typeof Schema.String;
81
+ tenantId: typeof Schema.Null;
82
+ scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
83
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
84
+ }>]>;
85
+
86
+ declare type Subject = typeof Subject.Type;
87
+
88
+ export { }
package/dist/apikey.js ADDED
@@ -0,0 +1,32 @@
1
+ import { createHash as e } from "node:crypto";
2
+ //#region src/apiKeyStrategy.ts
3
+ var t = (t) => e("sha256").update(t, "utf8").digest("hex"), n = (e) => {
4
+ let n = e.id ?? "voltro-apikey";
5
+ return {
6
+ id: n,
7
+ resolve: async (r) => {
8
+ let i = r.headers.authorization ?? r.headers.Authorization;
9
+ if (!i) return { kind: "skip" };
10
+ let a = /^Bearer\s+(.+)$/i.exec(i.trim());
11
+ if (!a) return { kind: "skip" };
12
+ let o = a[1].trim(), s = e.prefix ?? "";
13
+ if (s && !o.startsWith(s)) return { kind: "skip" };
14
+ let c = await e.resolveKey(t(o));
15
+ return c ? {
16
+ kind: "matched",
17
+ subject: {
18
+ type: "apiKey",
19
+ id: c.id,
20
+ tenantId: c.tenantId,
21
+ scopes: c.scopes,
22
+ metadata: { provider: n }
23
+ }
24
+ } : {
25
+ kind: "failed",
26
+ reason: "unknown or revoked api key"
27
+ };
28
+ }
29
+ };
30
+ };
31
+ //#endregion
32
+ export { n as apiKeyStrategy };