550 likes | 557 Views
Future of web applications conference on Scaling Open. Yahoo! Application Platform (YAP) and technology deep dive.
E N D
Slides: http://www.slideshare.net/jleblanc/fowa-miami Scaling Open Jonathan LeBlanc – Technology Evangelist Yahoo! Developer Network – Partner Integrations
YAP Applications What’s a YAP Application? 2
YAP Applications How do I get started? 9
Open Applications • Runs on YAP • Supports 2- & 3- legged OAuth • Supports OpenSocial 0.8 JavaScript APIs 10
Open Application - Views Large View Small View 11
OAuth Applications • Runs off platform • Supports 2- & 3-legged OAuth • Does not contain views • Requires users to authenticate session 19
YAP Code Dive What can you do with YAP? 27
YAP Code Dive PHP SDK 28
PHP SDK – 2-Legged OAuth Initialization Used For: - Public user data and open APIs 29
PHP SDK – 3-Legged OAuth Initialization Used For: - Private data access 30
PHP SDK – Available Methods 3-Legged OAuth 2-Legged OAuth getSessionedUser getOwner getUser query getPresence setPresence listUpdates listConnectionUpdates insertUpdate deleteUpdate loadProfile getConnections getContacts setSmallView (session) (session) (session) (session) (user) (user) (user) (user) (user) (user) (user) (user) (user) (user) setSmallView query (application) (application) 31
YAP Code Dive Yahoo! Markup Language (YML) 34
YML – Available Tags YML Tags (Large View) YML Lite Tags (Small View) yml:a yml:ad yml:audio yml:form yml:friend-selector yml:if-env yml:message yml:name yml:profile-pic yml:pronoun yml:share yml:swf yml:user-badge yml:a yml:audio yml:form yml:if-env yml:name yml:profile-pic yml:pronoun yml:user-badge 35
YAP Code Dive Yahoo! Query Language (YQL) 41
YAP Code Dive Caja 43
Caja - IFrame Security Concerns IFrame Concerns • Drive-by downloads • No real content restrictions • Other known exploits Caja Implementation • Blacklist all / Whitelist some model • Secure OpenSocial container 46
Caja – Best Practices • Use OpenSocial JavaScript standards • Use W3C standards • Use YML wherever possible • Unit test all JavaScript • Read the documentation (http://developer.yahoo.com/yos) • Participate in the forums (http://developer.yahoo.net/forum/) 47
Caja Practical – Assigning Click Handlers • Caja client side sanitizer strips JavaScript when inserted in DOM following AJAX requests • How do I assign click handlers then? Given: DOM Node with an ID <div id=‘myClickDiv’>Click Me!</div> 50