Skip to content

Commit

Permalink
fix(*): add template id to retest scan
Browse files Browse the repository at this point in the history
  • Loading branch information
brightAMasiuk committed Oct 4, 2023
1 parent 845d79b commit 3b6ee07
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/Commands/RetestScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ export class RetestScan implements CommandModule {
requiresArg: true,
demandOption: true
})
.option('template', {
alias: 'tp',
requiresArg: false,
string: true,
describe: 'ID of the template'
})
.positional('scan', {
describe: 'ID of an existing scan which you want to re-run.',
type: 'string',
Expand Down
7 changes: 6 additions & 1 deletion src/Scan/RestScans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Discovery,
Header,
ScanConfig,
ScanRetestConfig,
Scans,
ScanState,
SourceType,
Expand Down Expand Up @@ -52,8 +53,12 @@ export class RestScans implements Scans {
return id;
}

public async retest(scanId: string): Promise<string> {
public async retest(
scanId: string,
body?: ScanRetestConfig
): Promise<string> {
const { id }: { id: string } = await this.client.post({
body,
uri: `/api/v1/scans/${scanId}/retest`
});

Expand Down
6 changes: 5 additions & 1 deletion src/Scan/Scans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ export interface ScanConfig {
repeaters?: string[];
}

export interface ScanRetestConfig {
templateId?: string;
}

export enum IssueCategory {
MEDIUM = 'Medium',
HIGH = 'High',
Expand Down Expand Up @@ -193,7 +197,7 @@ export interface StorageFile {
export interface Scans {
create(body: ScanConfig): Promise<string>;

retest(scanId: string): Promise<string>;
retest(scanId: string, body: ScanRetestConfig): Promise<string>;

stop(scanId: string): Promise<void>;

Expand Down

0 comments on commit 3b6ee07

Please sign in to comment.