[Pulp-list] Determining a repo from the request URL

Jay Dobies jason.dobies at redhat.com
Tue Mar 22 20:44:04 UTC 2011

Hash: SHA1

I've hit a bit of a hurdle in the repo auth.

What we want to do is check the requested URL to see if the consumer is
trying to access a protected repo. Problem is, I'm not sure how to know
which repo is being accessed by the URL.

So for an example, when requesting a repo's metadata yum will look for:


To break that down:

I can get pulp-repo-httpd-location out of the config, so I know how to
chop off the leading part of that URL.

The trickier part is determining what is the repo-relative-path v. the
requested-file. I could do it for things at the repo root, but anything
in a subdirectory would throw a hiccup into that.

The best I could come up with is having a set of all protected repo
relative paths and doing a greedy match of all of those against the URL
to figure out which repo is being used. But that's, like, kinda ugly to
do on a per request basis.

We could drop a yum plugin on consumers in pulp-client that takes the
repo label and stuffs it into a request header, though there's nothing
to stop consumers from just changing the label (we could do an integrity
check to make sure the relative path still matches, but I still don't
like putting that piece client-side).

Is there some magical extra information I don't know about? Some rockin
way to extract the repo relative path from the requested file path which
would let me look up the repo by relative path? Will that lookup even
work; do we have sanity checks in repo create or the model definition
that ensure relative paths are unique?

Any thoughts are appreciated.

- -- 
Jay Dobies
RHCE# 805008743336126
Freenode: jdob
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/


More information about the Pulp-list mailing list