Skip to content

Commit 746009a

Browse files
committed
IDEV-2063: Implement cli for domainhotlist.
1 parent e8c0dea commit 746009a

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

domaintools/cli/commands/feeds.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,83 @@ def feeds_noh(
394394
),
395395
):
396396
DTCLICommand.run(name=c.FEEDS_NOH, params=ctx.params)
397+
398+
399+
@dt_cli.command(
400+
name=c.FEEDS_DOMAINHOTLIST,
401+
help=get_cli_helptext_by_name(command_name=c.FEEDS_DOMAINHOTLIST),
402+
)
403+
def feeds_noh(
404+
ctx: typer.Context,
405+
user: str = typer.Option(None, "-u", "--user", help="Domaintools API Username."),
406+
key: str = typer.Option(None, "-k", "--key", help="DomainTools API key"),
407+
creds_file: str = typer.Option(
408+
"~/.dtapi",
409+
"-c",
410+
"--credfile",
411+
help="Optional file with API username and API key, one per line.",
412+
),
413+
no_verify_ssl: bool = typer.Option(
414+
False,
415+
"--no-verify-ssl",
416+
help="Skip verification of SSL certificate when making HTTPs API calls",
417+
),
418+
no_sign_api_key: bool = typer.Option(
419+
False,
420+
"--no-sign-api-key",
421+
help="Skip signing of api key",
422+
),
423+
header_authentication: bool = typer.Option(
424+
True,
425+
"--no-header-auth",
426+
help="Don't use header authentication",
427+
),
428+
output_format: str = typer.Option(
429+
"jsonl",
430+
"-f",
431+
"--format",
432+
help=f"Output format in [{OutputFormat.JSONL.value}, {OutputFormat.CSV.value}]",
433+
callback=DTCLICommand.validate_feeds_format_input,
434+
),
435+
endpoint: str = typer.Option(
436+
Endpoint.FEED.value,
437+
"-e",
438+
"--endpoint",
439+
help=f"Valid endpoints: [{Endpoint.FEED.value}, {Endpoint.DOWNLOAD.value}]",
440+
callback=DTCLICommand.validate_endpoint_input,
441+
),
442+
sessionID: str = typer.Option(
443+
None,
444+
"--session-id",
445+
help="Unique identifier for the session",
446+
),
447+
after: str = typer.Option(
448+
None,
449+
"--after",
450+
help="Start of the time window, relative to the current time in seconds, for which data will be provided",
451+
callback=DTCLICommand.validate_after_or_before_input,
452+
),
453+
before: str = typer.Option(
454+
None,
455+
"--before",
456+
help="The end of the query window in seconds, relative to the current time, inclusive",
457+
callback=DTCLICommand.validate_after_or_before_input,
458+
),
459+
domain: str = typer.Option(
460+
None,
461+
"-d",
462+
"--domain",
463+
help="A string value used to filter feed results",
464+
),
465+
headers: bool = typer.Option(
466+
False,
467+
"--headers",
468+
help="Adds a header to the first line of response when text/csv is set in header parameters",
469+
),
470+
top: str = typer.Option(
471+
None,
472+
"--top",
473+
help="Number of results to return in the response payload. This is ignored in download endpoint",
474+
),
475+
):
476+
DTCLICommand.run(name=c.FEEDS_DOMAINHOTLIST, params=ctx.params)

domaintools/cli/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@
4343
FEEDS_NAD = "nad"
4444
FEEDS_NOD = "nod"
4545
FEEDS_NOH = "noh"
46+
FEEDS_DOMAINHOTLIST = "domainhotlist"
4647
FEEDS_DOMAINRDAP = "domainrdap"
4748
FEEDS_DOMAINDISCOVERY = "domaindiscovery"

domaintools/cli/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def _iris_investigate_helptext():
6464
c.FEEDS_NAD: "Returns back newly active domains feed.",
6565
c.FEEDS_NOD: "Returns back newly observed domains feed.",
6666
c.FEEDS_NOH: "Returns back newly observed hosts feed.",
67+
c.FEEDS_DOMAINHOTLIST: "Returns domaint hotlist feed.",
6768
c.FEEDS_DOMAINRDAP: "Returns changes to global domain registration information, populated by the Registration Data Access Protocol (RDAP).",
6869
c.FEEDS_DOMAINDISCOVERY: "Returns new domains as they are either discovered in domain registration information, observed by our global sensor network, or reported by trusted third parties.",
6970
}

0 commit comments

Comments
 (0)