Project

Profile

Help

Issue #3850

closed

Return relative URIs (e.g. /pulp/api/v3/repositories/1/) in the API

Added by daviddavis almost 6 years ago. Updated almost 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
API Bindings, Katello
Sprint:
Sprint 42
Quarter:

Description

The hrefs for objects returned from the bindings have full urls with hostname, port, etc. However, there are a couple reasons for this:

1. Katello has said their user base sometimes switches hostname/port/etc. So having full URIs means that they would be mutable.
2. The bindings require relative URIs
3. Full URIs are shorter and this means storing less data for third-party apps and such.

We should be returning relative URIs in our API for all hrefs. This includes places like created_resources in the task response.


Related issues

Related to Pulp - Test #4123: Test the generated API bindsCLOSED - COMPLETEdkliban@redhat.comActions
Actions #1

Updated by daviddavis almost 6 years ago

  • Description updated (diff)
Actions #2

Updated by CodeHeeler almost 6 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by daviddavis almost 6 years ago

  • Sprint/Milestone set to 3.0.0
Actions #4

Updated by daviddavis almost 6 years ago

  • Tags API Bindings added
Actions #5

Updated by jsherril@redhat.com almost 6 years ago

  • Tags Katello-P1 added
Actions #6

Updated by daviddavis over 5 years ago

  • Subject changed from Binding url formats are inconsistent to Binding URI formats are inconsistent
Actions #7

Updated by daviddavis over 5 years ago

  • Subject changed from Binding URI formats are inconsistent to Use relative URIs (e.g. /pulp/api/v3/repositories/file/1/)
  • Description updated (diff)
Actions #8

Updated by daviddavis over 5 years ago

  • Subject changed from Use relative URIs (e.g. /pulp/api/v3/repositories/file/1/) to Return relative URIs (e.g. /pulp/api/v3/repositories/file/1/) in the API
  • Description updated (diff)
Actions #9

Updated by bmbouter over 5 years ago

  • Groomed changed from No to Yes
  • Sprint Candidate changed from No to Yes

This looks right to me. It's consistent with the recent postings of the id vs href special interest group. I'm marking as groomed and sprint candidate.

Actions #10

Updated by daviddavis over 5 years ago

  • Description updated (diff)
Actions #11

Updated by daviddavis over 5 years ago

  • Subject changed from Return relative URIs (e.g. /pulp/api/v3/repositories/file/1/) in the API to Return relative URIs (e.g. /pulp/api/v3/repositories/1/) in the API
Actions #12

Updated by daviddavis over 5 years ago

  • Sprint set to Sprint 42
Actions #13

Updated by dkliban@redhat.com over 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dkliban@redhat.com

Added by dkliban@redhat.com over 5 years ago

Revision 3cb2651d | View on GitHub

Switches FileContent to using relative URLs for href

Required PR: https://github.com/pulp/pulp/pull/3607

re: #3850 https://pulp.plan.io/issues/3850

Added by dkliban@redhat.com over 5 years ago

Revision ca8361f9 | View on GitHub

Update docs and code for relative hrefs

re: #3850 https://pulp.plan.io/issues/3850

Added by dkliban@redhat.com over 5 years ago

Revision 10992664 | View on GitHub

Problem: identity fields are serialized as full URLs

Solution: stop passing request to the serializer so it can only form relative URLs

This patch modifies the behavior of DetailIdentityField and it also adds an additional

ItentityField RelatedField NestedRelatedField NestedIdentityField

to replace

HyperlinkIdentityField HyperlinkRelatedField NestedHyperlinkedIdentityField NestedHyperlinkedRelatedField

provided by DRF and DRF nested.

Required PR: https://github.com/pulp/pulp_file/pull/114

re: #3850 https://pulp.plan.io/issues/3850

Added by dkliban@redhat.com over 5 years ago

Revision 10992664 | View on GitHub

Problem: identity fields are serialized as full URLs

Solution: stop passing request to the serializer so it can only form relative URLs

This patch modifies the behavior of DetailIdentityField and it also adds an additional

ItentityField RelatedField NestedRelatedField NestedIdentityField

to replace

HyperlinkIdentityField HyperlinkRelatedField NestedHyperlinkedIdentityField NestedHyperlinkedRelatedField

provided by DRF and DRF nested.

Required PR: https://github.com/pulp/pulp_file/pull/114

re: #3850 https://pulp.plan.io/issues/3850

Actions #16

Updated by dkliban@redhat.com over 5 years ago

  • Status changed from POST to MODIFIED
Actions #17

Updated by kersom over 5 years ago

  • Related to Test #4123: Test the generated API binds added
Actions #18

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #19

Updated by bmbouter over 4 years ago

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

Updated by ggainey almost 4 years ago

  • Tags Katello added
  • Tags deleted (Katello-P1)

Also available in: Atom PDF