Project

Profile

Help

Story #1358

closed

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

Added by semyers over 8 years ago. Updated about 5 years 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.


Related issues

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

Actions
Actions #2

Updated by semyers over 8 years ago

Actions #3

Updated by semyers over 8 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.

Actions #4

Updated by semyers over 8 years ago

Actions #5

Updated by semyers over 8 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. :)

Actions #6

Updated by semyers over 8 years ago

Actions #7

Updated by semyers over 8 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

Added by semyers over 8 years ago

Revision 0d3a483c | View on GitHub

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

Actions #8

Updated by semyers over 8 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"}'
Actions #9

Updated by semyers over 8 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #11

Updated by mhrivnak over 8 years ago

  • Platform Release set to 2.7.2
Actions #12

Updated by dkliban@redhat.com about 8 years ago

  • Status changed from MODIFIED to 5
Actions #13

Updated by semyers almost 8 years ago

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

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF