Paw: Possible to copy/paste data from Hash/Dictionary source in target language? - ruby

I'm using Paw to integrate with an API and it's a great tool, but the codebase I'm working in has lots of data in Ruby Hashes already that I would like to bring into Paw for testing. Moreover, I would like to be able to copy the data out of a Paw response for use in Ruby code rather than having to copy JSON and either store it as a String and parse it in my code or manually convert it to a native dictionary data structure. Is this possible?

Related

Why are FSGetCatalogInfo and getResourceValue giving different results?

I have a piece of file access code which uses FSGetCatalogInfo to get info about a bundle (say .xyz) which itself contains a file with extension .xyz. Because FSGetCatalogInfo has been updated, I am looking to replace it with 'getResourceValue' API from Foundation layer. However, the OSType is coming incorrect from the new API.
I have also looked into the related FSSetCatalogInfo API. Do I need to do something equivalent such that the 'getResourceValue' API will start giving correct results?

react native - validate source using digital signature with JWS, bcrypt or react-native-crypto

I am looking for a way to validate the source of a data in my React Native application.
The application receive data in JSON format and I want to validate its source.
I don't need to encrypt the data itself but I want to process only validated data otherwise I will notify the user the data is not originated from a valid source.
I am using RN version 0.45.1
EDIT
I've read that its not a good idea to use JWS, for example:
https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-bad-standard-that-everyone-should-avoid
but instead use 'react-native-bcrypt' or 'react-native-crypto', the second package is faster??
After a lot of searching I found this solution:
https://github.com/kjur/jsrsasign
this library provides ways to:
generate:
https://kjur.github.io/jsrsasign/api/symbols/KEYUTIL.html#.generateKeypair
sign and verify:https://kjur.github.io/jsrsasign/api/symbols/KJUR.crypto.Signature.html#constructor:
and many more...

How Paw read dynamic values from a csv or json file?

Can I have Paw for mac (http rest client) read Dynamic Values from a csv or json file? I need to run 10000 APIs by using different Dynamic Values in my collections.
You could create a dynamic value extension, and use readFile() to read your json file.
I have created a dynamic value extension for passwords, and other such stuff that I don't want to share, when I share my Paw documents.
Please note that because of sandboxing, your json file must live inside you extension folder.

Output all language strings in Revel?

I'm developing an API Server in Go and the server (at the moment) handles all translations for clients. When an API client fetches particular data it also asks for the translations that are available for the given section.
Ideally I want to have the following folder structure:
/messages
/home.en
/home.fr
/home.sv
/news.en
/news.fr
/news.sv
Where news and home are distinct modules.
Now the question I have for Revel is is it possible to fetch ALL language strings for a given module and given locale? For example pull all home strings for en-US.
EDIT:
I would like the output (something I can return to the client) a key:value string of translations.
Any guidance would be appreciated.
It seems to me that revel uses messaged based translation (just like gettext does), so you need
the original string to get the translation. These strings are stored in Config objects,
which are themselves stored in messages of i18n.go, sorted by language.
As you can see, this mapping is not exported, so you can't access it. The best way
to fix this is to write a function for what you want (getting the config by supplying a language)
or exporting one of the existing functions and create a pull request for revel.
You may workaround this by copying the code of loadMessageFile or by forking your version
of revel and exporting loadMessageFile or parseMessagesFile. This also is a great opportunity
to create a pull request.
Note that the localizations are stored in a INI file format parsed by robfig/config,
so manually parsing is also an option (although not recommended).

Is there any tool to generate a labels.rdf file?

Examining the 404 errors for my website I noticed requests for a "labels.rdf" file. After some digging I think I understand what it is and want to create one for my website. But I don't really understand how to generate it. Is there any tool or a generic file that I can use?
Thanks
RDF is not just one format, but a collection - most likely it's expecting RDF/XML.
IMHO the esiest thing to do is create the data you need in a format called Turtle (http://www.w3.org/TeamSubmission/turtle/) - there's lots of tutorials online, then convert it to RDF/XML with a tool, such as rapper (http://librdf.org/raptor/).
You will need to know a bit about the RDF data model though, and what the labels.rdf file is trying to express.

Resources