Dear Samuele,

----- Messaggio originale -----
Da: "Samuele Kaplun" <samuele.kap...@cern.ch>
A: "Ricceri Rita" <rita.ricc...@ct.infn.it>
Cc: "project-invenio-devel (Invenio developers )" 
<project-invenio-devel@cern.ch>, "Tibor Simko" <tibor.si...@cern.ch>
Inviato: Martedì, 17 maggio 2016 10:59:36
Oggetto: Re: RobotUpload - API Key

Dear Rita,

Il 11/05/2016 18:13, Ricceri Rita ha scritto:
> I have followed your instruction but when I disabled the IP authentication I 
> cannot
> perform any batchupload. The message I get is:
>
> [ERROR] Sorry, client IP 193.206.208.201 cannot use the service.
>
>
> Analysing the code it seems that the method responsible for the upload, 
> cli_upload,
>
> (https://github.com/inveniosoftware/invenio/blob/v1.2.1/modules/bibupload/lib/batchuploader_engine.py#L94)
>
> will always perform the IP check. Is this correct? Are there other approaches 
> for the batchuploader which bypass
> the IP security control using the APIs?
You are right. However looking at the code, seems like, if you then 
authorize all IP addresses for the desired collection, and you set up a 
specific runbatchuploader authorization, it should then do the job.

I changed the values in invenio-local.conf file 
 
CFG_BATCHUPLOADER_WEB_ROBOT_AGENTS = invenio_webupload|invenio_connector
CFG_BATCHUPLOADER_WEB_ROBOT_RIGHTS ={ '0.0.0.0/0': [['*'], ['-o'], 
['rita.ricc...@ct.infn.it]]}
---------
#rricceri$ curl -T testapiricceri.xml -A invenio_webupload -H "Content-Type: 
application/marcxml+xml" 
'http://mysite/batchuploader/robotupload/insert/?apikey="api-key"&uid="36"&timestamp="1463488656"&signature="000000";'
[INFO] bibupload batchupload --insert 
/opt/invenio/var/tmp-shared/batchupload_20160517154512_Ka5t4N
iRita:~ rricceri$ 
----------
User "uid = 36" does not have the authorization for runbatchuploader.
in the code there is not check for api-key

Any idea?

Thanks
Rita

Reply via email to