Skip to content

Instantly share code, notes, and snippets.

View lholmquist's full-sized avatar

Lucas Holmquist lholmquist

View GitHub Profile

Public API

Connect

Disconnect

Add

  • takes 1 or more documents to add to the Sync Engine / Sync Server

Requirements

  • Have gpg-agent installed, configured and running. One way to be sure to check if your gpg agent is running correctly is to encrypt and decrypt a file, using the gpg tool, don't forget to pass the --use-agent option, you should be prompted with a dialog (depending on your OS asking for your pass phrase). Now try to decrypt again, you hsould not be asked again for your pass phrase : your agent is working.

Release process

Preparation

Once the code is ready to be released, create a branch that indicates the version, e.g. 0.5.0-release and send a heads-up (or vote) email to the mailing list asking to test the bits before we do release.

Unhandle exception
java.lang.IllegalStateException: address must be specified for message
at org.vertx.java.core.sockjs.EventBusBridge.getMandatoryString(EventBusBridge.java:215)
at org.vertx.java.core.sockjs.EventBusBridge.handleSocketData(EventBusBridge.java:121)
at org.vertx.java.core.sockjs.EventBusBridge.access$600(EventBusBridge.java:39)
at org.vertx.java.core.sockjs.EventBusBridge$3.handle(EventBusBridge.java:191)
at org.vertx.java.core.sockjs.EventBusBridge$3.handle(EventBusBridge.java:189)
at org.vertx.java.core.sockjs.impl.Session.handleMessages(Session.java:299)
at org.vertx.java.core.sockjs.impl.WebSocketTransport$WebSocketListener$1.handle(WebSocketTransport.java:92)
at org.vertx.java.core.sockjs.impl.WebSocketTransport$WebSocketListener$1.handle(WebSocketTransport.java:84)
@lholmquist
lholmquist / gist:10393450
Created April 10, 2014 15:21
ups_no_work
$.ajax({
contentType: "application/json",
dataType: "json",
type: "DELETE",
url: "https://mobileweek-lholmqui.rhcloud.com/rest/registry/device/" + encodeURIComponent("https://updates.push.services.mozilla.com/update/pLey967MwgxQV-YVWEf5Rmnu0E_auo7aGPn7tjJGOJSbfNuZWR1v6kpV0-BVfQm3vly38NvkYCXHOTy86gE9NNES6cg8Gwx_xJnH6YjEVHfwW7K95Q=="),
headers: {
"Authorization": "Basic " + window.btoa("2df5ed60-d6a8-4965-a98a-a92f650b1b95:a8f1977f-4318-4616-b62b-072ea8e83c50")
},
success: function() { console.log( arguments ); },
});
@lholmquist
lholmquist / gist:10393357
Created April 10, 2014 15:20
ups_delete_works
$.ajax({
contentType: "application/json",
dataType: "json",
type: "DELETE",
url: "https://mobileweek-lholmqui.rhcloud.com/rest/registry/device/" + encodeURIComponent(encodeURIComponent("https://updates.push.services.mozilla.com/update/pLey967MwgxQV-YVWEf5Rmnu0E_auo7aGPn7tjJGOJSbfNuZWR1v6kpV0-BVfQm3vly38NvkYCXHOTy86gE9NNES6cg8Gwx_xJnH6YjEVHfwW7K95Q==")),
headers: {
"Authorization": "Basic " + window.btoa("2df5ed60-d6a8-4965-a98a-a92f650b1b95:a8f1977f-4318-4616-b62b-072ea8e83c50")
},
success: function() { console.log( arguments ); },
});
{
"variants" : ["c3f0a94f-48de-4b77-a08e-68114460857e", "444939cd-ae63-4ce1-96a4-de74b77e3737" ....],
"alias" : ["[email protected]", "[email protected]", ....],
"categories" : ["someCategory", "otherCategory"],
"deviceType" : ["iPad", "AndroidTablet"],
"ttl" : 3600,
"message": {
"alert":"HELLO!",
"sound":"default",
"badge":7,
/**
Encrypt data being saved or updated if applicable
@private
@augments base
*/
this.encrypt = function( data ) {
// IF encryption is true, do so cool stuff
// or if not, just return the data
if( crypto.agcrypto ) {
// should i also be doing cryptoOptions.key = crypto.agcrypto.deriveKey( cryptoOptions.key )
test( "Encrypt/Decrypt raw bytes providing password", function() {
var agCrypto = AeroGear.Crypto(), //Need to create a "Crypto" object to re-use
rawPassword = agCrypto.deriveKey( PASSWORD ),
utf8String = sjcl.codec.utf8String,
hex = sjcl.codec.hex,
cipherText,
options = {
AAD: hex.toBits( BOB_AAD ),
key: rawPassword,
AeroGear.Crypto = function() {
...
// Local Variables
var privateKey, publicKey, IV;
...
// Method to provide symmetric encryption with GCM by default
/**
Encrypts in GCM mode
@status Experimental
// this
AeroGear.crypto.getRandomValue = function() {
var random = new Uint32Array( 1 );
crypto.getRandomValues( random );
return random[ 0 ];
};
// can now be