Project

Profile

Help

Issue #3850

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

Added by daviddavis almost 2 years ago. Updated 28 days ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
API Bindings, Katello
QA Contact:
Complexity:
Smash Test:
Sprint:
Sprint 42

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 binds CLOSED - COMPLETE Actions

Associated revisions

Revision 10992664 View on GitHub
Added by dkliban@redhat.com almost 2 years ago

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

Revision 10992664 View on GitHub
Added by dkliban@redhat.com almost 2 years ago

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

History

#1 Updated by daviddavis almost 2 years ago

  • Description updated (diff)

#2 Updated by CodeHeeler almost 2 years ago

  • Triaged changed from No to Yes

#3 Updated by daviddavis almost 2 years ago

  • Sprint/Milestone set to 3.0.0

#4 Updated by daviddavis almost 2 years ago

  • Tags API Bindings added

#5 Updated by jsherril@redhat.com almost 2 years ago

  • Tags Katello-P1 added

#6 Updated by daviddavis almost 2 years ago

  • Subject changed from Binding url formats are inconsistent to Binding URI formats are inconsistent

#7 Updated by daviddavis almost 2 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)

#8 Updated by daviddavis almost 2 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)

#9 Updated by bmbouter almost 2 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.

#10 Updated by daviddavis almost 2 years ago

  • Description updated (diff)

#11 Updated by daviddavis almost 2 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

#12 Updated by daviddavis almost 2 years ago

  • Sprint set to Sprint 42

#13 Updated by dkliban@redhat.com almost 2 years ago

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

#16 Updated by dkliban@redhat.com almost 2 years ago

  • Status changed from POST to MODIFIED

#17 Updated by kersom over 1 year ago

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

#18 Updated by bmbouter about 1 year ago

  • Tags deleted (Pulp 3)

#19 Updated by bmbouter 6 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

#20 Updated by ggainey 28 days ago

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

Please register to edit this issue

Also available in: Atom PDF