@vibes.diy/identity 14.3.325 → 14.3.326
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/LICENSE.md +54 -201
- package/README.md +2 -2
- package/clerk-claim.js +0 -1
- package/dash-api/clerk-oauth-token.js +0 -1
- package/dash-api/clerk-token.js +0 -1
- package/dash-api/dash-client.js +0 -1
- package/dash-api/protocols-base-jwt.js +0 -1
- package/dash-api/protocols-cloud-types.js +0 -1
- package/dash-api/protocols-dashboard/dash-types.js +0 -1
- package/dash-api/protocols-dashboard/fp-api-interface.js +0 -1
- package/dash-api/protocols-dashboard/index.js +0 -1
- package/dash-api/protocols-dashboard/msg-is.js +0 -1
- package/dash-api/protocols-dashboard/msg-types.js +0 -1
- package/dash-api/protocols-dashboard/token.js +0 -1
- package/dash-api/token.js +0 -1
- package/device-id/ca.js +0 -1
- package/device-id/certor.js +0 -1
- package/device-id/csr.js +0 -1
- package/device-id/key.js +0 -1
- package/device-id/keybag-fixture.js +0 -1
- package/device-id/register-support.d.ts +2 -1
- package/device-id/register-support.js +2 -3
- package/device-id/register.js +34 -12
- package/device-id/sign.js +0 -1
- package/device-id/test-helpers.js +0 -1
- package/device-id/validator.js +0 -1
- package/device-id/verify.js +0 -1
- package/golden-fixtures.js +0 -1
- package/index.js +0 -1
- package/keybag/instance.d.ts +3 -0
- package/keybag/instance.js +28 -0
- package/keybag/key-bag-file.js +0 -1
- package/keybag/key-bag-memory.js +0 -1
- package/keybag/key-bag.d.ts +12 -2
- package/keybag/key-bag.js +29 -6
- package/keybag/keybag.d.ts +1 -1
- package/keybag/keybag.js +3 -4
- package/keybag/sys-file-system/deno-filesystem.js +0 -1
- package/keybag/sys-file-system/factory.js +0 -1
- package/keybag/sys-file-system/node-filesystem.js +0 -1
- package/keybag/sys-file-system/to-array-buffer.js +0 -1
- package/node.d.ts +6 -1
- package/node.js +6 -4
- package/package.json +3 -3
- package/runtime/hashing.js +0 -1
- package/runtime/superthis.js +0 -1
- package/runtime-context.js +0 -1
- package/server.js +0 -1
- package/sts/index.js +0 -1
- package/sts/text-blocks.js +0 -1
- package/testing.js +0 -1
- package/types/cert-payload.js +0 -1
- package/types/device-id-payload.js +0 -1
- package/types/device-id-types.js +0 -1
- package/types/keybag-item-schema.js +0 -1
- package/types/keybag-item.d.ts +1 -0
- package/types/keybag-item.js +0 -1
- package/types/sthis.js +0 -1
- package/types/wire.js +0 -1
- package/clerk-claim-parity.test.d.ts +0 -1
- package/clerk-claim-parity.test.js +0 -63
- package/clerk-claim-parity.test.js.map +0 -1
- package/clerk-claim.js.map +0 -1
- package/clerk-claim.test.d.ts +0 -1
- package/clerk-claim.test.js +0 -32
- package/clerk-claim.test.js.map +0 -1
- package/clerk-oauth-token.test.d.ts +0 -1
- package/clerk-oauth-token.test.js +0 -502
- package/clerk-oauth-token.test.js.map +0 -1
- package/dash-api/clerk-oauth-token.js.map +0 -1
- package/dash-api/clerk-token.js.map +0 -1
- package/dash-api/clerk-token.test.d.ts +0 -1
- package/dash-api/clerk-token.test.js +0 -52
- package/dash-api/clerk-token.test.js.map +0 -1
- package/dash-api/dash-client.js.map +0 -1
- package/dash-api/dash-client.test.d.ts +0 -1
- package/dash-api/dash-client.test.js +0 -50
- package/dash-api/dash-client.test.js.map +0 -1
- package/dash-api/protocols-base-jwt.js.map +0 -1
- package/dash-api/protocols-cloud-types.js.map +0 -1
- package/dash-api/protocols-dashboard/dash-types.js.map +0 -1
- package/dash-api/protocols-dashboard/fp-api-interface.js.map +0 -1
- package/dash-api/protocols-dashboard/index.js.map +0 -1
- package/dash-api/protocols-dashboard/msg-is.js.map +0 -1
- package/dash-api/protocols-dashboard/msg-types.js.map +0 -1
- package/dash-api/protocols-dashboard/token.js.map +0 -1
- package/dash-api/token.js.map +0 -1
- package/device-id/ca.js.map +0 -1
- package/device-id/certor.js.map +0 -1
- package/device-id/csr.js.map +0 -1
- package/device-id/key.js.map +0 -1
- package/device-id/keybag-fixture.js.map +0 -1
- package/device-id/register-golden.test.d.ts +0 -1
- package/device-id/register-golden.test.js +0 -98
- package/device-id/register-golden.test.js.map +0 -1
- package/device-id/register-integration.test.d.ts +0 -1
- package/device-id/register-integration.test.js +0 -575
- package/device-id/register-integration.test.js.map +0 -1
- package/device-id/register-support.js.map +0 -1
- package/device-id/register-support.test.d.ts +0 -1
- package/device-id/register-support.test.js +0 -89
- package/device-id/register-support.test.js.map +0 -1
- package/device-id/register.js.map +0 -1
- package/device-id/sign.js.map +0 -1
- package/device-id/test-helpers.js.map +0 -1
- package/device-id/validator.js.map +0 -1
- package/device-id/verify.js.map +0 -1
- package/device-id/wire-golden.test.d.ts +0 -1
- package/device-id/wire-golden.test.js +0 -20
- package/device-id/wire-golden.test.js.map +0 -1
- package/device-id-env-value.test.d.ts +0 -1
- package/device-id-env-value.test.js +0 -82
- package/device-id-env-value.test.js.map +0 -1
- package/golden-fixtures.js.map +0 -1
- package/index.js.map +0 -1
- package/keybag/key-bag-file.js.map +0 -1
- package/keybag/key-bag-memory.js.map +0 -1
- package/keybag/key-bag.js.map +0 -1
- package/keybag/keybag-golden.test.d.ts +0 -1
- package/keybag/keybag-golden.test.js +0 -168
- package/keybag/keybag-golden.test.js.map +0 -1
- package/keybag/keybag.js.map +0 -1
- package/keybag/sys-file-system/deno-filesystem.js.map +0 -1
- package/keybag/sys-file-system/factory.js.map +0 -1
- package/keybag/sys-file-system/node-filesystem.js.map +0 -1
- package/keybag/sys-file-system/to-array-buffer.js.map +0 -1
- package/node.js.map +0 -1
- package/runtime/hashing.js.map +0 -1
- package/runtime/superthis.js.map +0 -1
- package/runtime/superthis.test.d.ts +0 -1
- package/runtime/superthis.test.js +0 -47
- package/runtime/superthis.test.js.map +0 -1
- package/runtime-context.js.map +0 -1
- package/runtime-context.test.d.ts +0 -1
- package/runtime-context.test.js +0 -12
- package/runtime-context.test.js.map +0 -1
- package/server.js.map +0 -1
- package/sts/index.js.map +0 -1
- package/sts/sts-golden.test.d.ts +0 -1
- package/sts/sts-golden.test.js +0 -63
- package/sts/sts-golden.test.js.map +0 -1
- package/sts/text-blocks.js.map +0 -1
- package/testing.js.map +0 -1
- package/types/cert-payload.js.map +0 -1
- package/types/device-id-payload.js.map +0 -1
- package/types/device-id-payload.test.d.ts +0 -1
- package/types/device-id-payload.test.js +0 -75
- package/types/device-id-payload.test.js.map +0 -1
- package/types/device-id-types.js.map +0 -1
- package/types/keybag-item-schema.js.map +0 -1
- package/types/keybag-item.js.map +0 -1
- package/types/sthis.js.map +0 -1
- package/types/wire.js.map +0 -1
- package/types/wire.test.d.ts +0 -1
- package/types/wire.test.js +0 -19
- package/types/wire.test.js.map +0 -1
- package/vitest.config.d.ts +0 -2
- package/vitest.config.js +0 -8
- package/vitest.config.js.map +0 -1
package/LICENSE.md
CHANGED
|
@@ -1,201 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
1
|
+
# Vibes DIY Runtime License
|
|
2
|
+
|
|
3
|
+
Copyright 2024-2026 Fireproof Storage Incorporated ("Licensor"). Vibes DIY is a brand of Fireproof Storage Incorporated.
|
|
4
|
+
|
|
5
|
+
## 1. Covered Software
|
|
6
|
+
|
|
7
|
+
"Covered Software" means the files that a package's `LICENSE.md` identifies as licensed under this Vibes DIY Runtime License, or the whole package when its `LICENSE.md` is this license. "Vibes App" means an app built with Vibes DIY, including an app built with the `vibes-diy` command-line tool, exported from Vibes DIY, or run from its source.
|
|
8
|
+
|
|
9
|
+
Files that the Covered Software writes into your own project for you, such as the README and app scaffold that `vibes-diy generate` creates, and the code of your Vibes Apps, belong to you. They are not Covered Software.
|
|
10
|
+
|
|
11
|
+
## 2. What you may do
|
|
12
|
+
|
|
13
|
+
Subject to these terms, Licensor grants you a worldwide, non-exclusive, royalty-free license to:
|
|
14
|
+
|
|
15
|
+
1. install and run the Covered Software, on your own computers, in continuous integration, on servers you operate, or on any host you choose;
|
|
16
|
+
2. include the Covered Software, unmodified, in Vibes Apps that you build, deploy, and run locally, self-hosted, or anywhere else; and
|
|
17
|
+
3. let anyone use those Vibes Apps, including for commercial purposes.
|
|
18
|
+
|
|
19
|
+
Your employees and contractors may do the same on your behalf.
|
|
20
|
+
|
|
21
|
+
## 3. What you may not do
|
|
22
|
+
|
|
23
|
+
You may not:
|
|
24
|
+
|
|
25
|
+
1. modify the Covered Software or create derivative works of it;
|
|
26
|
+
2. reverse engineer, decompile, or disassemble the Covered Software, except to the extent applicable law expressly permits it despite this restriction;
|
|
27
|
+
3. use the Covered Software for any purpose other than building and running Vibes Apps; or
|
|
28
|
+
4. distribute the Covered Software on its own, separately from a Vibes App or from the package it was published in.
|
|
29
|
+
|
|
30
|
+
You must keep this license and any copyright notices with every copy of the Covered Software.
|
|
31
|
+
|
|
32
|
+
## 4. Third-party components
|
|
33
|
+
|
|
34
|
+
The Covered Software includes open-source and other third-party components. Those components remain under their own licenses, listed in `THIRD_PARTY_NOTICES.md` where shipped and in the notices that accompany each component. Nothing in this license limits the rights those licenses give you.
|
|
35
|
+
|
|
36
|
+
## 5. Earlier releases
|
|
37
|
+
|
|
38
|
+
Versions of any package released before this license first shipped with it keep the license they were published with, including the Apache License 2.0 and MIT. This license does not withdraw any right granted under those licenses.
|
|
39
|
+
|
|
40
|
+
## 6. Hosted services
|
|
41
|
+
|
|
42
|
+
This license covers the Covered Software only. Your use of the hosted Vibes DIY services is governed by the Vibes DIY Terms of Service.
|
|
43
|
+
|
|
44
|
+
## 7. Termination
|
|
45
|
+
|
|
46
|
+
If you breach these terms, your license ends. Licensor may reinstate it in writing.
|
|
47
|
+
|
|
48
|
+
## 8. No warranty
|
|
49
|
+
|
|
50
|
+
THE COVERED SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
51
|
+
|
|
52
|
+
## 9. Limitation of liability
|
|
53
|
+
|
|
54
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, LICENSOR WILL NOT BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR CONNECTED WITH THE COVERED SOFTWARE OR ITS USE.
|
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ Private by default — or open to the world. You choose. Keep an app to the peop
|
|
|
25
25
|
|
|
26
26
|
> Your app's data lives in a centralized cloud database. "Private" means access-gated from other people — not encrypted, and not hidden from the platform.
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Run your app anywhere
|
|
29
29
|
|
|
30
|
-
The `vibes-diy` CLI
|
|
30
|
+
The `vibes-diy` CLI and the `use-vibes` SDK are on npm, free to install and run. Build, deploy and share Vibes apps with them on your own computer, your own server or anywhere else, under the Vibes DIY Runtime License in each package's `LICENSE.md`. The skill docs your coding agent reads (`npx vibes-diy skills`) are Apache-2.0, so any agent can learn to write a vibe from them. Open an issue at [VibesDIY/use-vibes](https://github.com/VibesDIY/use-vibes).
|
|
31
31
|
|
|
32
32
|
## Quick Start
|
|
33
33
|
|
package/clerk-claim.js
CHANGED
package/dash-api/clerk-token.js
CHANGED
package/dash-api/dash-client.js
CHANGED
package/dash-api/token.js
CHANGED
package/device-id/ca.js
CHANGED
package/device-id/certor.js
CHANGED
package/device-id/csr.js
CHANGED
package/device-id/key.js
CHANGED
|
@@ -10,12 +10,13 @@ export interface StoreDeviceCertParams {
|
|
|
10
10
|
readonly keyBag: KeyBag;
|
|
11
11
|
readonly deviceIdKey: DeviceIdKey;
|
|
12
12
|
readonly certJWT: string;
|
|
13
|
+
readonly instance?: string;
|
|
13
14
|
}
|
|
14
15
|
export interface StoredDeviceCert {
|
|
15
16
|
readonly fingerprint: string;
|
|
16
17
|
readonly certificatePayload: CertificatePayload;
|
|
17
18
|
}
|
|
18
|
-
export declare function storeDeviceCert({ keyBag, deviceIdKey, certJWT }: StoreDeviceCertParams): Promise<Result<StoredDeviceCert>>;
|
|
19
|
+
export declare function storeDeviceCert({ keyBag, deviceIdKey, certJWT, instance, }: StoreDeviceCertParams): Promise<Result<StoredDeviceCert>>;
|
|
19
20
|
export interface HeadlessDetectInput {
|
|
20
21
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
21
22
|
readonly platform: string;
|
|
@@ -36,7 +36,7 @@ export function clerkUserIdFromCertPayload(payload) {
|
|
|
36
36
|
export function parseCertJWT(certJWT) {
|
|
37
37
|
return exception2Result(() => CertificatePayloadSchema.parse(decodeJwt(certJWT)));
|
|
38
38
|
}
|
|
39
|
-
export async function storeDeviceCert({ keyBag, deviceIdKey, certJWT }) {
|
|
39
|
+
export async function storeDeviceCert({ keyBag, deviceIdKey, certJWT, instance, }) {
|
|
40
40
|
const rPayload = parseCertJWT(certJWT);
|
|
41
41
|
if (rPayload.isErr()) {
|
|
42
42
|
return Result.Err(rPayload.Err());
|
|
@@ -57,7 +57,7 @@ export async function storeDeviceCert({ keyBag, deviceIdKey, certJWT }) {
|
|
|
57
57
|
].join("\n"));
|
|
58
58
|
}
|
|
59
59
|
const jwkPrivate = await deviceIdKey.exportPrivateJWK();
|
|
60
|
-
await keyBag.setDeviceId(jwkPrivate, { certificateJWT: certJWT, certificatePayload });
|
|
60
|
+
await keyBag.setDeviceId(jwkPrivate, { certificateJWT: certJWT, certificatePayload }, { instance });
|
|
61
61
|
return Result.Ok({ fingerprint, certificatePayload });
|
|
62
62
|
}
|
|
63
63
|
const REMOTE_ENV_KEYS = ["CI", "CLAUDECODE", "CODESPACES", "SSH_CONNECTION", "SSH_TTY"];
|
|
@@ -186,4 +186,3 @@ export function timeoutMessage(timeout, keyBagLocation) {
|
|
|
186
186
|
`Your pending device key is kept at ${keyBagLocation}.`,
|
|
187
187
|
].join(" ");
|
|
188
188
|
}
|
|
189
|
-
//# sourceMappingURL=register-support.js.map
|
package/device-id/register.js
CHANGED
|
@@ -7,6 +7,7 @@ import { type } from "arktype";
|
|
|
7
7
|
import { sendMsg, sendProgress } from "@vibes.diy/cmd-tools";
|
|
8
8
|
import { getKeyBag, deviceIdKeybagFilePath } from "../keybag/keybag.js";
|
|
9
9
|
import { isUnreadableDeviceIdKeybagError } from "../keybag/key-bag.js";
|
|
10
|
+
import { deviceIdInstanceForApiUrl } from "../keybag/instance.js";
|
|
10
11
|
import { DeviceIdKey } from "./key.js";
|
|
11
12
|
import { DeviceIdCSR } from "./csr.js";
|
|
12
13
|
import { checkExistingCertExpectations, checkLoginExpectations, clerkUserIdFromCertPayload, detectHeadlessBrowser, extractCertValue, heartbeatMessage, manualCompletionHint, normalizeExpectedHandle, parseCertJWT, signedInAsLine, storeDeviceCert, timeoutMessage, } from "./register-support.js";
|
|
@@ -69,7 +70,7 @@ export const ResDeviceIdRegister = type({
|
|
|
69
70
|
export function isResDeviceIdRegister(u) {
|
|
70
71
|
return !(ResDeviceIdRegister(u) instanceof type.errors);
|
|
71
72
|
}
|
|
72
|
-
function registrationComplete(fingerprint, keyBagLocation, signedInAs) {
|
|
73
|
+
function registrationComplete({ fingerprint, keyBagLocation, signedInAs, instance, }) {
|
|
73
74
|
return {
|
|
74
75
|
type: "core-cli.res-device-id-register",
|
|
75
76
|
output: [
|
|
@@ -77,9 +78,13 @@ function registrationComplete(fingerprint, keyBagLocation, signedInAs) {
|
|
|
77
78
|
...(signedInAs === undefined ? [] : [signedInAs]),
|
|
78
79
|
`Device ID Fingerprint: ${fingerprint}`,
|
|
79
80
|
`Keybag: ${keyBagLocation}`,
|
|
81
|
+
...instanceLines(instance),
|
|
80
82
|
].join("\n"),
|
|
81
83
|
};
|
|
82
84
|
}
|
|
85
|
+
function instanceLines(instance) {
|
|
86
|
+
return instance === undefined ? [] : [`Instance: ${instance} (kept beside the production login, which is unchanged)`];
|
|
87
|
+
}
|
|
83
88
|
function expectationsOf(args) {
|
|
84
89
|
const expectHandle = normalizeExpectedHandle(args.expectHandle);
|
|
85
90
|
const expectUser = args.expectUser?.trim() === "" ? undefined : args.expectUser?.trim();
|
|
@@ -141,7 +146,7 @@ function pollCertPickup(client, csr, pollMs, onIssued) {
|
|
|
141
146
|
},
|
|
142
147
|
};
|
|
143
148
|
}
|
|
144
|
-
async function completeWithManualCert(ctx, { keyBag, keyBagLocation, certInput, expectations }) {
|
|
149
|
+
async function completeWithManualCert(ctx, { keyBag, keyBagLocation, certInput, instance, expectations }) {
|
|
145
150
|
const rCert = extractCertValue(certInput);
|
|
146
151
|
if (rCert.isErr()) {
|
|
147
152
|
return Result.Err(`Invalid --cert value: ${rCert.Err().message}`);
|
|
@@ -154,7 +159,7 @@ async function completeWithManualCert(ctx, { keyBag, keyBagLocation, certInput,
|
|
|
154
159
|
if (rGuard.isErr()) {
|
|
155
160
|
return Result.Err(rGuard.Err());
|
|
156
161
|
}
|
|
157
|
-
const existing = await keyBag.getDeviceId();
|
|
162
|
+
const existing = await keyBag.getDeviceId(instance);
|
|
158
163
|
if (existing.deviceId.IsNone()) {
|
|
159
164
|
return Result.Err(`no pending device key; run vibes-diy login first (keybag: ${keyBagLocation})`);
|
|
160
165
|
}
|
|
@@ -163,11 +168,16 @@ async function completeWithManualCert(ctx, { keyBag, keyBagLocation, certInput,
|
|
|
163
168
|
return Result.Err(`Error loading existing device ID: ${rKey.Err()}`);
|
|
164
169
|
}
|
|
165
170
|
await sendProgress(ctx, "info", "Storing certificate...");
|
|
166
|
-
const rStored = await storeDeviceCert({ keyBag, deviceIdKey: rKey.Ok(), certJWT: rCert.Ok() });
|
|
171
|
+
const rStored = await storeDeviceCert({ keyBag, deviceIdKey: rKey.Ok(), certJWT: rCert.Ok(), instance });
|
|
167
172
|
if (rStored.isErr()) {
|
|
168
173
|
return Result.Err(rStored.Err());
|
|
169
174
|
}
|
|
170
|
-
return sendMsg(ctx, registrationComplete(
|
|
175
|
+
return sendMsg(ctx, registrationComplete({
|
|
176
|
+
fingerprint: rStored.Ok().fingerprint,
|
|
177
|
+
keyBagLocation,
|
|
178
|
+
signedInAs: signedInAsLine(certUserId, undefined),
|
|
179
|
+
instance,
|
|
180
|
+
}));
|
|
171
181
|
}
|
|
172
182
|
export const deviceIdRegisterEvento = {
|
|
173
183
|
hash: "core-cli.device-id-register",
|
|
@@ -186,11 +196,18 @@ export const deviceIdRegisterEvento = {
|
|
|
186
196
|
};
|
|
187
197
|
const args = ctx.validated;
|
|
188
198
|
const keyBag = await getKeyBag(sthis);
|
|
189
|
-
const
|
|
199
|
+
const instance = deviceIdInstanceForApiUrl(args.apiUrl);
|
|
200
|
+
const keyBagLocation = deviceIdKeybagFilePath(sthis, instance);
|
|
190
201
|
if (args.cert !== undefined) {
|
|
191
|
-
return completeWithManualCert(ctx, {
|
|
202
|
+
return completeWithManualCert(ctx, {
|
|
203
|
+
keyBag,
|
|
204
|
+
keyBagLocation,
|
|
205
|
+
certInput: args.cert,
|
|
206
|
+
instance,
|
|
207
|
+
expectations: expectationsOf(args),
|
|
208
|
+
});
|
|
192
209
|
}
|
|
193
|
-
const existingDeviceIdResult = await keyBag.getDeviceId();
|
|
210
|
+
const existingDeviceIdResult = await keyBag.getDeviceId(instance);
|
|
194
211
|
if (isUnreadableDeviceIdKeybagError(existingDeviceIdResult.error)) {
|
|
195
212
|
await sendProgress(ctx, "warn", "Existing device credential is unreadable or corrupt — re-enrolling with a fresh device ID key.");
|
|
196
213
|
}
|
|
@@ -220,6 +237,7 @@ export const deviceIdRegisterEvento = {
|
|
|
220
237
|
"Use --force to renew the certificate.",
|
|
221
238
|
`Existing Device ID Fingerprint: ${fingerprint}`,
|
|
222
239
|
`Keybag: ${keyBagLocation}`,
|
|
240
|
+
...instanceLines(instance),
|
|
223
241
|
].join("\n"),
|
|
224
242
|
});
|
|
225
243
|
}
|
|
@@ -235,7 +253,7 @@ export const deviceIdRegisterEvento = {
|
|
|
235
253
|
await sendProgress(ctx, "info", "Creating new device ID key pair...");
|
|
236
254
|
deviceIdKey = await DeviceIdKey.create();
|
|
237
255
|
const jwkPrivate = await deviceIdKey.exportPrivateJWK();
|
|
238
|
-
await keyBag.setDeviceId(jwkPrivate);
|
|
256
|
+
await keyBag.setDeviceId(jwkPrivate, undefined, { instance });
|
|
239
257
|
const fingerprint = await deviceIdKey.fingerPrint();
|
|
240
258
|
await sendProgress(ctx, "info", `Created Device ID Fingerprint: ${fingerprint}`);
|
|
241
259
|
await sendProgress(ctx, "info", `Keybag: ${keyBagLocation}`);
|
|
@@ -373,7 +391,7 @@ export const deviceIdRegisterEvento = {
|
|
|
373
391
|
return Result.Err(rGuard.Err());
|
|
374
392
|
}
|
|
375
393
|
await sendProgress(ctx, "info", "Storing certificate...");
|
|
376
|
-
const rStored = await storeDeviceCert({ keyBag, deviceIdKey, certJWT: received.cert });
|
|
394
|
+
const rStored = await storeDeviceCert({ keyBag, deviceIdKey, certJWT: received.cert, instance });
|
|
377
395
|
if (rStored.isErr()) {
|
|
378
396
|
serverInstance.close();
|
|
379
397
|
return Result.Err(rStored.Err());
|
|
@@ -383,7 +401,11 @@ export const deviceIdRegisterEvento = {
|
|
|
383
401
|
await timeouted(browserLanded.asPromise(), { timeout: deps.handoffGraceMs });
|
|
384
402
|
}
|
|
385
403
|
serverInstance.close();
|
|
386
|
-
return sendMsg(ctx, registrationComplete(
|
|
404
|
+
return sendMsg(ctx, registrationComplete({
|
|
405
|
+
fingerprint: rStored.Ok().fingerprint,
|
|
406
|
+
keyBagLocation,
|
|
407
|
+
signedInAs: signedInAsLine(certUserId, account),
|
|
408
|
+
instance,
|
|
409
|
+
}));
|
|
387
410
|
},
|
|
388
411
|
};
|
|
389
|
-
//# sourceMappingURL=register.js.map
|
package/device-id/sign.js
CHANGED
package/device-id/validator.js
CHANGED
package/device-id/verify.js
CHANGED
package/golden-fixtures.js
CHANGED
|
@@ -45,4 +45,3 @@ export const ES256_PRIV_JWK = {
|
|
|
45
45
|
d: "4VRVt4lZwRbSZcz3-daj0kXErKJQrqP73UDBCwQ7HAE",
|
|
46
46
|
};
|
|
47
47
|
export const JWK2ENV_PUB = "zeWndr5LEoaySgKSo2aZniYqUqxa1yJRVUx1QKEWwvhPhB7yAWHaDeeHTTeA1BtAMVW1BUB9WGwjjved8sSLg1mmssJGreZpBZwxqz7jijTFkJUFFjWMPx1RK44sMbHDEGaaoYHyRD1uipjtxsnMWZyz4tMvP6LcE2HyLmHLv3a2Y";
|
|
48
|
-
//# sourceMappingURL=golden-fixtures.js.map
|
package/index.js
CHANGED
|
@@ -6,4 +6,3 @@ export { hashObjectSync } from "./runtime/hashing.js";
|
|
|
6
6
|
export { JWKPrivateSchema, JWKPublicSchema } from "./types/wire.js";
|
|
7
7
|
export { ClerkApiToken } from "./dash-api/clerk-token.js";
|
|
8
8
|
export { clerkDashApi, DashboardApiImpl } from "./dash-api/dash-client.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { URI, exception2Result } from "@adviser/cement";
|
|
2
|
+
const PRODUCTION_API_HOSTS = new Set([
|
|
3
|
+
"vibes.diy",
|
|
4
|
+
"www.vibes.diy",
|
|
5
|
+
"prod-v2.vibesdiy.net",
|
|
6
|
+
"cli-v2.vibesdiy.net",
|
|
7
|
+
]);
|
|
8
|
+
export const PRODUCTION_DEVICE_CERT_ISSUER = "vibes.diy";
|
|
9
|
+
const DEFAULT_PORTS = { "http:": "80", "https:": "443", "ws:": "80", "wss:": "443" };
|
|
10
|
+
export function deviceIdInstanceForApiUrl(apiUrl) {
|
|
11
|
+
if (apiUrl === undefined || apiUrl.trim() === "")
|
|
12
|
+
return undefined;
|
|
13
|
+
const rUri = exception2Result(() => URI.from(apiUrl));
|
|
14
|
+
if (rUri.isErr())
|
|
15
|
+
return undefined;
|
|
16
|
+
const uri = rUri.Ok();
|
|
17
|
+
const defaultPort = DEFAULT_PORTS[uri.protocol];
|
|
18
|
+
if (defaultPort === undefined)
|
|
19
|
+
return undefined;
|
|
20
|
+
const hostname = uri.hostname.toLowerCase();
|
|
21
|
+
if (hostname === "" || PRODUCTION_API_HOSTS.has(hostname))
|
|
22
|
+
return undefined;
|
|
23
|
+
const port = uri.port;
|
|
24
|
+
return port === "" || port === defaultPort ? hostname : `${hostname}:${port}`;
|
|
25
|
+
}
|
|
26
|
+
export function deviceIdInstanceLabel(instance) {
|
|
27
|
+
return instance ?? "production";
|
|
28
|
+
}
|
package/keybag/key-bag-file.js
CHANGED
package/keybag/key-bag-memory.js
CHANGED