This file contains 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
<?php | |
new AuthArrayAdapter([ | |
// Shorthand/old style access (read+write for all endpoints) | |
'oldPubKey' => 'oldPrivKey', | |
'pubKey1' => [ | |
'someRoPrivateKey' => ['images.get', 'image.get', 'metadata.get'], | |
'someRwPrivateKey' => ['images.post', 'image.put', 'metadata.post'] | |
], | |
This file contains 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
'use strict'; | |
function deep(obj, prop) { | |
var segs = prop.split('.'); | |
while (segs.length) { | |
obj = obj[segs.shift()]; | |
} | |
return obj; | |
} |
This file contains 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
// In some app (say, a flickr-image-app): | |
appApi.emit('image-selected-for-upload', { url: someUrl, source: 'flickr' }) | |
appApi.on('image-uploaded', function(e) { | |
if (e.data.source !== 'flickr') { | |
return; | |
} | |
alert('Image uploaded'); | |
}); |
NewerOlder