Skip to content

Commit

Permalink
chore(signing-utils): add ssh2 types and don't override file with gpg…
Browse files Browse the repository at this point in the history
… signing (#205)

misc fixes
  • Loading branch information
baileympearson authored Jan 23, 2024
1 parent 78b0e28 commit 9b263ee
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
26 changes: 10 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/signing-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@types/mocha": "^9.1.1",
"@types/node": "^17.0.35",
"@types/sinon-chai": "^3.2.5",
"@types/ssh2": "^1.11.18",
"chai": "^4.3.6",
"depcheck": "^1.4.1",
"eslint": "^7.25.0",
Expand All @@ -68,6 +67,7 @@
},
"dependencies": {
"debug": "^4.3.4",
"ssh2": "^1.15.0"
"ssh2": "^1.15.0",
"@types/ssh2": "^1.11.19"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('RemoteSigningClient', function () {
const remoteSigningClient = new RemoteSigningClient(getMockedSSHClient(), {
workingDirectory: workingDirectoryPath,
signingScript: signingScript,
signingMethod: 'gpg',
signingMethod: 'jsign',
});

await remoteSigningClient.sign(fileToSign);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ export class RemoteSigningClient implements SigningClient {
await this.signRemoteFile(path.basename(remotePath));
debug(`SFTP: Signed file ${file}`);

await this.sshClient.downloadFile(remotePath, file);
debug(`SFTP: Downloaded signed file to ${file}`);
if (this.options.signingMethod === 'jsign') {
await this.sshClient.downloadFile(remotePath, file);
debug(`SFTP: Downloaded signed file to ${file}`);
}

// For signing using gpg, `.sig` file is created along side the file being signed.
// We also have to download it back and put it in the same path as original file.
Expand Down

0 comments on commit 9b263ee

Please sign in to comment.