SlideShare a Scribd company logo
Developing Heroku add-ons for
   Heroku hosted services



                         @leonardo_borges
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 donations




www.leonardoborges.com                               @leonardo_borges
Why?
Why?
You’re good at something




  other people are not
Why?
So you expose your service
  to a whole new market
Why?
Grow your user base
to tens of thousands
Why?
       Heroku promotes your service

                 free buzz :)

and makes it dead easy for users to get started
How?
How?
 Meet letmein, the polite authentication service




                   authenticate
   your
                                           letmein
customer’s
                   ok/get out!
    app



                                              heroku
Kensa
Heroku 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/"
     }
Kensa
            Oops.

$ kensa test provision

Testing POST /heroku/resources
  Check response [FAIL]
    ! expected 200, got 404

done.
Add-on provisioning
                      Allocate resources for the app

post '/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_json
end
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!
The consumer app
                       and the minimalist letmein plugin

def authenticate!
  redirect "#{ENV["LETMEIN_URL"]}/authenticate?return_to=#{url('/callback')}"
end

before '/protected/*' do
  authenticate! unless session[:user]
end
Local end to end test
                               and little demo!

$ kensa run ruby ../letmein-consumer/app.rb

Testing   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.
All set?
       Become an add-on provider

https://addons.heroku.com/provider/signup
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 config
LETMEIN_URL => https://letmein.herokuapp.com/e223a873c2e794e93fafaea9016327f1e668be3f
...


                         ...and it’s time for another little demo!
w00t
Resources
➡ https://github.com/leonardoborges/letmein
➡ https://github.com/leonardoborges/letmein-consumer
➡ https://addons.heroku.com/provider
➡ http://www.heroku.com
Thank you!
Questions?



             @leonardo_borges

More Related Content

KEY
Copycopter Presentation by Joe Ferris at BostonRB
PDF
Powershell to the People #suguk
PDF
Entry-level PHP for WordPress
ODP
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
PPTX
REST API for your WP7 App
PDF
Teaming up WordPress API with Backbone.js in Titanium
PPTX
Oracle APEX & PhoneGap
PDF
Enemy of the state
Copycopter Presentation by Joe Ferris at BostonRB
Powershell to the People #suguk
Entry-level PHP for WordPress
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
REST API for your WP7 App
Teaming up WordPress API with Backbone.js in Titanium
Oracle APEX & PhoneGap
Enemy of the state

What's hot (19)

PDF
A Debugging Adventure: Journey through Ember.js Glue
PPTX
PowerShell with SharePoint 2013 and Office 365 - EPC Group
PDF
Writing Software not Code with Cucumber
PDF
A Phing fairy tale - ConFoo13
PPTX
ADF 2.4.0 And Beyond
PDF
"Managing API Complexity". Matthew Flaming, Temboo
KEY
Rails Antipatterns | Open Session with Chad Pytel
KEY
You're Doing It Wrong
PDF
Simplifying Code: Monster to Elegant in 5 Steps
ODP
Schenker - DSL for quickly creating web applications in Perl
PDF
Leave your jQuery behind
PPTX
BrightonSEO 2020 - Mastering The API and Having Fun Along The Way
PPT
Introduccion app engine con python
PPTX
Childthemes ottawa-word camp-1919
PPTX
I Love codeigniter, You?
PDF
Introduction to VueJS & The WordPress REST API
PPT
jQuery Intro
PDF
Automatisation in development and testing - within budget
PDF
Bullet: The Functional PHP Micro-Framework
A Debugging Adventure: Journey through Ember.js Glue
PowerShell with SharePoint 2013 and Office 365 - EPC Group
Writing Software not Code with Cucumber
A Phing fairy tale - ConFoo13
ADF 2.4.0 And Beyond
"Managing API Complexity". Matthew Flaming, Temboo
Rails Antipatterns | Open Session with Chad Pytel
You're Doing It Wrong
Simplifying Code: Monster to Elegant in 5 Steps
Schenker - DSL for quickly creating web applications in Perl
Leave your jQuery behind
BrightonSEO 2020 - Mastering The API and Having Fun Along The Way
Introduccion app engine con python
Childthemes ottawa-word camp-1919
I Love codeigniter, You?
Introduction to VueJS & The WordPress REST API
jQuery Intro
Automatisation in development and testing - within budget
Bullet: The Functional PHP Micro-Framework
Ad

Viewers also liked (9)

KEY
Arel in Rails 3
PDF
Clouds against the Floods (RubyConfBR2011)
PDF
Clojure/West 2013 in 30 mins
KEY
Clouds Against the Floods
PDF
JRuby in The Enterprise
PDF
Testing with Spring
PDF
Clojure Reducers / clj-syd Aug 2012
PDF
Clojure Macros Workshop: LambdaJam 2013 / CUFP 2013
PDF
The algebra of library design
Arel in Rails 3
Clouds against the Floods (RubyConfBR2011)
Clojure/West 2013 in 30 mins
Clouds Against the Floods
JRuby in The Enterprise
Testing with Spring
Clojure Reducers / clj-syd Aug 2012
Clojure Macros Workshop: LambdaJam 2013 / CUFP 2013
The algebra of library design
Ad

Similar to Heroku addons development - Nov 2011 (20)

PDF
Heroku
PDF
Heroku webcastdeck+20130828
PDF
Start developing Facebook apps in 13 steps
PDF
Heroku Update
PPTX
2012 coscup - Build your PHP application on Heroku
PPTX
Social ent. with java on heroku
PDF
Noah Zoschke at Waza 2013: Heroku Secrets
PDF
Cloudcamp Athens 2011 Presenting Heroku
PDF
Heroku Introduction
PPT
Heroku for team collaboration
PPT
Heroku for-team-collaboration
KEY
Heroku + Jeweler & Gemcutter
KEY
Sinatra and Heroku - A comfortable ruby way for web service
PDF
A Scalable Rails App Deployed in 60 Seconds
PDF
Building Java Apps on Heroku and Force.com
KEY
Rails web api 开发
PDF
PDF
Heroku in Japan
PDF
Joomla! on Heroku
PDF
Heroku Tips and Hacks
Heroku
Heroku webcastdeck+20130828
Start developing Facebook apps in 13 steps
Heroku Update
2012 coscup - Build your PHP application on Heroku
Social ent. with java on heroku
Noah Zoschke at Waza 2013: Heroku Secrets
Cloudcamp Athens 2011 Presenting Heroku
Heroku Introduction
Heroku for team collaboration
Heroku for-team-collaboration
Heroku + Jeweler & Gemcutter
Sinatra and Heroku - A comfortable ruby way for web service
A Scalable Rails App Deployed in 60 Seconds
Building Java Apps on Heroku and Force.com
Rails web api 开发
Heroku in Japan
Joomla! on Heroku
Heroku Tips and Hacks

More from Leonardo Borges (12)

PDF
Realtime collaboration with Clojure - EuroClojure - Barcelona, 2015
PDF
Parametricity - #cljsyd - May, 2015
PDF
From Java to Parellel Clojure - Clojure South 2019
PDF
Futures e abstração - QCon São Paulo 2015
PDF
Functional Reactive Programming / Compositional Event Systems
PDF
High Performance web apps in Om, React and ClojureScript
PDF
Programação functional reativa: lidando com código assíncrono
PDF
Monads in Clojure
PDF
Intro to Clojure's core.async
PDF
Functional Reactive Programming in Clojurescript
PDF
The many facets of code reuse in JavaScript
PDF
Continuation Passing Style and Macros in Clojure - Jan 2012
Realtime collaboration with Clojure - EuroClojure - Barcelona, 2015
Parametricity - #cljsyd - May, 2015
From Java to Parellel Clojure - Clojure South 2019
Futures e abstração - QCon São Paulo 2015
Functional Reactive Programming / Compositional Event Systems
High Performance web apps in Om, React and ClojureScript
Programação functional reativa: lidando com código assíncrono
Monads in Clojure
Intro to Clojure's core.async
Functional Reactive Programming in Clojurescript
The many facets of code reuse in JavaScript
Continuation Passing Style and Macros in Clojure - Jan 2012

Recently uploaded (20)

PPTX
The various Industrial Revolutions .pptx
PDF
Architecture types and enterprise applications.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
project resource management chapter-09.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPT
What is a Computer? Input Devices /output devices
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
STKI Israel Market Study 2025 version august
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
1. Introduction to Computer Programming.pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Developing a website for English-speaking practice to English as a foreign la...
The various Industrial Revolutions .pptx
Architecture types and enterprise applications.pdf
Tartificialntelligence_presentation.pptx
project resource management chapter-09.pdf
Getting started with AI Agents and Multi-Agent Systems
Enhancing emotion recognition model for a student engagement use case through...
What is a Computer? Input Devices /output devices
DP Operators-handbook-extract for the Mautical Institute
STKI Israel Market Study 2025 version august
A novel scalable deep ensemble learning framework for big data classification...
1. Introduction to Computer Programming.pptx
NewMind AI Weekly Chronicles – August ’25 Week III
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
TLE Review Electricity (Electricity).pptx
NewMind AI Weekly Chronicles - August'25-Week II
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
cloud_computing_Infrastucture_as_cloud_p
Developing a website for English-speaking practice to English as a foreign la...

Heroku addons development - Nov 2011

  • 1. Developing Heroku add-ons for Heroku hosted services @leonardo_borges
  • 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 donations www.leonardoborges.com @leonardo_borges
  • 4. Why? You’re good at something other people are not
  • 5. Why? So you expose your service to a whole new market
  • 6. Why? Grow your user base to tens of thousands
  • 7. Why? Heroku promotes your service free buzz :) and makes it dead easy for users to get started
  • 9. How? Meet letmein, the polite authentication service authenticate your letmein customer’s ok/get out! app heroku
  • 10. Kensa Heroku 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. Kensa Oops. $ kensa test provision Testing POST /heroku/resources Check response [FAIL] ! expected 200, got 404 done.
  • 12. Add-on provisioning Allocate resources for the app post '/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_json end
  • 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. The consumer app and the minimalist letmein plugin def authenticate! redirect "#{ENV["LETMEIN_URL"]}/authenticate?return_to=#{url('/callback')}" end before '/protected/*' do authenticate! unless session[:user] end
  • 15. Local end to end test and little demo! $ kensa run ruby ../letmein-consumer/app.rb Testing 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. All set? Become an add-on provider https://addons.heroku.com/provider/signup
  • 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 config LETMEIN_URL => https://letmein.herokuapp.com/e223a873c2e794e93fafaea9016327f1e668be3f ... ...and it’s time for another little demo!
  • 18. w00t
  • 20. Thank you! Questions? @leonardo_borges