From 7f51633562e630f3ca85745dd9eee4d3294c2c26 Mon Sep 17 00:00:00 2001 From: HeilandS Date: Tue, 20 Jan 2026 09:54:15 +0100 Subject: [PATCH 1/4] Changes host-url to an input value like secret-key and access-key --- README.md | 2 +- audiness/main.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a774481..7d08697 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ $ audiness --help ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ * --access-key TEXT Nessus API access key [env var: ACCESS_KEY] [default: None] [required] │ │ * --secret-key TEXT Nessus API secret key [env var: SECRET_KEY] [default: None] [required] │ -│ --host TEXT URL to Nessus instance [default: https://localhost:8834] │ +│ --host-key TEXT URL to Nessus instance │ │ --install-completion Install completion for the current shell. │ │ --show-completion Show completion for the current shell, to copy it or customize the installation. │ │ --help Show this message and exit. │ diff --git a/audiness/main.py b/audiness/main.py index 6022bde..457d937 100644 --- a/audiness/main.py +++ b/audiness/main.py @@ -50,11 +50,20 @@ def main( callback=validate_key, ), ], - host: Annotated[ - str, typer.Option(help="URL to Nessus instance", callback=validate_host) - ] = "https://localhost:8834", + host_url: Annotated[ + str, + typer.Option( + envvar="HOST_URL", + help="URL to Nessus instance", + prompt=True, + callback=validate_host, + ), + ], + # host: Annotated[ + # str, typer.Option(help="URL to Nessus instance", callback=validate_host) + # ] = "https://localhost:8838", ): - connection = setup_connection(host, access_key, secret_key) + connection = setup_connection(host_url, access_key, secret_key) ctx.obj = {"connection": connection} From ec8225b9ed248d8440030ada43e8d630baf11434 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Apr 2026 11:19:09 +0200 Subject: [PATCH 2/4] Update parameter name - keep the default - remove the commend --- audiness/main.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/audiness/main.py b/audiness/main.py index 457d937..faaf125 100644 --- a/audiness/main.py +++ b/audiness/main.py @@ -50,20 +50,17 @@ def main( callback=validate_key, ), ], - host_url: Annotated[ + url: Annotated[ str, typer.Option( - envvar="HOST_URL", + envvar="URL", help="URL to Nessus instance", prompt=True, callback=validate_host, ), - ], - # host: Annotated[ - # str, typer.Option(help="URL to Nessus instance", callback=validate_host) - # ] = "https://localhost:8838", + ] = "https://localhost:8834", ): - connection = setup_connection(host_url, access_key, secret_key) + connection = setup_connection(url, access_key, secret_key) ctx.obj = {"connection": connection} From 54ec593a2fd811e761f59b2e7a1dc584f0dbd45d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Apr 2026 11:20:11 +0200 Subject: [PATCH 3/4] Update README --- README.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7d08697..7d1b162 100644 --- a/README.md +++ b/README.md @@ -48,26 +48,28 @@ $ audiness --help Usage: audiness [OPTIONS] COMMAND [ARGS]... -╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ -│ * --access-key TEXT Nessus API access key [env var: ACCESS_KEY] [default: None] [required] │ -│ * --secret-key TEXT Nessus API secret key [env var: SECRET_KEY] [default: None] [required] │ -│ --host-key TEXT URL to Nessus instance │ -│ --install-completion Install completion for the current shell. │ -│ --show-completion Show completion for the current shell, to copy it or customize the installation. │ -│ --help Show this message and exit. │ -╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ -╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ -│ folders │ -│ scans │ -│ server │ -│ software │ -╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ * --access-key TEXT Nessus API access key [env var: ACCESS_KEY] [required] │ +│ * --secret-key TEXT Nessus API secret key [env var: SECRET_KEY] [required] │ +│ --url TEXT URL to Nessus instance [env var: URL] [default: https://localhost:8834] │ +│ --install-completion Install completion for the current shell. │ +│ --show-completion Show completion for the current shell, to copy it or customize the installation. │ +│ --help Show this message and exit. │ +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ folders │ +│ policies │ +│ scans │ +│ server │ +│ software │ +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` If you don't want to enter the access key and the secrect key then put them in the environment of your shell. ```bash +$ exoprt URL="https://localhost:8838" $ export ACCESS_KEY="ae0bf3d57f8f8f6bcd8d01d3aedde60937d08647da4d89a6eb4dba2a9bee5d5d" $ export SECRET_KEY="5f671a64819221e6b5c2361016af7dcaeb30de359009fee589b3a5d85dea11b4" ``` From d6555c84047630feae64b1c8dfb7ff631094ebfe Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 9 Apr 2026 11:20:43 +0200 Subject: [PATCH 4/4] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d1b162..effb892 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ $ audiness --help ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` -If you don't want to enter the access key and the secrect key then put them in the +If you don't want to enter the access key and the secret key then put them in the environment of your shell. ```bash