anamikabir / solr-php-client

solr-php-client
Other
0 stars 0 forks source link

Basic Auth #81

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Attached is a patch for Basic Auth. This is to support a hosted Solr service, 
LucidWorks Cloud (Amazon and Azure). Other hosted services (Powcloud I think) 
use API keys as url parameters, and those should probably be supported as well.

It assumes that if you give auth credentials, you want http/s, otherwise you 
want http. 
I'm not a PHP coder. I suspect that the account&password should be cached by 
the HTTP implementations rather than passed in each time. Also, setting the 
basic parameters seems wrongly factored.

I have tested this with Matt Webber's WordpressForSolr plugin.

Original issue reported on code.google.com by goks...@gmail.com on 28 Jun 2012 at 8:09

Attachments:

GoogleCodeExporter commented 8 years ago
Please email at lance.norskog@gmail.com.

Original comment by goks...@gmail.com on 28 Jun 2012 at 8:09

GoogleCodeExporter commented 8 years ago
Also, I only tested this under Wordpress. I do not know how to run the unit 
tests. 

Original comment by goks...@gmail.com on 28 Jun 2012 at 8:15

GoogleCodeExporter commented 8 years ago
Didn't go with your patch directly, I wanted the methods on the transport, but 
it should provide similar functionality. see r64

Should be able to do

<?php

$solr = new Apache_Solr_Service(...);
$solr->setAuthenticationCredentials("user", "password");

...
?>

This calls through to the HTTP transport, so it could also be set directly 
there.

I'm reasonably certain this should work as is, but I'd appreciate if you tested 
it. Thanks.

Original comment by donovan....@gmail.com on 5 Jul 2012 at 9:17

GoogleCodeExporter commented 8 years ago
Issue 69 has been merged into this issue.

Original comment by donovan....@gmail.com on 5 Jul 2012 at 9:19

GoogleCodeExporter commented 8 years ago

Original comment by donovan....@gmail.com on 28 Aug 2012 at 2:23