@dk/hipp 0.1.20 → 0.1.21
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/README.md +6 -6
- package/hipp.js +11 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -220,16 +220,16 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
220
220
|
Verify this package with [@dk/hipp](https://www.npmjs.com/package/@dk/hipp):
|
|
221
221
|
|
|
222
222
|
```bash
|
|
223
|
-
npx @dk/hipp verify @dk/hipp@0.1.
|
|
223
|
+
npx @dk/hipp verify @dk/hipp@0.1.21
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
```json
|
|
227
227
|
{
|
|
228
|
-
"origin": "
|
|
229
|
-
"tag": "v0.1.
|
|
230
|
-
"revision": "
|
|
231
|
-
"hash": "
|
|
232
|
-
"signature": "
|
|
228
|
+
"origin": "https://github.com/dmytri/hipp.git",
|
|
229
|
+
"tag": "v0.1.21",
|
|
230
|
+
"revision": "0a0be44db52e62d425959bda9f640049005c8809",
|
|
231
|
+
"hash": "50de72f67534fe6d9054c5b0cfab317aa1620d258cb291bd1dc65d60a43d77d8",
|
|
232
|
+
"signature": "m0+8tk8kM835KJcTeHPZPG20XLh4rEtyISoJB54aV8LknEmJVM5yRG6syq+Kg0AAP6VcJMmNrpMG9jOeDkyoBQ==",
|
|
233
233
|
"name": "Dmytri Kleiner",
|
|
234
234
|
"email": "dev@dmytri.to",
|
|
235
235
|
"npm": "11.12.1",
|
package/hipp.js
CHANGED
|
@@ -33,6 +33,14 @@ function getGitUserInfo() {
|
|
|
33
33
|
return { name, email };
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
function sshToHttpsUrl(sshUrl) {
|
|
37
|
+
const match = sshUrl.match(/^git@([^:]+):(.+\.git)$/);
|
|
38
|
+
if (match) {
|
|
39
|
+
return `https://${match[1]}/${match[2]}`;
|
|
40
|
+
}
|
|
41
|
+
return sshUrl;
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
function runCmd(cmd, args, options = {}) {
|
|
37
45
|
const result = spawnSync(cmd, args, {
|
|
38
46
|
encoding: 'utf8',
|
|
@@ -650,11 +658,12 @@ async function run() {
|
|
|
650
658
|
const revision = refInfo.head;
|
|
651
659
|
const npmVersion = runCmd('npm', ['--version']).stdout.trim();
|
|
652
660
|
const nodeVersion = process.version;
|
|
653
|
-
const
|
|
661
|
+
const originUrl = sshToHttpsUrl(provenance.remoteUrl);
|
|
662
|
+
const dataToSign = buildSignData(tarballHash, originUrl, rawTag, revision, name, email);
|
|
654
663
|
const signature = signContent(dataToSign, privateKey);
|
|
655
664
|
|
|
656
665
|
const manifestJson = {
|
|
657
|
-
origin:
|
|
666
|
+
origin: originUrl,
|
|
658
667
|
tag: rawTag,
|
|
659
668
|
revision: revision,
|
|
660
669
|
hash: tarballHash,
|