Project

Profile

Help

Story #1358

As a user, I can sync from a SLES 12+ repository.

Added by semyers about 5 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
2.8.0
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

SUSE 12 repository HTTP (S) requests are authorized by an auth token in the query string. The auth token is the entire query string, and must be included in every request to the repository. To include this query string in requests to the source repository, pulp needs to first know the auth token, and then use it when building URLs to download content (metadata, packages, etc) from the source repository.


Checklist


Related issues

Related to RPM Support - Task #928: Test with SLESCLOSED - NOTABUG

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 0d3a483c View on GitHub
Added by semyers almost 5 years ago

query_auth_token support

Added the ability to support query-string-based authorization to repos that support it, such as a SLES 12 repo

fixes #1358

https://pulp.plan.io/issues/1358

History

#2 Updated by semyers about 5 years ago

#3 Updated by semyers about 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to semyers

I started picking at this this earlier today, sort of thinking out loud in code. I ended up accidentally writing the code, so I guess I'm working on this now... :\

I've got two failing tests in the existing suite, and a few more to write to prove the new functionality.

#4 Updated by semyers about 5 years ago

  • Checklist item Pulp can store the SLES auth token set to Done
  • Checklist item Pulp can retrieve the SLES auth token, and append it to a URL set to Done
  • Checklist item Pulp modifies URLs where appropriate to include the SLES auth token set to Done

#5 Updated by semyers about 5 years ago

Storing the SLES auth token is pretty trivial, since pulp already makes it easy to tweak importer configs via the REST API. Here's an HTTPie example:

http --auth admin:admin --verify no PUT https://localhost/pulp/api/v2/repositories/sles-12/ importer_config:='{"sles_auth_token": "foo"}'

Building the URL modifier is easy enough, and I'm also able to DRY up some code, since pulp_rpm does a bit of trailing slash checking, appending stuff to url paths, etc, that benefits from centralizing the rewriting behavior.

I believe I've wired up the URL rewriting where needed to sync SLES 12+ repos, but writing the tests to prove it is proving a little bit tricky, most likely due to my lack of experience with Mock. :)

#6 Updated by semyers about 5 years ago

  • Checklist item Pulp's documentation instructs users in the usage of this feature set to Done
  • Checklist item Pulp's test suite proves that this feature works set to Done

#7 Updated by semyers about 5 years ago

  • Status changed from ASSIGNED to POST

Got mock figured out, maybe had a bit too much fun playing with it...

I still have some scope-related questions before I can totally finish this up, but the PR is up for review now:
https://github.com/pulp/pulp_rpm/pull/734

#8 Updated by semyers almost 5 years ago

sles_auth_token became the more generic query_auth_token, so the httpie example above would turn into

http --auth admin:admin PUT https://host/pulp/api/v2/repositories/repo-id/ importer_config:='{"query_auth_token": "foo"}'

#9 Updated by semyers almost 5 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#11 Updated by mhrivnak almost 5 years ago

  • Platform Release set to 2.7.2

#12 Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from MODIFIED to 5

#13 Updated by semyers over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
  • Platform Release changed from 2.7.2 to 2.8.0

#14 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF