@mnemonik/shared 7.97.2 → 7.98.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/ambientPointer.d.ts.map +1 -1
  2. package/dist/ambientPointer.js +2 -1
  3. package/dist/ambientPointer.js.map +1 -1
  4. package/dist/apiOrigin.d.ts +3 -0
  5. package/dist/apiOrigin.d.ts.map +1 -0
  6. package/dist/apiOrigin.js +5 -0
  7. package/dist/apiOrigin.js.map +1 -0
  8. package/dist/ast/astChunker.d.ts +12 -12
  9. package/dist/ast/astChunker.js +32 -32
  10. package/dist/ast/grammars.d.ts +9 -9
  11. package/dist/ast/grammars.js +15 -15
  12. package/dist/codeScanner.d.ts +56 -43
  13. package/dist/codeScanner.d.ts.map +1 -1
  14. package/dist/codeScanner.js +262 -143
  15. package/dist/codeScanner.js.map +1 -1
  16. package/dist/contextBudget.js +2 -2
  17. package/dist/contextBudget.js.map +1 -1
  18. package/dist/gitEditDetector.d.ts +6 -6
  19. package/dist/gitEditDetector.js +7 -7
  20. package/dist/hookRuntime.d.ts +35 -2
  21. package/dist/hookRuntime.d.ts.map +1 -1
  22. package/dist/hookRuntime.js +127 -33
  23. package/dist/hookRuntime.js.map +1 -1
  24. package/dist/hookTimeouts.d.ts +6 -6
  25. package/dist/hookTimeouts.js +6 -6
  26. package/dist/hostAdapter.d.ts +135 -0
  27. package/dist/hostAdapter.d.ts.map +1 -0
  28. package/dist/hostAdapter.js +323 -0
  29. package/dist/hostAdapter.js.map +1 -0
  30. package/dist/hostBinary.d.ts +29 -0
  31. package/dist/hostBinary.d.ts.map +1 -0
  32. package/dist/hostBinary.js +179 -0
  33. package/dist/hostBinary.js.map +1 -0
  34. package/dist/index.d.ts +11 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +10 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/instructions.d.ts +26 -26
  39. package/dist/instructions.js +26 -26
  40. package/dist/jitDeliveryAck.d.ts.map +1 -1
  41. package/dist/jitDeliveryAck.js +2 -0
  42. package/dist/jitDeliveryAck.js.map +1 -1
  43. package/dist/projectIdentityFile.d.ts +25 -0
  44. package/dist/projectIdentityFile.d.ts.map +1 -0
  45. package/dist/projectIdentityFile.js +87 -0
  46. package/dist/projectIdentityFile.js.map +1 -0
  47. package/dist/projectSetupHandoff.d.ts +24 -0
  48. package/dist/projectSetupHandoff.d.ts.map +1 -0
  49. package/dist/projectSetupHandoff.js +249 -0
  50. package/dist/projectSetupHandoff.js.map +1 -0
  51. package/dist/protectedPaths.d.ts +9 -0
  52. package/dist/protectedPaths.d.ts.map +1 -0
  53. package/dist/protectedPaths.js +66 -0
  54. package/dist/protectedPaths.js.map +1 -0
  55. package/dist/readiness.d.ts +143 -0
  56. package/dist/readiness.d.ts.map +1 -0
  57. package/dist/readiness.js +304 -0
  58. package/dist/readiness.js.map +1 -0
  59. package/dist/repositoryFingerprint.d.ts +50 -0
  60. package/dist/repositoryFingerprint.d.ts.map +1 -0
  61. package/dist/repositoryFingerprint.js +160 -0
  62. package/dist/repositoryFingerprint.js.map +1 -0
  63. package/dist/repositoryRoot.d.ts +56 -0
  64. package/dist/repositoryRoot.d.ts.map +1 -0
  65. package/dist/repositoryRoot.js +226 -0
  66. package/dist/repositoryRoot.js.map +1 -0
  67. package/dist/runtimeReader.d.ts +102 -0
  68. package/dist/runtimeReader.d.ts.map +1 -0
  69. package/dist/runtimeReader.js +408 -0
  70. package/dist/runtimeReader.js.map +1 -0
  71. package/dist/runtimeSigners.d.ts +37 -0
  72. package/dist/runtimeSigners.d.ts.map +1 -0
  73. package/dist/runtimeSigners.js +507 -0
  74. package/dist/runtimeSigners.js.map +1 -0
  75. package/dist/scannerSupervisor.d.ts +35 -0
  76. package/dist/scannerSupervisor.d.ts.map +1 -0
  77. package/dist/scannerSupervisor.js +2 -0
  78. package/dist/scannerSupervisor.js.map +1 -0
  79. package/dist/secretPatterns.d.ts +9 -9
  80. package/dist/secretPatterns.d.ts.map +1 -1
  81. package/dist/secretPatterns.js +27 -25
  82. package/dist/secretPatterns.js.map +1 -1
  83. package/dist/testing/hostAdapterConformance.d.ts +17 -0
  84. package/dist/testing/hostAdapterConformance.d.ts.map +1 -0
  85. package/dist/testing/hostAdapterConformance.js +477 -0
  86. package/dist/testing/hostAdapterConformance.js.map +1 -0
  87. package/dist/usageGuide.d.ts +1 -1
  88. package/dist/usageGuide.d.ts.map +1 -1
  89. package/dist/usageGuide.js +4 -4
  90. package/package.json +7 -2
  91. package/queries/bash.tags.scm +1 -1
  92. package/queries/groovy.tags.scm +1 -1
  93. package/scripts/vendor-grammars.ts +13 -13
  94. package/src/ambientPointer.ts +2 -1
  95. package/src/apiOrigin.ts +4 -0
  96. package/src/ast/astChunker.ts +39 -39
  97. package/src/ast/grammars.ts +16 -16
  98. package/src/codeScanner.ts +274 -149
  99. package/src/contextBudget.ts +2 -2
  100. package/src/gitEditDetector.ts +7 -7
  101. package/src/hookRuntime.ts +162 -34
  102. package/src/hookTimeouts.ts +6 -6
  103. package/src/hostAdapter.ts +468 -0
  104. package/src/hostBinary.ts +205 -0
  105. package/src/index.ts +20 -0
  106. package/src/instructions.ts +26 -26
  107. package/src/jitDeliveryAck.ts +2 -0
  108. package/src/projectIdentityFile.ts +100 -0
  109. package/src/projectSetupHandoff.ts +275 -0
  110. package/src/protectedPaths.ts +88 -0
  111. package/src/readiness.ts +516 -0
  112. package/src/repositoryFingerprint.ts +199 -0
  113. package/src/repositoryRoot.ts +261 -0
  114. package/src/runtimeReader.ts +495 -0
  115. package/src/runtimeSigners.ts +577 -0
  116. package/src/scannerSupervisor.ts +26 -0
  117. package/src/secretPatterns.ts +27 -25
  118. package/src/testing/hostAdapterConformance.ts +538 -0
  119. package/src/usageGuide.ts +4 -4
  120. package/test-fixtures/identity/runner.d.mts +12 -0
  121. package/test-fixtures/identity/runner.mjs +282 -0
  122. package/tests/fixtures/repository-fingerprint-v1.golden.json +834 -0
  123. package/tests/projectIdentity.test.ts +56 -0
  124. package/tests/readiness.test.ts +158 -0
  125. package/tests/repositoryFingerprint.test.ts +26 -0
  126. package/tsconfig.test.json +9 -0
  127. package/wasm/bash.tags.scm +1 -1
  128. package/wasm/groovy.tags.scm +1 -1
  129. package/wasm/javascript.tags.scm +2 -2
  130. package/wasm/solidity.tags.scm +1 -1
@@ -0,0 +1,834 @@
1
+ {
2
+ "algorithmVersion": 1,
3
+ "remotes": [
4
+ {
5
+ "group": "table",
6
+ "name": "https",
7
+ "url": "https://github.com/Acme/Repo.git",
8
+ "expected": {
9
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
10
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
11
+ "algorithmVersion": 1
12
+ }
13
+ },
14
+ {
15
+ "group": "table",
16
+ "name": "scp",
17
+ "url": "git@github.com:Acme/Repo.git",
18
+ "expected": {
19
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
20
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
21
+ "algorithmVersion": 1
22
+ }
23
+ },
24
+ {
25
+ "group": "table",
26
+ "name": "ssh",
27
+ "url": "ssh://git@github.com/Acme/Repo",
28
+ "expected": {
29
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
30
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
31
+ "algorithmVersion": 1
32
+ }
33
+ },
34
+ {
35
+ "group": "table",
36
+ "name": "idna",
37
+ "url": "https://bücher.example/Org/Repo",
38
+ "expected": {
39
+ "canonical": "repo-v1:https:xn--bcher-kva.example/Org/Repo",
40
+ "hash": "63656842ab72aac80ac0fb788c3e72969c10d15621456ab5c357e7f4062e48cb",
41
+ "algorithmVersion": 1
42
+ }
43
+ },
44
+ {
45
+ "group": "table",
46
+ "name": "ipv6",
47
+ "url": "ssh://git@[2001:db8::1]:2222/Org/Repo.git",
48
+ "expected": {
49
+ "canonical": "repo-v1:ssh:git@[2001:db8::1]:2222/Org/Repo.git",
50
+ "hash": "a9370aafff669006b626795f6c10be7d19319ddfe04a91a9c42aacef1ee9c403",
51
+ "algorithmVersion": 1
52
+ }
53
+ },
54
+ {
55
+ "group": "table",
56
+ "name": "alice",
57
+ "url": "ssh://alice@example.com/Org/Repo.git",
58
+ "expected": {
59
+ "canonical": "repo-v1:ssh:alice@example.com/Org/Repo.git",
60
+ "hash": "85b72ad4bcb9ee0dca0d16b385d0715b8b59821e8fbb86663e581c879acb010f",
61
+ "algorithmVersion": 1
62
+ }
63
+ },
64
+ {
65
+ "group": "table",
66
+ "name": "bob",
67
+ "url": "ssh://bob@example.com/Org/Repo.git",
68
+ "expected": {
69
+ "canonical": "repo-v1:ssh:bob@example.com/Org/Repo.git",
70
+ "hash": "541f8474942160068dd89b20f84e752d41f4f6a9de38c95aea61e3f9d7a0a35f",
71
+ "algorithmVersion": 1
72
+ }
73
+ },
74
+ {
75
+ "group": "table",
76
+ "name": "unknown-https",
77
+ "url": "https://example.com/Org/Repo.git",
78
+ "expected": {
79
+ "canonical": "repo-v1:https:example.com/Org/Repo.git",
80
+ "hash": "7654c22aebe5b844e04d744ac961f0654a9e731eac8db8787390bcf197417148",
81
+ "algorithmVersion": 1
82
+ }
83
+ },
84
+ {
85
+ "group": "table",
86
+ "name": "https-userinfo",
87
+ "url": "https://token@github.com/Acme/Repo",
88
+ "expected": {
89
+ "status": "rejected",
90
+ "reason": "https_userinfo"
91
+ }
92
+ },
93
+ {
94
+ "group": "table",
95
+ "name": "ssh-password",
96
+ "url": "ssh://git:secret@github.com/Acme/Repo",
97
+ "expected": {
98
+ "status": "rejected",
99
+ "reason": "ssh_password"
100
+ }
101
+ },
102
+ {
103
+ "group": "table",
104
+ "name": "escaped-slash",
105
+ "url": "https://github.com/Acme/%2FRepo",
106
+ "expected": {
107
+ "status": "rejected",
108
+ "reason": "escaped_separator"
109
+ }
110
+ },
111
+ {
112
+ "group": "table",
113
+ "name": "file",
114
+ "url": "file:///srv/repos/Acme/Repo",
115
+ "expected": {
116
+ "status": "rejected",
117
+ "reason": "local_remote"
118
+ }
119
+ },
120
+ {
121
+ "group": "github",
122
+ "name": "default-https",
123
+ "url": "https://GITHUB.COM:443/Acme/Repo.git/",
124
+ "expected": {
125
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
126
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
127
+ "algorithmVersion": 1
128
+ }
129
+ },
130
+ {
131
+ "group": "github",
132
+ "name": "default-ssh",
133
+ "url": "ssh://git@github.com:22/Acme/Repo.git",
134
+ "expected": {
135
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
136
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
137
+ "algorithmVersion": 1
138
+ }
139
+ },
140
+ {
141
+ "group": "github",
142
+ "name": "one-suffix",
143
+ "url": "https://github.com/Acme/Repo.git.git",
144
+ "expected": {
145
+ "canonical": "repo-v1:github:github.com/Acme/Repo.git",
146
+ "hash": "b4880086db53cf7f8fb3f89f4ba76bab278840ba773346a3a05f7244f9f857e5",
147
+ "algorithmVersion": 1
148
+ }
149
+ },
150
+ {
151
+ "group": "github",
152
+ "name": "suffix-case",
153
+ "url": "https://github.com/Acme/Repo.GIT",
154
+ "expected": {
155
+ "canonical": "repo-v1:github:github.com/Acme/Repo.GIT",
156
+ "hash": "76d7ef1ecae812f668d37840d7279d4523e88c5a27c947149ff527a934ba40ba",
157
+ "algorithmVersion": 1
158
+ }
159
+ },
160
+ {
161
+ "group": "github",
162
+ "name": "other-user",
163
+ "url": "ssh://alice@github.com/Acme/Repo.git",
164
+ "expected": {
165
+ "canonical": "repo-v1:ssh:alice@github.com/Acme/Repo.git",
166
+ "hash": "cb495aa0146bce16345c82dae5d2a45668e2e98cf8ecb659dc22eccf7b4895f0",
167
+ "algorithmVersion": 1
168
+ }
169
+ },
170
+ {
171
+ "group": "github",
172
+ "name": "nondefault-https",
173
+ "url": "https://github.com:8443/Acme/Repo.git",
174
+ "expected": {
175
+ "canonical": "repo-v1:https:github.com:8443/Acme/Repo.git",
176
+ "hash": "fc503cd7101dbb30927d2f0cb637df8825c04365bef178e2b0671cf803cfcd85",
177
+ "algorithmVersion": 1
178
+ }
179
+ },
180
+ {
181
+ "group": "github",
182
+ "name": "nondefault-ssh",
183
+ "url": "ssh://git@github.com:2222/Acme/Repo.git",
184
+ "expected": {
185
+ "canonical": "repo-v1:ssh:git@github.com:2222/Acme/Repo.git",
186
+ "hash": "0b76161c92d2c43475c044ab906c635a4626d152fd33ea69345fb265f791dcdf",
187
+ "algorithmVersion": 1
188
+ }
189
+ },
190
+ {
191
+ "group": "unknown-host",
192
+ "name": "no-suffix",
193
+ "url": "https://example.com/Org/Repo",
194
+ "expected": {
195
+ "canonical": "repo-v1:https:example.com/Org/Repo",
196
+ "hash": "a83be6c6a5c64670847c3e17b848fb41953670b075e5c7787b870fc1edda6189",
197
+ "algorithmVersion": 1
198
+ }
199
+ },
200
+ {
201
+ "group": "unknown-host",
202
+ "name": "scp-user",
203
+ "url": "alice@example.com:Org/Repo.git",
204
+ "expected": {
205
+ "status": "rejected",
206
+ "reason": "scp_unreviewed_remote"
207
+ }
208
+ },
209
+ {
210
+ "group": "unknown-host",
211
+ "name": "default-https",
212
+ "url": "https://EXAMPLE.COM:0443/Org/Repo.git",
213
+ "expected": {
214
+ "canonical": "repo-v1:https:example.com/Org/Repo.git",
215
+ "hash": "7654c22aebe5b844e04d744ac961f0654a9e731eac8db8787390bcf197417148",
216
+ "algorithmVersion": 1
217
+ }
218
+ },
219
+ {
220
+ "group": "unknown-host",
221
+ "name": "default-ssh",
222
+ "url": "ssh://alice@example.com:22/Org/Repo.git",
223
+ "expected": {
224
+ "canonical": "repo-v1:ssh:alice@example.com/Org/Repo.git",
225
+ "hash": "85b72ad4bcb9ee0dca0d16b385d0715b8b59821e8fbb86663e581c879acb010f",
226
+ "algorithmVersion": 1
227
+ }
228
+ },
229
+ {
230
+ "group": "unknown-host",
231
+ "name": "nondefault",
232
+ "url": "https://example.com:8443/Org/Repo.git",
233
+ "expected": {
234
+ "canonical": "repo-v1:https:example.com:8443/Org/Repo.git",
235
+ "hash": "71cec51bba914c4670732ffac05b2bec606483d86b4b10b520f2e4f42ae677d6",
236
+ "algorithmVersion": 1
237
+ }
238
+ },
239
+ {
240
+ "group": "unknown-host",
241
+ "name": "other-host",
242
+ "url": "https://other.example/Org/Repo.git",
243
+ "expected": {
244
+ "canonical": "repo-v1:https:other.example/Org/Repo.git",
245
+ "hash": "da458cfd0e2165b1f5ce14b490c9197c5eb8009d53282d0d647735d892c0e2ac",
246
+ "algorithmVersion": 1
247
+ }
248
+ },
249
+ {
250
+ "group": "normalization",
251
+ "name": "idna-ssh",
252
+ "url": "ssh://git@BÜCHER.example/Org/Repo",
253
+ "expected": {
254
+ "canonical": "repo-v1:ssh:git@xn--bcher-kva.example/Org/Repo",
255
+ "hash": "1ebaed772307830c1b2d10ed1b33bd97f3c7b4e1c64ba71a6b898d77d1f169ca",
256
+ "algorithmVersion": 1
257
+ }
258
+ },
259
+ {
260
+ "group": "normalization",
261
+ "name": "ipv6-compress",
262
+ "url": "ssh://git@[2001:0DB8:0000:0000:0000:0000:0000:0001]:22/Org/Repo",
263
+ "expected": {
264
+ "canonical": "repo-v1:ssh:git@[2001:db8::1]/Org/Repo",
265
+ "hash": "35982e2e09c1494d48dc10021af23d98f1243b0356c52a02820831d38b0c72e5",
266
+ "algorithmVersion": 1
267
+ }
268
+ },
269
+ {
270
+ "group": "normalization",
271
+ "name": "ipv6-tie",
272
+ "url": "https://[2001:0:0:1:0:0:1:1]/Repo",
273
+ "expected": {
274
+ "canonical": "repo-v1:https:[2001::1:0:0:1:1]/Repo",
275
+ "hash": "cbbd145c52da053659853bb2e02a2472a2fcd69c62eedabb51ed13ccf655af63",
276
+ "algorithmVersion": 1
277
+ }
278
+ },
279
+ {
280
+ "group": "normalization",
281
+ "name": "ipv6-single-zero",
282
+ "url": "https://[2001:db8:0:1:1:1:1:1]/Repo",
283
+ "expected": {
284
+ "canonical": "repo-v1:https:[2001:db8:0:1:1:1:1:1]/Repo",
285
+ "hash": "afdf490f569367927f4321600e6317ae4bf4c33380f3d05a1f16ad4a099dcbdf",
286
+ "algorithmVersion": 1
287
+ }
288
+ },
289
+ {
290
+ "group": "normalization",
291
+ "name": "nfc",
292
+ "url": "https://example.com/Café/R%65po",
293
+ "expected": {
294
+ "canonical": "repo-v1:https:example.com/Caf%C3%A9/Repo",
295
+ "hash": "9dd50443ac58036d76add92d127dee20dfd610dc82645456d77fe0d8478ff0b2",
296
+ "algorithmVersion": 1
297
+ }
298
+ },
299
+ {
300
+ "group": "normalization",
301
+ "name": "utf8-escapes",
302
+ "url": "https://example.com/Caf%c3%a9/Repo",
303
+ "expected": {
304
+ "canonical": "repo-v1:https:example.com/Caf%C3%A9/Repo",
305
+ "hash": "9dd50443ac58036d76add92d127dee20dfd610dc82645456d77fe0d8478ff0b2",
306
+ "algorithmVersion": 1
307
+ }
308
+ },
309
+ {
310
+ "group": "normalization",
311
+ "name": "decode-once",
312
+ "url": "https://example.com/Org/%252FRepo",
313
+ "expected": {
314
+ "canonical": "repo-v1:https:example.com/Org/%252FRepo",
315
+ "hash": "ee0d065b06624701bf4f2ed0d36da27b49aacecf75c015e3cdb694f8549de042",
316
+ "algorithmVersion": 1
317
+ }
318
+ },
319
+ {
320
+ "group": "normalization",
321
+ "name": "encode-reserved",
322
+ "url": "https://example.com/Org/a b!'()*",
323
+ "expected": {
324
+ "canonical": "repo-v1:https:example.com/Org/a%20b%21%27%28%29%2A",
325
+ "hash": "88bc6f6fc3831cd81802bd3b6bf87f70b37565fd635464610038370ed461d9de",
326
+ "algorithmVersion": 1
327
+ }
328
+ },
329
+ {
330
+ "group": "normalization",
331
+ "name": "ignored-query",
332
+ "url": "https://github.com/Acme/Repo.git?q=hello#branch",
333
+ "expected": {
334
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
335
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
336
+ "algorithmVersion": 1
337
+ }
338
+ },
339
+ {
340
+ "group": "normalization",
341
+ "name": "path-case",
342
+ "url": "https://github.com/acme/repo.git",
343
+ "expected": {
344
+ "canonical": "repo-v1:github:github.com/acme/repo",
345
+ "hash": "ddbbc950d7a634f89bfc615a12897f853eff84d129c5ee3b02ba7876a97a711e",
346
+ "algorithmVersion": 1
347
+ }
348
+ },
349
+ {
350
+ "group": "normalization",
351
+ "name": "changed-origin",
352
+ "url": "https://github.com/Acme/Other.git",
353
+ "expected": {
354
+ "canonical": "repo-v1:github:github.com/Acme/Other",
355
+ "hash": "37730d1f0fdfebda80b4d8d40963de6451b9974cae684ffbb17bf3eed74ee6a9",
356
+ "algorithmVersion": 1
357
+ }
358
+ },
359
+ {
360
+ "group": "normalization",
361
+ "name": "fork",
362
+ "url": "https://github.com/Fork/Repo.git",
363
+ "expected": {
364
+ "canonical": "repo-v1:github:github.com/Fork/Repo",
365
+ "hash": "d0772bb5f97fd7e87a1070558614c2af3f9ad3d7eb0dcf55d0aeb6079ffddc33",
366
+ "algorithmVersion": 1
367
+ }
368
+ },
369
+ {
370
+ "group": "normalization",
371
+ "name": "subpath",
372
+ "url": "https://example.com/Org/Repo/sub",
373
+ "expected": {
374
+ "canonical": "repo-v1:https:example.com/Org/Repo/sub",
375
+ "hash": "2948e9ac73035143c4b2b6dcda3ce52c79b4a13c8139080c70eb133d024489e1",
376
+ "algorithmVersion": 1
377
+ }
378
+ },
379
+ {
380
+ "group": "rejections",
381
+ "name": "https-password",
382
+ "url": "https://user:ghp_example@github.com/Acme/Repo",
383
+ "expected": {
384
+ "status": "rejected",
385
+ "reason": "https_userinfo"
386
+ }
387
+ },
388
+ {
389
+ "group": "rejections",
390
+ "name": "empty-userinfo",
391
+ "url": "https://@github.com/Acme/Repo",
392
+ "expected": {
393
+ "status": "rejected",
394
+ "reason": "https_userinfo"
395
+ }
396
+ },
397
+ {
398
+ "group": "rejections",
399
+ "name": "empty-password",
400
+ "url": "ssh://git:@github.com/Acme/Repo",
401
+ "expected": {
402
+ "status": "rejected",
403
+ "reason": "ssh_password"
404
+ }
405
+ },
406
+ {
407
+ "group": "rejections",
408
+ "name": "no-ssh-user",
409
+ "url": "ssh://example.com/Org/Repo",
410
+ "expected": {
411
+ "status": "rejected",
412
+ "reason": "ssh_user_required"
413
+ }
414
+ },
415
+ {
416
+ "group": "rejections",
417
+ "name": "escaped-user",
418
+ "url": "ssh://g%69t@github.com/Acme/Repo",
419
+ "expected": {
420
+ "status": "rejected",
421
+ "reason": "invalid_ssh_user"
422
+ }
423
+ },
424
+ {
425
+ "group": "rejections",
426
+ "name": "unicode-user",
427
+ "url": "ssh://álîce@example.com/Org/Repo",
428
+ "expected": {
429
+ "status": "rejected",
430
+ "reason": "invalid_ssh_user"
431
+ }
432
+ },
433
+ {
434
+ "group": "rejections",
435
+ "name": "control",
436
+ "url": "https://example.com/Org/Re\npo",
437
+ "expected": {
438
+ "status": "rejected",
439
+ "reason": "control_character"
440
+ }
441
+ },
442
+ {
443
+ "group": "rejections",
444
+ "name": "encoded-control",
445
+ "url": "https://example.com/Org/%00Repo",
446
+ "expected": {
447
+ "status": "rejected",
448
+ "reason": "control_character"
449
+ }
450
+ },
451
+ {
452
+ "group": "rejections",
453
+ "name": "c1-control",
454
+ "url": "https://example.com/Org/%C2%85Repo",
455
+ "expected": {
456
+ "status": "rejected",
457
+ "reason": "control_character"
458
+ }
459
+ },
460
+ {
461
+ "group": "rejections",
462
+ "name": "backslash",
463
+ "url": "https://example.com/Org\\Repo",
464
+ "expected": {
465
+ "status": "rejected",
466
+ "reason": "backslash"
467
+ }
468
+ },
469
+ {
470
+ "group": "rejections",
471
+ "name": "escaped-backslash",
472
+ "url": "https://example.com/Org/%5cRepo",
473
+ "expected": {
474
+ "status": "rejected",
475
+ "reason": "escaped_separator"
476
+ }
477
+ },
478
+ {
479
+ "group": "rejections",
480
+ "name": "dotdot",
481
+ "url": "https://example.com/Org/../Repo",
482
+ "expected": {
483
+ "status": "rejected",
484
+ "reason": "dot_segment"
485
+ }
486
+ },
487
+ {
488
+ "group": "rejections",
489
+ "name": "encoded-dotdot",
490
+ "url": "https://example.com/Org/%2e%2E/Repo",
491
+ "expected": {
492
+ "status": "rejected",
493
+ "reason": "dot_segment"
494
+ }
495
+ },
496
+ {
497
+ "group": "rejections",
498
+ "name": "dot",
499
+ "url": "https://example.com/Org/./Repo",
500
+ "expected": {
501
+ "status": "rejected",
502
+ "reason": "dot_segment"
503
+ }
504
+ },
505
+ {
506
+ "group": "rejections",
507
+ "name": "empty-segment",
508
+ "url": "https://example.com/Org//Repo",
509
+ "expected": {
510
+ "status": "rejected",
511
+ "reason": "empty_segment"
512
+ }
513
+ },
514
+ {
515
+ "group": "rejections",
516
+ "name": "double-trailing",
517
+ "url": "https://example.com/Org/Repo//",
518
+ "expected": {
519
+ "status": "rejected",
520
+ "reason": "empty_segment"
521
+ }
522
+ },
523
+ {
524
+ "group": "rejections",
525
+ "name": "no-path",
526
+ "url": "https://example.com/",
527
+ "expected": {
528
+ "status": "rejected",
529
+ "reason": "empty_segment"
530
+ }
531
+ },
532
+ {
533
+ "group": "rejections",
534
+ "name": "empty-provider-path",
535
+ "url": "https://github.com/.git",
536
+ "expected": {
537
+ "status": "rejected",
538
+ "reason": "empty_segment"
539
+ }
540
+ },
541
+ {
542
+ "group": "rejections",
543
+ "name": "invalid-utf8",
544
+ "url": "https://example.com/Org/%FF",
545
+ "expected": {
546
+ "status": "rejected",
547
+ "reason": "invalid_encoding"
548
+ }
549
+ },
550
+ {
551
+ "group": "rejections",
552
+ "name": "invalid-escape",
553
+ "url": "https://example.com/Org/%xy",
554
+ "expected": {
555
+ "status": "rejected",
556
+ "reason": "invalid_encoding"
557
+ }
558
+ },
559
+ {
560
+ "group": "rejections",
561
+ "name": "bad-port",
562
+ "url": "https://example.com:65536/Org/Repo",
563
+ "expected": {
564
+ "status": "rejected",
565
+ "reason": "invalid_port"
566
+ }
567
+ },
568
+ {
569
+ "group": "rejections",
570
+ "name": "bad-ipv6",
571
+ "url": "https://[bad::ip]/Org/Repo",
572
+ "expected": {
573
+ "status": "rejected",
574
+ "reason": "invalid_host"
575
+ }
576
+ },
577
+ {
578
+ "group": "rejections",
579
+ "name": "local-path",
580
+ "url": "/srv/repos/Repo",
581
+ "expected": {
582
+ "status": "rejected",
583
+ "reason": "invalid_remote"
584
+ }
585
+ },
586
+ {
587
+ "group": "rejections",
588
+ "name": "http",
589
+ "url": "http://example.com/Org/Repo",
590
+ "expected": {
591
+ "status": "rejected",
592
+ "reason": "unsupported_transport"
593
+ }
594
+ },
595
+ {
596
+ "group": "unknown-host",
597
+ "name": "scp-relative-path",
598
+ "url": "git@example.com:repos/app.git",
599
+ "expected": {
600
+ "status": "rejected",
601
+ "reason": "scp_unreviewed_remote"
602
+ }
603
+ },
604
+ {
605
+ "group": "rejections",
606
+ "name": "scp-absolute-path",
607
+ "url": "git@example.com:/repos/app.git",
608
+ "expected": {
609
+ "status": "rejected",
610
+ "reason": "scp_unreviewed_remote"
611
+ }
612
+ },
613
+ {
614
+ "group": "github",
615
+ "name": "scp-absolute-path",
616
+ "url": "git@github.com:/Acme/Repo.git",
617
+ "expected": {
618
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
619
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
620
+ "algorithmVersion": 1
621
+ }
622
+ },
623
+ {
624
+ "group": "rejections",
625
+ "name": "scp-absolute-unreviewed-user",
626
+ "url": "alice@github.com:/Acme/Repo.git",
627
+ "expected": {
628
+ "status": "rejected",
629
+ "reason": "scp_unreviewed_remote"
630
+ }
631
+ }
632
+ ],
633
+ "selections": [
634
+ {
635
+ "group": "selection",
636
+ "name": "no-remote",
637
+ "remotes": [],
638
+ "expected": {
639
+ "status": "none",
640
+ "reason": "no_remote"
641
+ }
642
+ },
643
+ {
644
+ "group": "selection",
645
+ "name": "origin-preferred",
646
+ "remotes": [
647
+ {
648
+ "name": "upstream",
649
+ "fetchUrls": ["https://github.com/Fork/Repo.git"]
650
+ },
651
+ {
652
+ "name": "origin",
653
+ "fetchUrls": ["https://github.com/Acme/Repo.git"]
654
+ }
655
+ ],
656
+ "expected": {
657
+ "status": "fingerprint",
658
+ "remote": "origin",
659
+ "fingerprint": {
660
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
661
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
662
+ "algorithmVersion": 1
663
+ }
664
+ }
665
+ },
666
+ {
667
+ "group": "selection",
668
+ "name": "several-without-origin",
669
+ "remotes": [
670
+ {
671
+ "name": "upstream",
672
+ "fetchUrls": ["https://github.com/Acme/Repo.git"]
673
+ },
674
+ {
675
+ "name": "fork",
676
+ "fetchUrls": ["https://github.com/Fork/Repo.git"]
677
+ }
678
+ ],
679
+ "expected": {
680
+ "status": "choice_required",
681
+ "reason": "multiple_remotes",
682
+ "remotes": ["upstream", "fork"]
683
+ }
684
+ },
685
+ {
686
+ "group": "selection",
687
+ "name": "equivalent-fetch-urls",
688
+ "remotes": [
689
+ {
690
+ "name": "origin",
691
+ "fetchUrls": ["https://github.com/Acme/Repo.git", "git@github.com:Acme/Repo.git"]
692
+ }
693
+ ],
694
+ "expected": {
695
+ "status": "fingerprint",
696
+ "remote": "origin",
697
+ "fingerprint": {
698
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
699
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
700
+ "algorithmVersion": 1
701
+ }
702
+ }
703
+ },
704
+ {
705
+ "group": "selection",
706
+ "name": "different-fetch-urls",
707
+ "remotes": [
708
+ {
709
+ "name": "origin",
710
+ "fetchUrls": ["https://github.com/Acme/Repo.git", "https://github.com/Fork/Repo.git"]
711
+ }
712
+ ],
713
+ "expected": {
714
+ "status": "choice_required",
715
+ "reason": "different_urls",
716
+ "remotes": ["origin"]
717
+ }
718
+ },
719
+ {
720
+ "group": "selection",
721
+ "name": "equivalent-pushurl",
722
+ "remotes": [
723
+ {
724
+ "name": "origin",
725
+ "fetchUrls": ["https://github.com/Acme/Repo.git"],
726
+ "pushUrls": ["git@github.com:Acme/Repo.git"]
727
+ }
728
+ ],
729
+ "expected": {
730
+ "status": "fingerprint",
731
+ "remote": "origin",
732
+ "fingerprint": {
733
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
734
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
735
+ "algorithmVersion": 1
736
+ }
737
+ }
738
+ },
739
+ {
740
+ "group": "selection",
741
+ "name": "different-pushurl",
742
+ "remotes": [
743
+ {
744
+ "name": "origin",
745
+ "fetchUrls": ["https://github.com/Acme/Repo.git"],
746
+ "pushUrls": ["https://github.com/Fork/Repo.git"]
747
+ }
748
+ ],
749
+ "expected": {
750
+ "status": "choice_required",
751
+ "reason": "different_urls",
752
+ "remotes": ["origin"]
753
+ }
754
+ },
755
+ {
756
+ "group": "selection",
757
+ "name": "unusable-url-among-many",
758
+ "remotes": [
759
+ {
760
+ "name": "origin",
761
+ "fetchUrls": ["https://github.com/Acme/Repo.git", "file:///repo"]
762
+ }
763
+ ],
764
+ "expected": {
765
+ "status": "choice_required",
766
+ "reason": "different_urls",
767
+ "remotes": ["origin"]
768
+ }
769
+ },
770
+ {
771
+ "group": "selection",
772
+ "name": "no-fetch-url",
773
+ "remotes": [
774
+ {
775
+ "name": "origin",
776
+ "fetchUrls": []
777
+ }
778
+ ],
779
+ "expected": {
780
+ "status": "none",
781
+ "reason": "no_fetch_url"
782
+ }
783
+ },
784
+ {
785
+ "group": "selection",
786
+ "name": "rejected-url",
787
+ "remotes": [
788
+ {
789
+ "name": "origin",
790
+ "fetchUrls": ["file:///repo"]
791
+ }
792
+ ],
793
+ "expected": {
794
+ "status": "rejected",
795
+ "remote": "origin",
796
+ "reason": "local_remote"
797
+ }
798
+ },
799
+ {
800
+ "group": "selection",
801
+ "name": "single-non-origin",
802
+ "remotes": [
803
+ {
804
+ "name": "upstream",
805
+ "fetchUrls": ["https://github.com/Acme/Repo.git"]
806
+ }
807
+ ],
808
+ "expected": {
809
+ "status": "fingerprint",
810
+ "remote": "upstream",
811
+ "fingerprint": {
812
+ "canonical": "repo-v1:github:github.com/Acme/Repo",
813
+ "hash": "e6937c5b7cf5d0fef21e6f082dedb28b658252de020238fec4d57e0810124057",
814
+ "algorithmVersion": 1
815
+ }
816
+ }
817
+ },
818
+ {
819
+ "name": "absolute-ssh-and-home-relative-scp-are-not-equivalent",
820
+ "remotes": [
821
+ {
822
+ "name": "origin",
823
+ "fetchUrls": ["ssh://alice@example.com/repos/app"],
824
+ "pushUrls": ["alice@example.com:repos/app"]
825
+ }
826
+ ],
827
+ "expected": {
828
+ "status": "choice_required",
829
+ "reason": "different_urls",
830
+ "remotes": ["origin"]
831
+ }
832
+ }
833
+ ]
834
+ }