Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Add usage_type parameter to GMP get_reports. #164

Merged
merged 5 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/gsad_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -8465,12 +8465,13 @@
get_reports_gmp (gvm_connection_t *connection, credentials_t *credentials,
params_t *params, cmd_response_data_t *response_data)
{
const gchar *filter, *filter_id, *details;
const gchar *filter, *filter_id, *details, *usage_type;
gmp_arguments_t *arguments;

filter = params_value (params, "filter");
filter_id = params_value (params, "filter_id");
details = params_value (params, "details");
usage_type = params_value (params, "usage_type");

Check warning on line 8474 in src/gsad_gmp.c

View check run for this annotation

Codecov / codecov/patch

src/gsad_gmp.c#L8474

Added line #L8474 was not covered by tests

arguments = gmp_arguments_new ();

Expand Down Expand Up @@ -8498,6 +8499,10 @@
{
gmp_arguments_add (arguments, "details", details);
}
if (usage_type)
{
gmp_arguments_add (arguments, "usage_type", usage_type);

Check warning on line 8504 in src/gsad_gmp.c

View check run for this annotation

Codecov / codecov/patch

src/gsad_gmp.c#L8504

Added line #L8504 was not covered by tests
}

params_remove (params, "filter");
params_remove (params, "filter_id");
Expand Down
10 changes: 5 additions & 5 deletions src/gsad_validator.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,11 @@ init_validator ()
gvm_validator_add (validator, "port_range_id", "^[a-z0-9\\-]+$");
gvm_validator_add (
validator, "resource_type",
"^(alert|asset|cert_bund_adv|config|cpe|credential|cve|dfn_cert_adv|"
"filter|group|host|info|nvt|note|os|ovaldef|override|permission|port_list|"
"report|report_config|report_format|result|role|scanner|schedule|tag|"
"target|task|ticket|"
"tls_certificate|user|vuln|)$");
"^(alert|asset|audit_report|audit|cert_bund_adv|config|cpe|credential|cve|"
"dfn_cert_adv|filter|group|host|info|nvt|note|os|ovaldef|override|"
"permission|policy|port_list|report|report_config|report_format|result|"
"role|scanner|"
"schedule|tag|target|task|ticket|tls_certificate|user|vuln|)$");
gvm_validator_add (validator, "resource_id", "^[[:alnum:]\\-_.:\\/~]*$");
gvm_validator_add (validator, "resources_action", "^(|add|set|remove)$");
gvm_validator_add (
Expand Down
Loading