Skip to content

Fix client-side mutation for updating DAST site profiles

What does this MR do?

This addresses a few mismatches between the frontend and the backend GraphQL implementations for updating DAST site profiles. Specifically:

  • The client-side mutation's schema was malformed, with an extra project field that didn't resolve to anything.
  • The type for the $id parameter was ID! when it should have been DastSiteProfileID!.
  • Finally, we were passing a plain ID via the $id parameter, when it should actually have been a global ID.

This also adds some specs for the ee/app/views/projects/dast_site_profiles/edit.html.haml view.

How to test this?

  • Enable the feature flag.
echo "Feature.enable(:security_on_demand_scans_feature_flag)" | spring rails c
  • Visit a project's DAST profiles library: /:group/:project/-/on_demand_scans/profiles.
  • Create a profile, then edit it.

Screenshots

Previously, any attempt to update a site profile would fail, with a generic error message showing up:

Screen_Shot_2020-08-12_at_9.54.20_AM

With these changes, editing a site profile now works properly, and you're properly redirected to the profiles library as expected.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Paul Gascou-Vaillancourt

Merge request reports