This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this | |
| AeroGear.crypto.getRandomValue = function() { | |
| var random = new Uint32Array( 1 ); | |
| crypto.getRandomValues( random ); | |
| return random[ 0 ]; | |
| }; | |
| // can now be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //this is using promises. | |
| dm.stores.demo.open().then( function( value ) { | |
| var data = [ | |
| { | |
| "id": 1, | |
| "name": "Lea", | |
| "type": "Skywalker" | |
| } | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pouchdb = require('pouchdb'); | |
| var db = PouchDB('coolcool'); | |
| PouchDB.destroy( 'coolcool', function( error, response ) { | |
| console.log( "error", error ); | |
| console.log( "response", response ); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pipeline = AeroGear.Pipeline(); | |
| var pipey = pipeline.add( { | |
| name: "pipey", | |
| settings: { | |
| baseURL: "your base URL", | |
| endpoint: "/{pushAppid}/android/{variantId}/" | |
| } | |
| }).pipes.pipey; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| send( params, function( err ) { | |
| if( err ) { | |
| throw something; | |
| } | |
| do other cool stuff | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //No criteria, just a normal send( what use to be broadcast ) | |
| { | |
| message: { | |
| alert: "...", | |
| sound: "...", | |
| badge: "...", | |
| "simple-push": "version=123" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~/develop/projects/aerogear-simplepush-server(branch:master) » mvn -X clean install lholmquist@lincolnhawk | |
| Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500) | |
| Maven home: /usr/share/maven | |
| Java version: 1.6.0_51, vendor: Apple Inc. | |
| Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home | |
| Default locale: en_US, platform encoding: MacRoman | |
| OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac" | |
| [INFO] Error stacktraces are turned on. | |
| [DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml | |
| [DEBUG] Reading user settings from /Users/lholmquist/.m2/settings.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| running this: | |
| ~/develop/projects/aerogear-simplepush-server(branch:master) » mvn install -DskipTests=true | |
| gives me this: | |
| [INFO] Changes detected - recompiling the module! | |
| [INFO] Compiling 32 source files to /Users/lholmquist/develop/projects/aerogear-simplepush-server/netty-codec-sockjs/target/test-classes | |
| [INFO] ------------------------------------------------------------- | |
| [ERROR] COMPILATION ERROR : |