Skip to content

Commit

Permalink
Solve sonarcloud security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-rr committed Mar 5, 2024
1 parent b9ee8da commit 5d7e726
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ export default abstract class extends Command {
async finally(error: Error | undefined): Promise<any> {
await super.finally(error);
this.metricsMetadata['success'] = error === undefined;
this.metricsMetadata['source'] = this.generateSHA1(this.specFile?.getSource() || '');
this.metricsMetadata['source'] = this.generateSHA256(this.specFile?.getSource() || '');
await this.recordActionFinished(this.id as string, this.metricsMetadata, this.specFile?.text());
}

async generateSHA1(filePath: string): Promise<any> {
async generateSHA256(filePath: string): Promise<any> {
const fileBuffer = await readFile(filePath);
const hashSum = crypto.createHash('sha1');
const hashSum = crypto.createHash('sha256');
hashSum.update(fileBuffer);
return hashSum.digest('hex');
}
Expand Down

0 comments on commit 5d7e726

Please sign in to comment.