@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.
Files changed (3) hide show
  1. package/README.md +6 -6
  2. package/hipp.js +11 -2
  3. 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.20
223
+ npx @dk/hipp verify @dk/hipp@0.1.21
224
224
  ```
225
225
 
226
226
  ```json
227
227
  {
228
- "origin": "git@github.com:dmytri/hipp.git",
229
- "tag": "v0.1.20",
230
- "revision": "1d5a16d3e837ffd79d4c6704cf1945f6d0b84a60",
231
- "hash": "71fe169e31a68c92c249ae2a443a4062dc379b36bf854a290576e7b595ca4e58",
232
- "signature": "UpVrjogkhwUyPvGj6bK4vOUj3p9R/JDvuDaupOibXFyK5FibLWzpMwjQWHJa78wYx4D4f/BmAn99J3Xt4icaDg==",
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 dataToSign = buildSignData(tarballHash, provenance.remoteUrl, rawTag, revision, name, email);
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: provenance.remoteUrl,
666
+ origin: originUrl,
658
667
  tag: rawTag,
659
668
  revision: revision,
660
669
  hash: tarballHash,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dk/hipp",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "High Integrity Package Publisher",
5
5
  "main": "hipp.js",
6
6
  "bin": {