My app requires a reliable timestamp value for the creation of new records. I'm using Firebase.ServerValue.TIMESTAMP to ensure this. Here's my code:
var ref = new Firebase("https://test-firebase-please-ignore.firebaseio.com/foo");
ref.set(Firebase.ServerValue.TIMESTAMP);
or in REST:
$ curl -X PUT -d '{"foo":{".sv":"timestamp"}}' \
https://test-firebase-please-ignore.firebaseio.com/.json
How do I prevent an abusive user from crafting a request that looks valid, but is actually a fake timestamp in the past or future? Here's code they might use:
var ref = new Firebase("https://test-firebase-please-ignore.firebaseio.com/foo);
ref.set(1408643272324); //A timestamp in the past