Skip to content

Add constraint to id param for NetworkPoliciesController

Sashi Kumar Kumaresan requested to merge sk/333828-fix-update-policy into master

What does this MR do?

Addresses #333828 (closed)

This change fixes the bug while trying to update Cilium policies. The reason for the bug was that rails does not accept dots in routes by default for id params.

Rails Guide:

By default the :id parameter doesn't accept dots - this is because the dot is used as a separator for formatted routes. If you need to use a dot within an :id add a constraint which overrides this - for example id: /[^/]+/ allows anything except a slash.

I missed to update this in !65307 (merged)

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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

Merge request reports