Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
maksadbek committed Sep 10, 2024
2 parents 2bfd32f + 1525a04 commit b8b3e5a
Show file tree
Hide file tree
Showing 12 changed files with 327 additions and 341 deletions.
620 changes: 300 additions & 320 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@brightsec/cli",
"version": "12.4.0",
"version": "12.5.0-next.2",
"private": false,
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/GetEntryPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export class GetEntryPoints implements CommandModule {
insecure: args.insecure as boolean,
baseURL: args.api as string,
apiKey: args.token as string,
proxyURL: (args.proxyBright ?? args.proxy) as string
proxyURL: (args.proxyBright ?? args.proxy) as string,
timeout: args.timeout as number
}
})
);
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/PollingScanStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export class PollingScanStatus implements CommandModule {
insecure: args.insecure as boolean,
baseURL: args.api as string,
apiKey: args.token as string,
proxyURL: (args.proxyBright ?? args.proxy) as string
proxyURL: (args.proxyBright ?? args.proxy) as string,
timeout: args.timeout as number
}
})
);
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/RetestScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export class RetestScan implements CommandModule {
insecure: args.insecure as boolean,
baseURL: args.api as string,
apiKey: args.token as string,
proxyURL: (args.proxyBright ?? args.proxy) as string
proxyURL: (args.proxyBright ?? args.proxy) as string,
timeout: args.timeout as number
}
})
);
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/RunRepeater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export class RunRepeater implements CommandModule {
daemon: 'remove-daemon',
ntlm: [
'proxy',
'proxy-external',
'proxy-internal',
'proxy-bright',
'proxy-target',
'experimental-connection-reuse'
]
})
Expand Down Expand Up @@ -205,7 +205,7 @@ export class RunRepeater implements CommandModule {
useValue: {
uri: args.repeaterServer as string,
token: args.token as string,
connectTimeout: 10000,
connectTimeout: args.timeout as number,
proxyUrl: (args.proxyBright ?? args.proxy) as string,
insecure: args.insecure as boolean
}
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/RunScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ export class RunScan implements CommandModule {
insecure: args.insecure as boolean,
baseURL: args.api as string,
apiKey: args.token as string,
proxyURL: (args.proxyBright ?? args.proxy) as string
proxyURL: (args.proxyBright ?? args.proxy) as string,
timeout: args.timeout as number
}
})
);
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/StopScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export class StopScan implements CommandModule {
insecure: args.insecure as boolean,
baseURL: args.api as string,
apiKey: args.token as string,
proxyURL: (args.proxyBright ?? args.proxy) as string
proxyURL: (args.proxyBright ?? args.proxy) as string,
timeout: args.timeout as number
}
})
);
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/UploadArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export class UploadArchive implements CommandModule {
insecure: args.insecure as boolean,
baseURL: args.api as string,
apiKey: args.token as string,
proxyURL: (args.proxyBright ?? args.proxy) as string
proxyURL: (args.proxyBright ?? args.proxy) as string,
timeout: args.timeout as number
}
});
});
Expand Down
12 changes: 9 additions & 3 deletions src/Config/CliBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,25 @@ export class CliBuilder {
'Specify a proxy URL to route all traffic through. This should be an HTTP(S), SOCKS4, or SOCKS5 URL. By default, if you specify SOCKS://<URL>, then SOCKS5h is applied.'
})
.option('proxy-bright', {
alias: 'proxy-external',
requiresArg: true,
describe:
'Specify a proxy URL to route all outbound traffic through. For more information, see the --proxy option.'
})
.option('proxy-target', {
alias: 'proxy-internal',
requiresArg: true,
describe:
'Specify a proxy URL to route all inbound traffic through. For more information, see the --proxy option.'
})
.option('timeout', {
describe: 'Request timeout in seconds',
default: 30,
type: 'number',
coerce(arg: number) {
return arg * 1000;
}
})
.conflicts({
proxy: ['proxy-internal', 'proxy-external'],
proxy: ['proxy-bright', 'proxy-target'],
hostname: 'cluster'
})
.middleware((args: Arguments) => {
Expand Down
8 changes: 1 addition & 7 deletions src/EntryPoint/RestEntryPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ export class RestEntryPoints implements EntryPoints {
constructor(
@inject(ProxyFactory) private readonly proxyFactory: ProxyFactory,
@inject(RestProjectsOptions)
{
baseURL,
apiKey,
insecure,
proxyURL,
timeout = 10000
}: RestProjectsOptions
{ baseURL, apiKey, insecure, proxyURL, timeout }: RestProjectsOptions
) {
const {
httpAgent = new http.Agent(),
Expand Down
2 changes: 1 addition & 1 deletion src/Scan/RestScans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class RestScans implements Scans {
@inject(delay(() => CliInfo)) private readonly info: CliInfo,
@inject(ProxyFactory) private readonly proxyFactory: ProxyFactory,
@inject(RestScansOptions)
{ baseURL, apiKey, insecure, proxyURL, timeout = 10000 }: RestScansOptions
{ baseURL, apiKey, insecure, proxyURL, timeout }: RestScansOptions
) {
const {
httpAgent = new http.Agent(),
Expand Down

0 comments on commit b8b3e5a

Please sign in to comment.