Project

Profile

Help

Issue #5486

closed

Plugin url patterns allow an arbitrary base path (not just /pulp/api/v3/)

Added by iballou over 3 years ago. Updated about 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 59
Quarter:

Description

Original:

In each of their generated docs I noticed the endpoints all looked like

**POST** /docker/blah

instead of

**POST** /pulp/api/v3/blah

. Also, when doing DockerRecursiveAddApi.create I get a 404 and

No route matches [POST] "/docker/recursive-add"

at

lib/pulp_docker_client/api_client.rb:81:in `call_api'

However, it looks like the schema is actually correct, but the urlmatching is not strict enough.

All of these are valid and routed to the same view:

http POST localhost:24817/docker/recursive-add/ repository=/pulp/api/v3/repositories/597c2209-2ff2-4eec-b476-3740ff2879de/
http POST localhost:24817/pulp/api/v3/docker/recursive-add/ repository=/pulp/api/v3/repositories/597c2209-2ff2-4eec-b476-3740ff2879de/
http POST localhost:24817/thanks/for/reading/the/details/docker/recursive-add/ repository=/pulp/api/v3/repositories/597c2209-2ff2-4eec-b476-3740ff2879de/

IIRC, this is actually a deliberate feature of the plugin api, so they can register non-prefixed endpoints like /v2/ for Docker.

This might just be as simple as adding "^pulp/api/v3/" to the start of the urlpatterns, but it will need to be done for any plugins that have implemented custom urls.


Related issues

Related to RPM Support - Issue #5330: Hardcoded URL patterns needs proper check CLOSED - CURRENTRELEASEipanova@redhat.comActions
Actions #1

Updated by amacdona@redhat.com over 3 years ago

  • Project changed from Docker Support to Pulp
  • Subject changed from DockerRecursiveAdd, DockerRecursiveRemove, and DockerCopy ruby bindings go to the wrong url to Plugin url patterns allow an arbitrary base path (not just /pulp/api/v3/)
  • Description updated (diff)
Actions #2

Updated by amacdona@redhat.com over 3 years ago

This seems fixes the issue (forcing the use of /pulp/api/v3/) for pulp_docker. https://github.com/pulp/pulp_docker/pull/415/

Actions #3

Updated by amacdona@redhat.com over 3 years ago

  • Description updated (diff)
  • Tags deleted (API Bindings)
Actions #4

Updated by ipanova@redhat.com over 3 years ago

  • Related to Issue #5330: Hardcoded URL patterns needs proper check added
Actions #5

Updated by ipanova@redhat.com over 3 years ago

  • Status changed from NEW to POST
  • Assignee set to amacdona@redhat.com
  • Sprint set to Sprint 59
Actions #6

Updated by ipanova@redhat.com over 3 years ago

  • Triaged changed from No to Yes
Actions #7

Updated by ipanova@redhat.com over 3 years ago

  • Project changed from Pulp to Docker Support

I am moving this back to docker since we fixed this only in docker plugin, other plugins would need to submit separate PRs and/or issues

Actions #8

Updated by ipanova@redhat.com over 3 years ago

  • Status changed from POST to MODIFIED
Actions #9

Updated by ipanova@redhat.com about 3 years ago

  • Project changed from Docker Support to Container Support
Actions #10

Updated by ipanova@redhat.com about 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #11

Updated by ipanova@redhat.com about 3 years ago

  • Sprint/Milestone set to 1.0.0

Also available in: Atom PDF