Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11351 (new defect)

Opened 4 months ago

Last modified 4 months ago

[PATCH] ./script/plugin install from secured repositories failes

Reported by: fraggle Assigned to: core
Priority: normal Milestone: 2.x
Component: Railties Version: edge
Severity: normal Keywords: authentication
Cc:

Description

I have seen some undergoings in the gem-development fixing this problem. http://whynotwiki.com/Gems section "401 Authorization Required": How to fix

What about rails plugin install? I am not able to install a plugin from a secured svn repository. (basic auth)

./script/plugin -v install http://username:password@mysvn.domain/repository

is not working.

Result:

#<OpenURI::HTTPError: 401 Authorization Required>

Attachments

plugin_install_from_secure_repository.patch (1.1 kB) - added by david.calavera on 03/19/08 15:28:49.
it also fixes the same bug with the list command
plugin_install_from_secure_repository.diff (1.1 kB) - added by danger on 03/19/08 18:40:09.
changed add_credentials method to credentials and fixed logic problem with uri.is_a?(URI::HTTP) and nil credentials
plugin_install_from_secure_repository.2.diff (1.1 kB) - added by danger on 03/19/08 18:41:45.
changed add_credentials method to credentials and fixed logic problem with uri.is_a?(URI::HTTP) and nil credentials
plugin_install_from_secure_repository.3.diff (1.1 kB) - added by david.calavera on 03/19/08 21:26:31.
just a little refactor
plugin_install_from_secure_repository.4.diff (1.5 kB) - added by david.calavera on 03/20/08 17:24:32.
also fixes #10023

Change History

03/14/08 15:09:26 changed by fraggle

  • component changed from ActionPack to Railties.

03/19/08 15:28:49 changed by david.calavera

  • attachment plugin_install_from_secure_repository.patch added.

it also fixes the same bug with the list command

03/19/08 15:31:56 changed by david.calavera

  • summary changed from ./script/plugin install from secured repositories failes. to [PATH] ./script/plugin install from secured repositories failes..

I'm not sure how to test the patch. Plugin_test.rb class works as the plugin script(script/plugin) and it needs a command and an url as arguments.

I don't know how to add a test case to that class.

03/19/08 15:33:33 changed by david.calavera

Anyway, I've used the gem in order to test it and the problem is fixed.

03/19/08 15:35:00 changed by david.calavera

  • summary changed from [PATH] ./script/plugin install from secured repositories failes. to [PATCH] ./script/plugin install from secured repositories failes..

03/19/08 15:46:50 changed by david.calavera

  • version changed from 2.0.1 to edge.

03/19/08 18:40:09 changed by danger

  • attachment plugin_install_from_secure_repository.diff added.

changed add_credentials method to credentials and fixed logic problem with uri.is_a?(URI::HTTP) and nil credentials

03/19/08 18:41:45 changed by danger

  • attachment plugin_install_from_secure_repository.2.diff added.

changed add_credentials method to credentials and fixed logic problem with uri.is_a?(URI::HTTP) and nil credentials

03/19/08 18:43:00 changed by danger

Unfortunately Railties wasn't really built with testing in mind. So there isn't a testing framework to help you write tests nor is there any real expectation that you write them.

But it's a very good idea to test it out by hand.

03/19/08 20:45:44 changed by david.calavera

Thank you danger

03/19/08 21:26:31 changed by david.calavera

  • attachment plugin_install_from_secure_repository.3.diff added.

just a little refactor

03/20/08 09:13:17 changed by fraggle

  • summary changed from [PATCH] ./script/plugin install from secured repositories failes. to Small error in the latest patch..

With this change to plugin_install_from_secure_repository.4.diff the installer is working. Could not generate a diff, sorry.;)

925:    open(link) do |stream|
925:    open(link, credentials(link)) do |stream|

03/20/08 17:24:32 changed by david.calavera

  • attachment plugin_install_from_secure_repository.4.diff added.

also fixes #10023

03/20/08 17:25:27 changed by david.calavera

thank you fraggle, I've updated the latest patch file

03/21/08 15:27:11 changed by david.calavera

  • summary changed from Small error in the latest patch. to [PATCH] ./script/plugin install from secured repositories failes.

03/31/08 11:47:44 changed by blackanger

sorry , i just want to know when do you modify the bug to latest rails version ?

we dont always patch in rails ...