You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Jayendra Patil <ja...@gmail.com> on 2010/11/17 02:57:52 UTC

Basic authentication for stream.url

We intend to use schema.url for indexing documents. However, the remote urls
are secured and would need basic authentication to be able access the
document.

The implementation with stream.file would mean to download the files and
would cause duplicity, whereas stream.body would have indexing performance
issues with the hugh data being transferred over the network.

The current implementation for stream.url in ContentStreamBase.URLStream
does not support authentication.
But can be easily supported by :-
1. Passing additional authentication parameter e.g. stream.url.auth with the
encoded authentication value - SolrRequestParsers
2. Setting Authorization request property for the Connection -
ContentStreamBase.URLStream
    this.conn.setRequestProperty("Authorization", "Basic " +
encodedauthentication);

Any suggestions ???

Regards,
Jayendra

Re: Basic authentication for stream.url

Posted by Jayendra Patil <ja...@gmail.com>.
sure .... thanks for the information ...

On Wed, Nov 17, 2010 at 3:47 PM, Erick Erickson <er...@gmail.com>wrote:

> <<<How does the patch make it to the trunk>>>
>
> You need to track it and prompt the dev list if you think it's forgotten.
> Basically, when a committer thinks it's ready and valuable s/he will
> commit it to trunk for you.
>
> But give the committers some time before prompting, they're usually
> up to their ears in other changes....
>
> Best
> Erick
>
> On Wed, Nov 17, 2010 at 3:30 PM, Jayendra Patil <
> jayendra.patil.001@gmail.com> wrote:
>
>> JIRA - https://issues.apache.org/jira/browse/SOLR-2240
>> Patch attached.
>>
>> How does the patch make it to the trunk ??? Had submitted a couple of more
>> patches SOLR-2156 & SOLR-2029, would like them to be included in the
>> release.
>>
>> Regards,
>> Jayendra
>>
>>
>> On Wed, Nov 17, 2010 at 2:15 PM, Yonik Seeley <yonik@lucidimagination.com
>> > wrote:
>>
>>> On Tue, Nov 16, 2010 at 8:57 PM, Jayendra Patil
>>> <ja...@gmail.com> wrote:
>>> > We intend to use schema.url for indexing documents. However, the remote
>>> urls
>>> > are secured and would need basic authentication to be able access the
>>> > document.
>>> >
>>> > The implementation with stream.file would mean to download the files
>>> and
>>> > would cause duplicity, whereas stream.body would have indexing
>>> performance
>>> > issues with the hugh data being transferred over the network.
>>> >
>>> > The current implementation for stream.url in
>>> ContentStreamBase.URLStream
>>> > does not support authentication.
>>> > But can be easily supported by :-
>>> > 1. Passing additional authentication parameter e.g. stream.url.auth
>>> with the
>>> > encoded authentication value - SolrRequestParsers
>>> > 2. Setting Authorization request property for the Connection -
>>> > ContentStreamBase.URLStream
>>> >     this.conn.setRequestProperty("Authorization", "Basic " +
>>> > encodedauthentication);
>>>
>>>
>>> Sounds like a good idea to me.
>>> Could you open a JIRA issue for this feature, and supply a patch if
>>> you get to it?
>>>
>>> -Yonik
>>> http://www.lucidimagination.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: dev-help@lucene.apache.org
>>>
>>>
>>
>

Re: Basic authentication for stream.url

Posted by Erick Erickson <er...@gmail.com>.
<<<How does the patch make it to the trunk>>>

You need to track it and prompt the dev list if you think it's forgotten.
Basically, when a committer thinks it's ready and valuable s/he will
commit it to trunk for you.

But give the committers some time before prompting, they're usually
up to their ears in other changes....

Best
Erick

On Wed, Nov 17, 2010 at 3:30 PM, Jayendra Patil <
jayendra.patil.001@gmail.com> wrote:

> JIRA - https://issues.apache.org/jira/browse/SOLR-2240
> Patch attached.
>
> How does the patch make it to the trunk ??? Had submitted a couple of more
> patches SOLR-2156 & SOLR-2029, would like them to be included in the
> release.
>
> Regards,
> Jayendra
>
>
> On Wed, Nov 17, 2010 at 2:15 PM, Yonik Seeley <yo...@lucidimagination.com>wrote:
>
>> On Tue, Nov 16, 2010 at 8:57 PM, Jayendra Patil
>> <ja...@gmail.com> wrote:
>> > We intend to use schema.url for indexing documents. However, the remote
>> urls
>> > are secured and would need basic authentication to be able access the
>> > document.
>> >
>> > The implementation with stream.file would mean to download the files and
>> > would cause duplicity, whereas stream.body would have indexing
>> performance
>> > issues with the hugh data being transferred over the network.
>> >
>> > The current implementation for stream.url in ContentStreamBase.URLStream
>> > does not support authentication.
>> > But can be easily supported by :-
>> > 1. Passing additional authentication parameter e.g. stream.url.auth with
>> the
>> > encoded authentication value - SolrRequestParsers
>> > 2. Setting Authorization request property for the Connection -
>> > ContentStreamBase.URLStream
>> >     this.conn.setRequestProperty("Authorization", "Basic " +
>> > encodedauthentication);
>>
>>
>> Sounds like a good idea to me.
>> Could you open a JIRA issue for this feature, and supply a patch if
>> you get to it?
>>
>> -Yonik
>> http://www.lucidimagination.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>>
>

Re: Basic authentication for stream.url

Posted by Jayendra Patil <ja...@gmail.com>.
JIRA - https://issues.apache.org/jira/browse/SOLR-2240
Patch attached.

How does the patch make it to the trunk ??? Had submitted a couple of more
patches SOLR-2156 & SOLR-2029, would like them to be included in the
release.

Regards,
Jayendra

On Wed, Nov 17, 2010 at 2:15 PM, Yonik Seeley <yo...@lucidimagination.com>wrote:

> On Tue, Nov 16, 2010 at 8:57 PM, Jayendra Patil
> <ja...@gmail.com> wrote:
> > We intend to use schema.url for indexing documents. However, the remote
> urls
> > are secured and would need basic authentication to be able access the
> > document.
> >
> > The implementation with stream.file would mean to download the files and
> > would cause duplicity, whereas stream.body would have indexing
> performance
> > issues with the hugh data being transferred over the network.
> >
> > The current implementation for stream.url in ContentStreamBase.URLStream
> > does not support authentication.
> > But can be easily supported by :-
> > 1. Passing additional authentication parameter e.g. stream.url.auth with
> the
> > encoded authentication value - SolrRequestParsers
> > 2. Setting Authorization request property for the Connection -
> > ContentStreamBase.URLStream
> >     this.conn.setRequestProperty("Authorization", "Basic " +
> > encodedauthentication);
>
>
> Sounds like a good idea to me.
> Could you open a JIRA issue for this feature, and supply a patch if
> you get to it?
>
> -Yonik
> http://www.lucidimagination.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Basic authentication for stream.url

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Tue, Nov 16, 2010 at 8:57 PM, Jayendra Patil
<ja...@gmail.com> wrote:
> We intend to use schema.url for indexing documents. However, the remote urls
> are secured and would need basic authentication to be able access the
> document.
>
> The implementation with stream.file would mean to download the files and
> would cause duplicity, whereas stream.body would have indexing performance
> issues with the hugh data being transferred over the network.
>
> The current implementation for stream.url in ContentStreamBase.URLStream
> does not support authentication.
> But can be easily supported by :-
> 1. Passing additional authentication parameter e.g. stream.url.auth with the
> encoded authentication value - SolrRequestParsers
> 2. Setting Authorization request property for the Connection -
> ContentStreamBase.URLStream
>     this.conn.setRequestProperty("Authorization", "Basic " +
> encodedauthentication);


Sounds like a good idea to me.
Could you open a JIRA issue for this feature, and supply a patch if
you get to it?

-Yonik
http://www.lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Basic authentication for stream.url

Posted by Gregor Kaczor <gk...@gmx.de>.
  Hello Jayendra,

i did not quiet understand what you are aiming for. Usually you would 
pass basic authentification credentials along with the url. In Solr+Java 
you might use the following piece of code:

         int port = 80;
         String url = "http://localhost:" + port
                 + "/solr/select";
         String user = "someuser";
         String password = "somepassword";
         CommonsHttpSolrServer commonsHttpSolrServer = null;
         HttpClient httpclient = new HttpClient(
                 new MultiThreadedHttpConnectionManager());
         try {
             commonsHttpSolrServer = new CommonsHttpSolrServer(url, 
httpclient);
             commonsHttpSolrServer.setParser(new XMLResponseParser());
         } catch (MalformedURLException e) {
             e.printStackTrace();
             return;
         }

         if (user != null && password != null) {
             commonsHttpSolrServer.getHttpClient().getParams()
                     .setAuthenticationPreemptive(true);
             Credentials defaultcreds = new 
UsernamePasswordCredentials(user,
                     password);
             
commonsHttpSolrServer.getHttpClient().getState().setCredentials(
                     new AuthScope("localhost", port, AuthScope.ANY_REALM),
                     defaultcreds);
         }

Hope I could help a little.

Kind Regards,
Gregor

On 11/17/2010 02:57 AM, Jayendra Patil wrote:
> We intend to use schema.url for indexing documents. However, the 
> remote urls are secured and would need basic authentication to be able 
> access the document.
>
> The implementation with stream.file would mean to download the files 
> and would cause duplicity, whereas stream.body would have indexing 
> performance issues with the hugh data being transferred over the network.
>
> The current implementation for stream.url in 
> ContentStreamBase.URLStream does not support authentication.
> But can be easily supported by :-
> 1. Passing additional authentication parameter e.g. stream.url.auth 
> with the encoded authentication value - SolrRequestParsers
> 2. Setting Authorization request property for the Connection - 
> ContentStreamBase.URLStream
>     this.conn.setRequestProperty("Authorization", "Basic " + 
> encodedauthentication);
>
> Any suggestions ???
>
> Regards,
> Jayendra
>


-- 
How to find files on the Internet? FindFiles.net <http://findfiles.net>!