I tweaked the page to not auto-focus the editor. Thanks!
71 karma · joined October 25, 2011
I tweaked the page to not auto-focus the editor. Thanks!
As for similar projects that are already more HTML-friendly, maybe check out Etherpad[1]? It has HTML import / export, though I haven't tested it out.
Additionally, a lot of the OT code is based on ot.js[1], a fantastic open source OT implementation by Tim Baumann. He has a node.js backend as well as Haskell and Python. Of course then you have to run the server code somewhere and figure out how to persist the documents, etc. :-) Definitely worth checking out though.
We've had people build everything from emergency response simulations synchronized across multiple devices to iOS apps for grandparents to read books with their grandkids over long distances.
Firebase is great any time you need real-time updates, collaboration, or you just want to get something up and running without having to spin up your own servers.
If you need atomic bidirectional friendships though, you can do it if you structure your data a little differently. To turn a friendship between a pair of users on and off, you could set /friends/user1/user2 to true iff user1 and user2 are friends. Then you can write security rules that are based off of that to allow and deny access to the users' data.
2. RequireJS is on our radar. I don't know too much about it, but if developers want it, we'll likely end up adding it. :-)
You can check out the rules for Firefeed here: https://github.com/firebase/firefeed/blob/master/rules.json
And be sure to check out our Security Quickstart Screencast, walking you through the system: https://www.firebase.com/docs/security-quickstart.html
I will point out though that what you described looks like an ACL system with groups (akin to unix permissions), and we think our Security Rules system is actually quite a bit more powerful than that (you could easily build ACL / groups on top of it, but you can build lots of other models too). :-)
Since the whole rules language is custom, we're not using any off-the-shelf projects presently, and to be honest, we've only scratched the surface of what's possible.
Most of what we have in place right now is at the level of type-checking and other expression-correctness checks (we're intentionally more strict about a number of things than JavaScript).
But given the nature of the rules we can do a lot of cooler analysis, like detect redundant or conflicting rules. We should also be able to do interesting analysis for the developer like answer questions like "What parts of my Firebase data can an unauthenticated client read or write?", "What parts can a user authenticated as 'joe' read or write?"
This sort of analysis should help developers reason about their rules and verify their correctness. Honestly, I'm pretty excited about the possibilities. :-)
But it /is/ server-side validation, that you as a developer get to specify.
(That said, we're definitely happy to get feedback on our approach from any security experts out there that want to take a look!)
So you could store a 'public' flag on every picture in your Firebase data, and then write a single rule that checks the value of that flag, and if it's true, allows anonymous access (and if it's not true, checks that the accessing user is in the picture owner's friends/family list).
Assuming your rules let the picture owner edit the 'public' flag, they'll be able to flip it on and off, granting or revoking access to non-friends/family. And since everything in Firebase is real-time, the change will instantly take effect.
Having rule expressions attached directly to data locations also ends up being much more concise (which means less boilerplate code and less opportunities for mistakes), which we think is important for a security API.