Data Security for PDF Generation - jspdf

Does jsPdf internally sends the data to any other server for PDF generation? We have sensitive data be exported to PDF formats. So we need to ensure data security

jsPDF is a client side library for generating PDFs. Had tried their example at https://github.com/MrRio/jsPDF and it does not invoke any server calls.

Related

BreezeJS and IndexedDB Offline Examples

Ok, I see where BreezeJS supports IndexedDB, at least based on an entry on their web page, but where can I find examples of how to architect an offline solution using BreezeJS and the IndexedDB local storage option?
How do I build this server side scheme in the local storage?
Also, are there examples syncing with Mysql also?
Thanks
Breeze can store any collection of entities exported from an EntityManager into any local storage mechanism available on the client BUT understand that you are storing the entire serialized collection of entities under a single key, i.e. you are not storing individual entities into a store by their key.
We do not have any examples yet using IndexedDb but there are several examples in the DocCode sample zip that use browser localStorage. The basic idea for indexedDb is much the same,
1) Export the entity or entities into a string via an EntityManager.exportEntities call. ( This returns a stringified json result).
2) Store the string into local storage (browser localStorage or IndexedDb) with some arbitrary key.
3) Later... retrieve the string from localStorage
4) Import the string into an EntityManager via an EntityManager.importEntities call.
Breeze does not provide a wrapper for IndexedDB. You have to write your own.
window.indexedDB is part of the browser's HTML5 DOM so when you see it listed in the Breeze documentation, it is only referencing what is available in the browser's DOM.
You will need to write your own customized IndexedDB function that handles request to save and retrieve from the database.
Here is a pull request which adds support to BreezeJS which will add more advanced support for exporting/importing with indexedDB. Please +1 if you would like this support added to Breeze.JS.
https://github.com/Breeze/breeze.js/pull/22

How to create forms in dart?

What is the best way to create forms (textfields, checkboxes, radio buttons, ...) and handle the data after the user's input?
Just use web components as dart's web ui?
http://www.dartlang.org/articles/web-ui/
http://www.dartlang.org/docs/tutorials/web-ui/
edit: Lets imagine the following example application: I would like to create an online quiz/test.
First the user has to register
Data will be stored in a textfile or in a database
User can log in and play an online quiz or do an online test.
For that quiz/test i need to evaluate the input with the predefined correct answers
Here's a high-level answer to your question.
To handle data on the server side you can use the HttpServer class to start a web server. See this article.
To store data in a flat file you'll need to use the dart:io package to open a file and write to it. See the documentation for File.openWrite().
To store data in a database there are packages available on pub for mysql and postgresql.
There are two different ways to implement the client side. The traditional way is to use templating to generate html with the data in input elements within a form tag, and then handle the form submission in your webserver.
The modern way, that is the focus within the Dart community, is to write a single page app, which uses HttpRequest to read data from and send data to the server (usually using json).
On the client side, you could retrieve data from server (e.g. as JSON) and use that to build a form. This seems like a good fit for a web component as elements can be dynamically added based on received data.
The component would be bound to the model so you can serialize the model object to JSON on submit and send it to server on submit or just send it as standard HTML form.
The server side of the story is less clear, there are no production quality web server libraries that I am aware of, but you could take a look at DartExpress as an example, or Stream, and there are others, more or less complete. Anyway, you would have to extract the POST payload from HttpRequest (if sent as JSON) or use the form data which is also accessible via queryParameters property - please note that this is Dart:io.HttpRequest class, not Dart:html.HttpRequest, and it is available only on server side.
The mentioned server frameworks simplify this part a bit.
Using Web-UI would be a good choice. The todomvc application illustrates nicely how to dynamically capture the input from a user. Processing on the server side is wide open as far as choices go. Dart does have server side capabilities, and you could use some of the existing libraries to accomplish what you want.
Another way that you can process the information server side is to comunicate with the DB directly using a REST based web service like CouchDB. Cloudant offers such a service and allows you to communicate directly to the DB from the client, providing you can overcome the Same-Origin-Policy. There are 2 ways to do this. Enable CORS on the CouchDB instance, or host your application on the server that has the DB, which is also possible with CouchDB.
Dart serverside also supports websockets, so you can easily deliver the user provided data to the server with web sockets, and then do whatever processing you like on the serverside.
One other option I can think of would be to have the information processed and saved in the local browser. You can access the local DB or local browser file system from the Dart client, and keep everything local. For statistics, you can have the client update a web service of your choice.

How to send pdf document as a Ruby on Rails Restful Web Service response

We have all pdf documents located on Amazon S3 and we are trying to develop or expose the restful web services from Ruby on Rails application which returns the response in Json format.
Here we facing issue, how to send pdf document as web service response. Can anybody help me on this ?
Thanks,
Chetan
If talking with your service clients via JSON is crucial for architecture, then - best solution in my opinion is sending direct link to the document, otherwise read PDF and then stream it to client.

Does the Google Drive API support Content-Range for Uploads?

Similar to this question: How does Google Drive API support Content-Range for download requests?
but for uploads. Does the Drive/Docs API let you set a range if you want to update some bytes in an existing file?
This depends what you are trying to do.
You can't upload a few bytes to an existing file in a random access way. The API does, however, support the resumable upload protocol so that you can upload large files in chunks. This is fault tolerant per chunk, and uploads can be restarted for any reason if there is a failure.

security issues and thoughts reading an rss feed

I'm working on an app that is reading it's data from a customized RSS feed, that contains information about events. The feed is parsed with the GData XML framework, and written to SQLite with the FMDB wrapper.
The feed information is created on the server by a web-app.
I'm now thinking about how I can make the app bullet proof against hacking attacks that might get through the servers validation. I have seen some threads here about SQL Injection, so I have information regarding that.
Are there other attacks/mechanisms to consider?
The information in my feed is not secret, I'm only after a well working app that can not be hacked easily.
[late answer]
You should harden your server. There is not much you can do to secure the feed itself against man in the middle unfortunately, as SSL and/or XML signature is not really defined for RSS.

Resources