Send metadata with GCS signed url - google-cloud-storage

Is it possible to set custom metadata to a file using when writing to a signed url? I tried adding a 'x-goog-meta-mything' but it didn't work.
I'm using the node client lib.
Update to be clearer:
Setting the header doesn't seem to be an issue, but when creating the signed URL I have to know the value of the meta-data ahead of time, which isn't useful. I.E. I have x-goog-meta-deltachanges and it could be a number any where between 1 and many thousands. In my signedUrl I have to set x-goog-meta-deltachanges:1,2,3,4,5,6... and it doesn't seem like a good idea.

As far as the Signed URLs docs go, it should be.
Have you set the Canonical extension headers bit as needed?
I mean, you need to both include the x-goog-meta-mything:VALUE in the StringToSign, and you need to then send the same x-goog-meta-mything:VALUE header in the PUT request.
Have you done this, is it not working?

Related

Setting up Dynamic Links in Firebase with Wordpress site

I am really struggling here... All I actually want to achieve is that I can get the Generate-Strong-Password function inside my app but that is actually harder than I thought.
I learned that I should go with Firebase Dynamic Links because I have a Wordpress-Website from All-Inkl.com.
I followed this Tutorial and there is actually an Apple-Site-Association-File at the moment. But I can't access my Website anymore as it looks like this:
Inside my Firebase Project I am getting this error which says that there not all the necessary "A-Files" are inside my Website:
My DNS-Settings:
I've been struggling for weeks now to get this done so if anyone has any idea how I can fix it I would be extremely grateful!! (btw, I am a total newbie when it comes to websites; I know my way around Swift though)
It seems that different domain providers accept different values for DNS entries ('A records' = 'A-Datensätze', in this case).
Try editing the entries for the Host field (which currently hold your website's URL) to one of the 'common inputs' listed here: https://firebase.google.com/docs/hosting/custom-domain?hl=de#domain-key
As the URL to your site doesn't seem to be what your provider accepts, I would suggest you try replacing it with the next option, i.e. replacing it with # .
Hope this helps solving your issue!

How can I actually download/transfer a file found using UPnP?

I'm completely new to UPnP as a protocol, but I'm hoping to use it to transfer files from a Sony Camera to an iOS app I'm working on. So far I have SSDP discovery setup, I can read the UPnP client's services, search through folders and access file names, but the final hurdle which I'm stuck on is how to actually download/transfer the files once I'm able to list them!
What I end up getting is the below:
<item id="04_02_0624600856_000001_000001_000000" restricted="1" parentID="03_01_0624600856_000001_000000_000000">
<dc:title>DSC05076.ARW</dc:title>
<upnp:class>object.item.imageItem.photo</upnp:class>
<dc:date>2018-08-23T12:24:21</dc:date>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_CI=1">http://192.168.122.1:60151/SM_DSC05076.ARW?%2104%5f02%5f0624600856%5f000001%5f000001%5f000000%21http%2dget%3a%2a%3aimage%2fjpeg%3aDLNA%2eORG%5fPN%3dJPEG%5fSM%3bDLNA%2eORG%5fCI%3d1%21%21%21%21%21</res>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_CI=1">http://192.168.122.1:60151/LRG_DSC05076.ARW?%2104%5f02%5f0624600856%5f000001%5f000001%5f000000%21http%2dget%3a%2a%3aimage%2fjpeg%3aDLNA%2eORG%5fPN%3dJPEG%5fLRG%3bDLNA%2eORG%5fCI%3d1%21%21%21%21%21</res>
<res protocolInfo="http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_CI=1">http://192.168.122.1:60151/TN_DSC05076.ARW?%2104%5f02%5f0624600856%5f000001%5f000001%5f000000%21http%2dget%3a%2a%3aimage%2fjpeg%3aDLNA%2eORG%5fPN%3dJPEG%5fTN%3bDLNA%2eORG%5fCI%3d1%21%21%21%21%21</res>
I would (With my naive experience of simple HTTP APIs) then expect to simply be able to download the file in question by hitting:
http://192.168.122.1:60151/SM_DSC05076.ARW or similar (I'm assuming I have to change this URL slightly as the file is listed as image/jpeg rather than RAW?
Whatever combination I try of the full res object, snipping bits, decoding the url e.t.c. I always get a 404 response when trying to visit the URL in question. Is there something more complex I need to do here? Or something simple that I'm missing?
Thanks in advance!
The problem here was that I was using a url from a previous session. It turns out that the urls change between connection sessions, which is why I was getting a 404.
Lesson learned: UPnP is highly dynamic, and you can’t rely on caching images under their access MRL!

See where a URL ends without letting know the tracker..!

In my email I have a URL like this:
https://signl.live/tracker/click?redirect=https%3A%2F%2Fwww.ilovefreesoftware.com%2F&dID=1537935418274&linkName=https://www.ilovefreesoftware.com/
Now, if I click on it then the tracker will know that I actually clicked on it. But I don't want that. Is there any way to reach the target URL without letting know the tracker ?
As long as the tracker is only reading the URL parameters, not transforming them or trying to trick you, then you can read the value without clicking anything.
www.ilovefreesoftware.com
I did not visit that site and I'm not sure that I would recommend it either.
The URL parameters are everything that comes after the ? in the original link.
redirect: hxxps://www.ilovefreesoftware.com/
dID: 1537935418274
linkName: 'hxxps://www.ilovefreesoftware.com/'
NOTE: I've changed https to hxxps so that the link is not clickable in this post.
Perhaps you were thrown off by the url encoding (e.g. https%3A%2F%2Fwww). The content between http and www in that string are hexadecimal numbers representing ascii characters. The number 0x3A represents the character : and 0x2F is /.
If the tracking server is trying to trick you or obscure the true destination then you have to let it run to find out what it does. No free software is worth the risk though.
Good luck!

How do relative URLs work in Sinatra?

I am hosting my Sinatra application using Apache with Passenger. It's hosted within a subfolder -- meaning, my main site is example.com, my application is at example.com/popcorn.
So I have a get '/' route, and that works fine. The problem is that my view includes a HTML form that makes a post request to upload, and the post '/upload' route isn't handling it. Instead of example.com/popcorn/upload, it's trying to get example.com/upload.
So I figure okay, not the ideal solution, but for now I'll hardcode the form action URL. But that doesn't work either -- making the action popcorn/upload fails too. This is where I get a little baffled, and my Google-fu was weak, I couldn't find help there.
Maybe I could have some kind of Apache rewrite rule, but is that the correct solution? Am I missing something? I would really appreciate a tip here because it feels like I've messed up something very simple and it's really bugging me.
You probably want the url helper method. That takes into account where the app is mounted on the server:
url('/upload')
The above code will evaluate to something like this:
http://example.com/popcord/upload
Inside your app you shouldn’t need to change anything, this will be routed to the existing post '/upload' handler.

Doesn't zend openid auto clean nonce files?

I am using zend OpenID library:https://github.com/marcinwol/zfopenid works great. But, the issue is not cleaning tmp folder files[nonce files]. It seems purgeNonces members of Zend_OpenId_Consumer_Storage_File are
not being called anywhere in the execution. http://framework.zend.com/manual/1.11/en/zend.openid.consumer.html dbstorage seems to clear the expired data. But, that too is not clearing Nonce. I am planning to use dbstorage. Any examples would be appreciated.
Thanks
I found some info, we do not need to delete discovery files as it is for single id.
http://openid.net/specs/openid-authentication-2_0.html#verify_nonce
as per this, Zend_OpenId_Consumer_Storage_File doesn't delete nonce files. Whenever we want to call purgeNonce, we must use
"The time-stamp MAY be used to reject responses that are too far away from the current time".so I can delete old nonce files.
Also, dbstorage example's isUniqueNonce has to check for a duplicate nonce for the same OP, Not for all OP.
please correct my understanding if it is wrong.