Skip to content

Allow valid namespace paths with dots for api PUT

Jackie Fraser requested to merge allow_dots_in_namespace_path_for_puts into master

What does this MR do?

By default Rails doesn't allow dots in wildcard segments. Rails allows this to be overridden with constraints, which were already being specified on the namespace scope in config/routes/projects.rb, but they were not being overridden on the actual put command for ee/lib/ee/api/namespaces.rb.

This MR adds the same Regex used for the namespace scope in config/routes/projects.rb to the id requirements of put :id, fixing the issue described in customers-gitlab-com#711 (closed)

Closes customers-gitlab-com#711 (closed)

Also fixes PUT :id/gitlab_subscription, POST :id/gitlab_subscription and GET :id/gitlab_subscription when using the namespace path that contains dots.

Screenshots

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 Jackie Fraser

Merge request reports