On Tue, May 03, 2016 at 10:32:48AM -0700, Shrinand Javadekar wrote: > I am trying to find the correct way of signing a blob put request for > Atmos which also includes the "x-emc-force-overwrite" header set to > "true". > > I see that there is a SignRequest object [1] that implements an > HttpFilter that should be used. But SignRequest operates on an > HttpRequest object. And the HttpRequest object is only returned by > signPutBlob. I was able to get this to work by doing the following: > > 1. HttpRequest request = blobstore.signPutBlob() > 2. Create tempRequest from request and add the the > "x-emc-force-overwrite" header. > 3. Get reference of the SignRequest object as say signRequest. > 4. newRequest = signRequest.filter(tempRequest) > 5. Use newRequest for writing the blob. > > As can be seen, this is certainly a contrived way of doing this. Are > there better ways?
All other blobstore providers support overwrite semantics yet Atmos raises a 1006 error. Thus I believe we should send x-emc-force for all AtmosClient.createFile calls which will improve the performance of AtmosUtils.putBlob. I believe when you fix this, AtmosBlobRequestSigner.signPutBlob should do what you want. -- Andrew Gaul http://gaul.org/