SlideShare a Scribd company logo
/vendor/plugins/panmind
Spinoffs from a large Rails Application




                               Ruby Social Club night @MIKAMAI
Why?
‣ Code     you write in /app will be obsolete soon

‣ Code     you write in /lib will be obsolete less soon (maybe)

‣ Code     you you share with the Open Source community could live
 really long and beyond your expectations



‣ It’s   a sane engineering principle to write reusable code

‣ Sharing    the code makes you write good documentation




                                                       Ruby Social Club night @MIKAMAI
How?
‣ gem     uninstall -f copy-paste ide-tools

‣ Abstract    early, abstract often

‣ Create    temporary modules in your models, helpers, controllers

‣ Move     those modules away in /lib[1] - SOON

‣ Decouple     ‘em from the app assumptions, logic and configuration

‣ Move     ‘em in /vendor/plugins



‣ [1]:   Optional but recommended:
 config.load_once_paths.push((Rails.root+'lib').to_s)

                                                      Ruby Social Club night @MIKAMAI
A real world example
    http://github.com/Panmind/bigbro/commits/master

‣ Write   code in /lib, include the rusty module(s) in your app
‣ Decouple    configuration:
    -     def account
    -       Config[:id]
    +     attr_accessor :account
    +     def self.set(options = {})
    +        self.account = options[:account]
‣   Remove initialization code and put it in init.rb
‣   Rename the module and move code around
‣   Write documentation
‣   Release (Git is your friend: co, cherry-pick and rebase -i)
‣   Present at a Ruby event so someone else will write tests ;-)

                                                       Ruby Social Club night @MIKAMAI
Compatibility checklist
‣ Ruby    1.9.1-p378
‣ Rails   2.3.8
‣ rails_xss       plugin


‣ Patches   to support older versions of Ruby/Rails
 and/or without the rails_xss plugin more than
 welcome! (it’s just an .html_safe after all :-)


                                           Ruby Social Club night @MIKAMAI
Release #1: SSLHelper - What
    http://github.com/Panmind/ssl_helper

‣   require_ssl / ignore_ssl / refuse_ssl DSL for your
    controllers (simple wrap of a before_filter)
‣   Named route helpers (ssl_ / plain_ relatives) and test helpers
    (with_ / without_ssl, use_ / forget_ssl) generation
    redirect_to ssl_login_url
    <%= link_to “Sign up”, ssl_signup_url %>
    <% form_tag plain_search_url do %> ... <% end %>
    without_ssl do
      get :show, :id => @project.id
      assert_redirected_to ssl_project_url(@project.id)
    end

                                                    Ruby Social Club night @MIKAMAI
Release #1: SSLHelper - How
‣   Checks HTTPS / X-Forwarded-Proto variables via Rails’
    request.ssl?
‣   Includes the controller DSL straight into ActionController::Base
‣   Inserts into Rails’ router initialization by extending
    ActionController::Routing::Routes and overriding the
    reload! method (returning super do ... end)
‣   Generates ssl_ and plain_ wrappers of every named route helper
    defined in your app and puts them into an anonymous Module
‣   Includes it in ActionView::Base and in ActionController::
    {Base,Integration::Session,TestCase}


                                                             Ruby Social Club night @MIKAMAI
Release #2: BigBro - What
    http://github.com/Panmind/bigbro
‣   Google Analytics -- let’s get it straight (and async)
‣   Optimizes GA’s protocol check (it’s http://www. or https://ssl.?)
‣   Generates <noscript> tracking code
‣   Contains an embryo of a jQuery GA toolkit (in the js/ directory)
    <%= analytics %> or
    <%= analytics :track => false %>
    context “an user”
      should “be aware to live in 1984”
            get :index
            assert_analytics
      end
    end

                                                            Ruby Social Club night @MIKAMAI
Release #2: BigBro - How
‣   A submodule contains view helpers, another one test helpers
‣   The top-level module singleton class holds the initialization
    method and the GA account into an instance variable:
    class << self
      attr_accessor :account
      def set(options = {}) ... end
    end
‣   View helpers are included in ActionView::Base
‣   Test helpers are included in ActionController::TestCase

    ...Whoops, the plugin currently adds ‘em in ActiveSupport::
    TestCase! who’ll be the first to send out a pull request? :-)


                                                               Ruby Social Club night @MIKAMAI
Release #3: ReCaptcha - What
    http://github.com/Panmind/recaptcha

‣   Embeds ReCaptcha JS / Generates <noscript> code

‣   Provides a require_valid_captcha controller class method

‣   Chats with ReCaptcha HTTP service - handling timeouts

‣   AJAX validation via a custom jQuery plugin (untied to this one)

    <%= recaptcha :label => 'Human?', :theme => 'clean' %>
    require_valid_captcha :only => :create
    def invalid_captcha
      @user.errors.add_to_base('Captcha failed')
      render :new, :layout => 'login'
    end
                                                       Ruby Social Club night @MIKAMAI
Release #3: ReCaptcha - Test
Using mocha -- gem install it if you don’t have it

context ‘a guest’ do
  should ‘insert a valid captcha’
    mock_invalid_captcha
    post :signup, :email => ‘vjt@openssl.it’, ...
    assert_response :precondition_failed # 412

    mock_valid_captcha
    post :signup, :email => ‘vjt@openssl.it’, ...
    assert_redirected_to root_url # 302
  end
end

                                               Ruby Social Club night @MIKAMAI
Release #3: ReCaptcha - How
‣   Controller, View and Test helpers live in separate modules
‣   The top-level module singleton class contains the initialization
    method and the ReCaptcha keys
    class << self
      attr_accessor :private_key, :public_key, ...
      def set(options = {}) ... end
    end
‣   Controller methods included in ActionController::Base, and
    self.included() adds the require_valid_captcha method
‣   View helpers are included in ActionView::Base
‣   Test helpers are included in ActionController::TestCase

                                                       Ruby Social Club night @MIKAMAI
Release #3: ReCaptcha - AJAX
‣   ReCaptchas can be validated only once
‣   The jquery.ajax-validate plugin calls a controller action
    (Metal is better) that returns different HTTP status codes
‣   If successful, a flag is saved in the flash
‣   When the form is submitted, if the flag is true, ReCaptcha
    validation is skipped
‣   Unless your session cookies can be tampered with, the code is not
    vulnerable to replay attacks
‣   Older versions used a DB table first, memcached after.. but the
    flash is the best choice -- see the commit history for details :-)


                                                       Ruby Social Club night @MIKAMAI
Release #4: Zendesk - What
    http://github.com/Panmind/zendesk
‣   Zendesk? The best support platform / CRM in town
‣   View helpers to generate the trendy “feedback” button code --->
    and to generate links that display the feedback form
‣   Route and controller methods to implement Zendesk’s remote
    authentication: your users won’t have to register and log in on the
    support forum
‣   View helpers to generate links to the support forum
    <%= zendesk_dropbox_tags %>
    <%= zendesk_link_to ‘Support’ %>
    map.zendesk ‘/support’, :controller => :sessions

                                                       Ruby Social Club night @MIKAMAI
Release #4: Zendesk - How
‣   View helpers are included into ActionView::Base
‣   The route generation method is included into
    ActionController::Routing::RouteSet::Mapper
‣   This time, you have to include the controller methods into your
    login controller: in development mode they would be lost because
    of ActiveSupport’s reloading (solutions welcome!)


‣   Too much configuration is needed to make it work; your login
    action must implement a redirect_to params[:return_to]
    -- does anyone want to help?

                                                     Ruby Social Club night @MIKAMAI
Release #4: Zendesk - Flow
1. Guest clicks on zendesk_link_to(‘Support’)
2. Guest is taken to the support forum
3. Guest clicks ‘login’ in the support forum
4. Guest is redirected to the login page by the
  zendesk_handle_guests filter of the zendesk_login action
5. User is redirected to the zendesk_login action
6. User is redirected to zendesk’s remote authentication endpoint with a
  set of query string parameters (hash, timestamp, ...) and logged in
  ----------------------------------------------------------
1. User clicks on zendesk_link_to(‘Support’)
2. GOTO 5

                                                        Ruby Social Club night @MIKAMAI
Release #5: Leaker
Don’t use this plugin.
It’s an example of how plugins can be
evil. Even if written elegantly.

If you’re really curious why you shouldn’t, read the documentation
on GitHub - http://github.com/Panmind/leaker


You have been warned :-p


                                                  Ruby Social Club night @MIKAMAI
Where is the live demo?
SSLHelper: curl -I http://panmind.org/login -> 301

BigBro: have a look at the source of any panmind.org page, and
search for ga.js

ReCaptcha: https://panmind.org/signup input wrong data first and
then sign up

Zendesk: try the “Support” link in the footer and the “feedback” ->
button on the right of every page - both before and after logging in

Leaker: no way! :-)


                                                   Ruby Social Club night @MIKAMAI
Thank you! :-)

@vjt - vjt@openssl.it
http://panmind.org/



                        Ruby Social Club night @MIKAMAI

More Related Content

PDF
XSS Defeating Trick ~=ABK=~ WhitePaper
PDF
Adding User Management to Node.js
PDF
Coding Your Way to Java 12
PDF
Usability in the GeoWeb
PDF
Spring IO '15 - Developing microservices, Spring Boot or Grails?
PDF
A Gentle Introduction to Angular Schematics - Devoxx Belgium 2019
PDF
A Gentle Introduction to Angular Schematics - Angular SF 2019
PDF
Micronaut: Changing the Micro Future
XSS Defeating Trick ~=ABK=~ WhitePaper
Adding User Management to Node.js
Coding Your Way to Java 12
Usability in the GeoWeb
Spring IO '15 - Developing microservices, Spring Boot or Grails?
A Gentle Introduction to Angular Schematics - Devoxx Belgium 2019
A Gentle Introduction to Angular Schematics - Angular SF 2019
Micronaut: Changing the Micro Future

What's hot (20)

PDF
Hackathon - Building vaadin add on components
PDF
Workshop: Building Vaadin add-ons
PDF
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
PPT
Os Johnson
PDF
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
PPTX
10 Laravel packages everyone should know
PDF
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
PPTX
Grails Spring Boot
PDF
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
PDF
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
PDF
Developing Modern Java Web Applications with Java EE 7 and AngularJS
PDF
What's New in JHipsterLand - Devoxx Poland 2017
PDF
Hack the Future
PPSX
Building fast and performant apps
PDF
How to Build ToDo App with Vue 3 + TypeScript
PDF
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
PDF
Marvel of Annotation Preprocessing in Java by Alexey Buzdin
PDF
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
PDF
webcomponents (Jfokus 2015)
PDF
Predictable Web Apps with Angular and Redux
Hackathon - Building vaadin add on components
Workshop: Building Vaadin add-ons
Java Web Application Security with Java EE, Spring Security and Apache Shiro ...
Os Johnson
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
10 Laravel packages everyone should know
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
Grails Spring Boot
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
Developing Modern Java Web Applications with Java EE 7 and AngularJS
What's New in JHipsterLand - Devoxx Poland 2017
Hack the Future
Building fast and performant apps
How to Build ToDo App with Vue 3 + TypeScript
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
Marvel of Annotation Preprocessing in Java by Alexey Buzdin
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
webcomponents (Jfokus 2015)
Predictable Web Apps with Angular and Redux
Ad

Viewers also liked (6)

PDF
RVM and Ruby Interpreters @ RSC Roma 03/2011
PDF
Zarządzanie zamianami w relacyjnych bazach danych
PPTX
Полный цикл разработки на Python + Django
PDF
Liquibase - Zarządzanie zmianami w relacyjnych bazach danych
ODP
Retrospekcja warsztat Agile3M
PDF
Penetrationtestinglovesfreesoftware libreplaner2017-christianfernandez-hispag...
RVM and Ruby Interpreters @ RSC Roma 03/2011
Zarządzanie zamianami w relacyjnych bazach danych
Полный цикл разработки на Python + Django
Liquibase - Zarządzanie zmianami w relacyjnych bazach danych
Retrospekcja warsztat Agile3M
Penetrationtestinglovesfreesoftware libreplaner2017-christianfernandez-hispag...
Ad

Similar to Panmind at Ruby Social Club Milano (20)

ODP
KEY
Wider than rails
PDF
Copass + Ruby on Rails = &lt;3 - From Simplicity to Complexity
PDF
Migrating Legacy Rails Apps to Rails 3
KEY
Picking gem ruby for penetration testers
KEY
A tour on ruby and friends
PDF
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
PDF
Ruby on rails RAD
ZIP
Ruby Kaigi 2008 LT
KEY
Rails traps
PDF
Extracting Plugins And Gems From Rails Apps
KEY
Rapid development with Rails
KEY
Why ruby and rails
PDF
Web Development using Ruby on Rails
KEY
Intro to Ruby on Rails
PDF
The Joy Of Ruby
ZIP
Rails 3 (beta) Roundup
PDF
RubyEnRails2007 - Dr Nic Williams - Keynote
PDF
Rails 4.0
PDF
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Wider than rails
Copass + Ruby on Rails = &lt;3 - From Simplicity to Complexity
Migrating Legacy Rails Apps to Rails 3
Picking gem ruby for penetration testers
A tour on ruby and friends
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on rails RAD
Ruby Kaigi 2008 LT
Rails traps
Extracting Plugins And Gems From Rails Apps
Rapid development with Rails
Why ruby and rails
Web Development using Ruby on Rails
Intro to Ruby on Rails
The Joy Of Ruby
Rails 3 (beta) Roundup
RubyEnRails2007 - Dr Nic Williams - Keynote
Rails 4.0
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course

Recently uploaded (20)

PDF
A comparative analysis of optical character recognition models for extracting...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Approach and Philosophy of On baking technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A comparative analysis of optical character recognition models for extracting...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
Chapter 3 Spatial Domain Image Processing.pdf
A Presentation on Artificial Intelligence
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25-Week II
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
Approach and Philosophy of On baking technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Electronic commerce courselecture one. Pdf
Spectroscopy.pptx food analysis technology
sap open course for s4hana steps from ECC to s4
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Panmind at Ruby Social Club Milano

  • 1. /vendor/plugins/panmind Spinoffs from a large Rails Application Ruby Social Club night @MIKAMAI
  • 2. Why? ‣ Code you write in /app will be obsolete soon ‣ Code you write in /lib will be obsolete less soon (maybe) ‣ Code you you share with the Open Source community could live really long and beyond your expectations ‣ It’s a sane engineering principle to write reusable code ‣ Sharing the code makes you write good documentation Ruby Social Club night @MIKAMAI
  • 3. How? ‣ gem uninstall -f copy-paste ide-tools ‣ Abstract early, abstract often ‣ Create temporary modules in your models, helpers, controllers ‣ Move those modules away in /lib[1] - SOON ‣ Decouple ‘em from the app assumptions, logic and configuration ‣ Move ‘em in /vendor/plugins ‣ [1]: Optional but recommended: config.load_once_paths.push((Rails.root+'lib').to_s) Ruby Social Club night @MIKAMAI
  • 4. A real world example http://github.com/Panmind/bigbro/commits/master ‣ Write code in /lib, include the rusty module(s) in your app ‣ Decouple configuration: - def account - Config[:id] + attr_accessor :account + def self.set(options = {}) + self.account = options[:account] ‣ Remove initialization code and put it in init.rb ‣ Rename the module and move code around ‣ Write documentation ‣ Release (Git is your friend: co, cherry-pick and rebase -i) ‣ Present at a Ruby event so someone else will write tests ;-) Ruby Social Club night @MIKAMAI
  • 5. Compatibility checklist ‣ Ruby 1.9.1-p378 ‣ Rails 2.3.8 ‣ rails_xss plugin ‣ Patches to support older versions of Ruby/Rails and/or without the rails_xss plugin more than welcome! (it’s just an .html_safe after all :-) Ruby Social Club night @MIKAMAI
  • 6. Release #1: SSLHelper - What http://github.com/Panmind/ssl_helper ‣ require_ssl / ignore_ssl / refuse_ssl DSL for your controllers (simple wrap of a before_filter) ‣ Named route helpers (ssl_ / plain_ relatives) and test helpers (with_ / without_ssl, use_ / forget_ssl) generation redirect_to ssl_login_url <%= link_to “Sign up”, ssl_signup_url %> <% form_tag plain_search_url do %> ... <% end %> without_ssl do get :show, :id => @project.id assert_redirected_to ssl_project_url(@project.id) end Ruby Social Club night @MIKAMAI
  • 7. Release #1: SSLHelper - How ‣ Checks HTTPS / X-Forwarded-Proto variables via Rails’ request.ssl? ‣ Includes the controller DSL straight into ActionController::Base ‣ Inserts into Rails’ router initialization by extending ActionController::Routing::Routes and overriding the reload! method (returning super do ... end) ‣ Generates ssl_ and plain_ wrappers of every named route helper defined in your app and puts them into an anonymous Module ‣ Includes it in ActionView::Base and in ActionController:: {Base,Integration::Session,TestCase} Ruby Social Club night @MIKAMAI
  • 8. Release #2: BigBro - What http://github.com/Panmind/bigbro ‣ Google Analytics -- let’s get it straight (and async) ‣ Optimizes GA’s protocol check (it’s http://www. or https://ssl.?) ‣ Generates <noscript> tracking code ‣ Contains an embryo of a jQuery GA toolkit (in the js/ directory) <%= analytics %> or <%= analytics :track => false %> context “an user” should “be aware to live in 1984” get :index assert_analytics end end Ruby Social Club night @MIKAMAI
  • 9. Release #2: BigBro - How ‣ A submodule contains view helpers, another one test helpers ‣ The top-level module singleton class holds the initialization method and the GA account into an instance variable: class << self attr_accessor :account def set(options = {}) ... end end ‣ View helpers are included in ActionView::Base ‣ Test helpers are included in ActionController::TestCase ...Whoops, the plugin currently adds ‘em in ActiveSupport:: TestCase! who’ll be the first to send out a pull request? :-) Ruby Social Club night @MIKAMAI
  • 10. Release #3: ReCaptcha - What http://github.com/Panmind/recaptcha ‣ Embeds ReCaptcha JS / Generates <noscript> code ‣ Provides a require_valid_captcha controller class method ‣ Chats with ReCaptcha HTTP service - handling timeouts ‣ AJAX validation via a custom jQuery plugin (untied to this one) <%= recaptcha :label => 'Human?', :theme => 'clean' %> require_valid_captcha :only => :create def invalid_captcha @user.errors.add_to_base('Captcha failed') render :new, :layout => 'login' end Ruby Social Club night @MIKAMAI
  • 11. Release #3: ReCaptcha - Test Using mocha -- gem install it if you don’t have it context ‘a guest’ do should ‘insert a valid captcha’ mock_invalid_captcha post :signup, :email => ‘vjt@openssl.it’, ... assert_response :precondition_failed # 412 mock_valid_captcha post :signup, :email => ‘vjt@openssl.it’, ... assert_redirected_to root_url # 302 end end Ruby Social Club night @MIKAMAI
  • 12. Release #3: ReCaptcha - How ‣ Controller, View and Test helpers live in separate modules ‣ The top-level module singleton class contains the initialization method and the ReCaptcha keys class << self attr_accessor :private_key, :public_key, ... def set(options = {}) ... end end ‣ Controller methods included in ActionController::Base, and self.included() adds the require_valid_captcha method ‣ View helpers are included in ActionView::Base ‣ Test helpers are included in ActionController::TestCase Ruby Social Club night @MIKAMAI
  • 13. Release #3: ReCaptcha - AJAX ‣ ReCaptchas can be validated only once ‣ The jquery.ajax-validate plugin calls a controller action (Metal is better) that returns different HTTP status codes ‣ If successful, a flag is saved in the flash ‣ When the form is submitted, if the flag is true, ReCaptcha validation is skipped ‣ Unless your session cookies can be tampered with, the code is not vulnerable to replay attacks ‣ Older versions used a DB table first, memcached after.. but the flash is the best choice -- see the commit history for details :-) Ruby Social Club night @MIKAMAI
  • 14. Release #4: Zendesk - What http://github.com/Panmind/zendesk ‣ Zendesk? The best support platform / CRM in town ‣ View helpers to generate the trendy “feedback” button code ---> and to generate links that display the feedback form ‣ Route and controller methods to implement Zendesk’s remote authentication: your users won’t have to register and log in on the support forum ‣ View helpers to generate links to the support forum <%= zendesk_dropbox_tags %> <%= zendesk_link_to ‘Support’ %> map.zendesk ‘/support’, :controller => :sessions Ruby Social Club night @MIKAMAI
  • 15. Release #4: Zendesk - How ‣ View helpers are included into ActionView::Base ‣ The route generation method is included into ActionController::Routing::RouteSet::Mapper ‣ This time, you have to include the controller methods into your login controller: in development mode they would be lost because of ActiveSupport’s reloading (solutions welcome!) ‣ Too much configuration is needed to make it work; your login action must implement a redirect_to params[:return_to] -- does anyone want to help? Ruby Social Club night @MIKAMAI
  • 16. Release #4: Zendesk - Flow 1. Guest clicks on zendesk_link_to(‘Support’) 2. Guest is taken to the support forum 3. Guest clicks ‘login’ in the support forum 4. Guest is redirected to the login page by the zendesk_handle_guests filter of the zendesk_login action 5. User is redirected to the zendesk_login action 6. User is redirected to zendesk’s remote authentication endpoint with a set of query string parameters (hash, timestamp, ...) and logged in ---------------------------------------------------------- 1. User clicks on zendesk_link_to(‘Support’) 2. GOTO 5 Ruby Social Club night @MIKAMAI
  • 17. Release #5: Leaker Don’t use this plugin. It’s an example of how plugins can be evil. Even if written elegantly. If you’re really curious why you shouldn’t, read the documentation on GitHub - http://github.com/Panmind/leaker You have been warned :-p Ruby Social Club night @MIKAMAI
  • 18. Where is the live demo? SSLHelper: curl -I http://panmind.org/login -> 301 BigBro: have a look at the source of any panmind.org page, and search for ga.js ReCaptcha: https://panmind.org/signup input wrong data first and then sign up Zendesk: try the “Support” link in the footer and the “feedback” -> button on the right of every page - both before and after logging in Leaker: no way! :-) Ruby Social Club night @MIKAMAI
  • 19. Thank you! :-) @vjt - vjt@openssl.it http://panmind.org/ Ruby Social Club night @MIKAMAI