Project

Profile

Help

Issue #3850

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

Added by daviddavis over 1 year ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
API Bindings, Katello-P1
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
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 MODIFIED Actions

Associated revisions

Revision 10992664 View on GitHub
Added by dkliban@redhat.com about 1 year 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 about 1 year 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 about 1 year 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 over 1 year ago

  • Description updated (diff)

#2 Updated by CodeHeeler over 1 year ago

  • Triaged changed from No to Yes

#3 Updated by daviddavis over 1 year ago

  • Sprint/Milestone set to 3.0

#4 Updated by daviddavis over 1 year ago

  • Tags API Bindings added

#5 Updated by jsherril@redhat.com over 1 year ago

  • Tags Katello-P1 added

#6 Updated by daviddavis about 1 year ago

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

#7 Updated by daviddavis about 1 year 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 about 1 year 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 about 1 year 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 about 1 year ago

  • Description updated (diff)

#11 Updated by daviddavis about 1 year 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 about 1 year ago

  • Sprint set to Sprint 42

#13 Updated by dkliban@redhat.com about 1 year ago

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

#16 Updated by dkliban@redhat.com about 1 year ago

  • Status changed from POST to MODIFIED

#17 Updated by kersom 12 months ago

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

#18 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF