Heroku addons development - Nov 2011

1,593 views

Published on

Short presentation on how heroku addon development works

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,593
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Heroku addons development - Nov 2011

  1. 1. Developing Heroku add-ons for Heroku hosted services @leonardo_borges
  2. 2. self slide ➡ Consultant at ThoughtWorks Australia ➡ Programming languages enthusiast ➡ Developed the Queensland heroku powered app for the Floods of 2010/2011 ➡ Used by thousands ➡ Generated over $38 million in donationswww.leonardoborges.com @leonardo_borges
  3. 3. Why?
  4. 4. Why?You’re good at something other people are not
  5. 5. Why?So you expose your service to a whole new market
  6. 6. Why?Grow your user baseto tens of thousands
  7. 7. Why? Heroku promotes your service free buzz :)and makes it dead easy for users to get started
  8. 8. How?
  9. 9. How? Meet letmein, the polite authentication service authenticate your letmeincustomer’s ok/get out! app heroku
  10. 10. KensaHeroku add-on development, TDD style $ gem install kensa $ cd /letmein $ kensa init addon-manifest.json { "id": "letmein", "api": { "config_vars": [ "LETMEIN_URL" ], "password": "pXrE4efbslOkCHtu", "sso_salt": "qi198QaiuPsE6DWq", "production": "https://letmein.herokuapp.com/", "test": "http://localhost:5000/" }
  11. 11. Kensa Oops.$ kensa test provisionTesting POST /heroku/resources Check response [FAIL] ! expected 200, got 404done.
  12. 12. Add-on provisioning Allocate resources for the apppost /heroku/resources do api_key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s) user = User.create(api_key: api_key, created_at: Time.now) result = { :id => user.api_key, :config => { "LETMEIN_URL" => url("/#{api_key}") } } result.to_jsonend
  13. 13. Kensa What’s next? $ kensa test provision Testing POST /heroku/resources Check response [PASS] Check valid JSON [PASS] Check authentication [FAIL] ! expected 401, got 200 done.Point is, Kensa will tell you what to do!
  14. 14. The consumer app and the minimalist letmein plugindef authenticate! redirect "#{ENV["LETMEIN_URL"]}/authenticate?return_to=#{url(/callback)}"endbefore /protected/* do authenticate! unless session[:user]end
  15. 15. Local end to end test and little demo!$ kensa run ruby ../letmein-consumer/app.rbTesting POST /heroku/resources Check response [PASS] Check valid JSON [PASS] Check authentication [PASS]...Testing DELETE /heroku/resources/5f3feb3dfb2bc20f29d14c49f4567599dbb0345f Check response [PASS] Check authentication [PASS]done.
  16. 16. All set? Become an add-on providerhttps://addons.heroku.com/provider/signup
  17. 17. Then what? This is how your users will install the add-on$ heroku addons:add letmein-----> Adding letmein to letmein-consumer... done, v3 (free)$ heroku configLETMEIN_URL => https://letmein.herokuapp.com/e223a873c2e794e93fafaea9016327f1e668be3f... ...and it’s time for another little demo!
  18. 18. w00t
  19. 19. Resources➡ https://github.com/leonardoborges/letmein➡ https://github.com/leonardoborges/letmein-consumer➡ https://addons.heroku.com/provider➡ http://www.heroku.com
  20. 20. Thank you!Questions? @leonardo_borges

×