Skip to content

Commit

Permalink
Merge pull request #164 from greenbone/add-usage-type-to-get-reports
Browse files Browse the repository at this point in the history
Change: Add usage_type parameter to GMP get_reports.
  • Loading branch information
a-h-abdelsalam authored Aug 23, 2024
2 parents 1896ae3 + 5e2f82d commit 850e6fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
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 @@ char *
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");

arguments = gmp_arguments_new ();

Expand Down Expand Up @@ -8498,6 +8499,10 @@ get_reports_gmp (gvm_connection_t *connection, credentials_t *credentials,
{
gmp_arguments_add (arguments, "details", details);
}
if (usage_type)
{
gmp_arguments_add (arguments, "usage_type", usage_type);
}

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

0 comments on commit 850e6fb

Please sign in to comment.