Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unregistration of transfered repos #116

Closed
samccone opened this issue Feb 25, 2015 · 3 comments
Closed

Fix Unregistration of transfered repos #116

samccone opened this issue Feb 25, 2015 · 3 comments

Comments

@samccone
Copy link
Member

Steps to reproduce

  • create a repo under user X
  • user X registers the repo on bower github.com/X/foobar
  • user X transfers the repo to user Y
  • user Y wants to change the registry to a new location
  • user Y tries to unregister (however it fails)

This is because of

var owner = pathParts[1];
var repo = path.basename(pathParts[2], '.git');

https://github.com/samccone/registry/blob/master/lib/routes/packages.js#L43-L44

Which pulls the contributors from the original registration url instead of the updated location of the project (since it has been moved).

screen shot 2015-02-25 at 1 53 13 pm

Solution

  • The simple solution here, is to make sure that when you get the http version of the repo, it does not 301 redirect to the new repo

For instance:

curl -I https://github.com/marionettejs/testing
HTTP/1.1 301 Moved Permanently
Server: GitHub.com
Location: https://github.com/samccone/testing

Clearly the permissions should be checked against samccone/testing


These are just my thoughts after chatting with @desandro, let me know If I am missing something or whatnot. 👍

The ultimate goal here is to unburden the people that have been doing a great job manually doing the unregistration over at bower/bower#120

@desandro
Copy link
Member

👍

@sheerun sheerun closed this as completed in c47b753 Mar 5, 2015
@samccone
Copy link
Member Author

samccone commented Mar 5, 2015

welp there we are thanks @sheerun was going to work on this on Friday, been out on site consulting this week so time has been at a minimum thanks for doing it!

@sheerun
Copy link
Contributor

sheerun commented Mar 5, 2015

thanks for research!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants