warden-oauthed 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/.gitignore +11 -0
 - data/.rspec +3 -0
 - data/.travis.yml +10 -0
 - data/Gemfile +27 -0
 - data/Guardfile +10 -0
 - data/LICENSE +7 -0
 - data/README.md +9 -0
 - data/Rakefile +12 -0
 - data/config.ru +17 -0
 - data/lib/warden-oauthed/proxy.rb +39 -0
 - data/lib/warden-oauthed/strategy.rb +65 -0
 - data/lib/warden-oauthed/user.rb +15 -0
 - data/lib/warden-oauthed/version.rb +5 -0
 - data/lib/warden-oauthed.rb +14 -0
 - data/spec/app.rb +64 -0
 - data/spec/oauth_spec.rb +18 -0
 - data/spec/proxy_spec.rb +32 -0
 - data/spec/spec_helper.rb +27 -0
 - data/warden-oauthed.gemspec +33 -0
 - metadata +236 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 64c088c6e02a7eab994121ca4286c1c8781de98e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: d003d2b5b10efdf72085430bf4ceb2d34344b02f
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 53e16a72196c8d91f039a4f46ee3c3a0b73dcf8a1d4b1d3c83e02d47b4a0e3c161e0779afaee6cd254b3b413aa700f7869178c77750d918556b208500954a86a
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: c3419bc56224d7b5375bef5ca25c9ead6408d033e5aad2c52d861b6ffa0f4b59a31add90f8dbba833e468dbccde695400085b9ed5e2598a09cfe7dc4b0d9e630
         
     | 
    
        data/.gitignore
    ADDED
    
    
    
        data/.rspec
    ADDED
    
    
    
        data/.travis.yml
    ADDED
    
    
    
        data/Gemfile
    ADDED
    
    | 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            source 'https://rubygems.org'
         
     | 
| 
      
 2 
     | 
    
         
            +
            ruby '2.2.2'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            gem 'json',   '~>1.5'
         
     | 
| 
      
 5 
     | 
    
         
            +
            gem 'warden', '~>1.0'
         
     | 
| 
      
 6 
     | 
    
         
            +
            gem 'oauth2', '~>0.5.2'
         
     | 
| 
      
 7 
     | 
    
         
            +
            gem 'rack',   '~>1.6.0'
         
     | 
| 
      
 8 
     | 
    
         
            +
            gem 'rake'
         
     | 
| 
      
 9 
     | 
    
         
            +
            gem 'sinatra'
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            group :development, :test do
         
     | 
| 
      
 12 
     | 
    
         
            +
              gem 'rubocop'
         
     | 
| 
      
 13 
     | 
    
         
            +
              gem 'rerun'
         
     | 
| 
      
 14 
     | 
    
         
            +
              gem 'rspec', '~> 2.7'
         
     | 
| 
      
 15 
     | 
    
         
            +
              gem 'guard'
         
     | 
| 
      
 16 
     | 
    
         
            +
              gem 'guard-rubocop'
         
     | 
| 
      
 17 
     | 
    
         
            +
              gem 'guard-rspec', '4.2.8'
         
     | 
| 
      
 18 
     | 
    
         
            +
              gem 'guard-livereload'
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            group :test do 
         
     | 
| 
      
 22 
     | 
    
         
            +
              gem 'shotgun'
         
     | 
| 
      
 23 
     | 
    
         
            +
              gem 'addressable', '~>2.2.0'
         
     | 
| 
      
 24 
     | 
    
         
            +
              gem 'rack-test',   '~>0.5.3'
         
     | 
| 
      
 25 
     | 
    
         
            +
              gem 'webrat'
         
     | 
| 
      
 26 
     | 
    
         
            +
            end
         
     | 
| 
      
 27 
     | 
    
         
            +
              
         
     | 
    
        data/Guardfile
    ADDED
    
    | 
         @@ -0,0 +1,10 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            group :red_green_refactor, halt_on_fail: true do
         
     | 
| 
      
 2 
     | 
    
         
            +
              guard :rspec, cmd: "bundle exec rspec", failed_mode: 'focus' do
         
     | 
| 
      
 3 
     | 
    
         
            +
                watch(%r{^spec/.+_spec\.rb$})
         
     | 
| 
      
 4 
     | 
    
         
            +
                watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
         
     | 
| 
      
 5 
     | 
    
         
            +
              end
         
     | 
| 
      
 6 
     | 
    
         
            +
              guard :rubocop, all_on_start: false do
         
     | 
| 
      
 7 
     | 
    
         
            +
                watch(/.+\.rb$/)
         
     | 
| 
      
 8 
     | 
    
         
            +
                watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
            end
         
     | 
    
        data/LICENSE
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright (c) 2015 David Jaress
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # warden-oauthed
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            A [warden](https://github.com/hassox/warden) strategy that provides OAuth authentication to OAuth2 providers set up similarly to the [grape-doorkeeper](https://github.com/sethherr/grape-doorkeeper) template.
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Check out [sinatra_oauthed_template](https://github.com/sethherr/sinatra_oauthed_template), a sinatra template that uses this strategy to set up authentication without a database.
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ---
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            Draws inspiration from [warden-github](https://github.com/Zensaburou/warden-github/)
         
     | 
    
        data/Rakefile
    ADDED
    
    | 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems/package_task'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'rubygems/specification'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'bundler'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            task :default => [:spec]
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            require 'rspec/core/rake_task'
         
     | 
| 
      
 9 
     | 
    
         
            +
            desc "Run specs"
         
     | 
| 
      
 10 
     | 
    
         
            +
            RSpec::Core::RakeTask.new do |t|
         
     | 
| 
      
 11 
     | 
    
         
            +
              t.pattern = 'spec/**/*_spec.rb'
         
     | 
| 
      
 12 
     | 
    
         
            +
            end
         
     | 
    
        data/config.ru
    ADDED
    
    | 
         @@ -0,0 +1,17 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ENV['RACK_ENV'] ||= 'development'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            begin
         
     | 
| 
      
 4 
     | 
    
         
            +
              require File.expand_path('../.bundle/environment', __FILE__)
         
     | 
| 
      
 5 
     | 
    
         
            +
            rescue LoadError
         
     | 
| 
      
 6 
     | 
    
         
            +
              require 'rubygems'
         
     | 
| 
      
 7 
     | 
    
         
            +
              require 'bundler'
         
     | 
| 
      
 8 
     | 
    
         
            +
              Bundler.setup
         
     | 
| 
      
 9 
     | 
    
         
            +
            end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            Bundler.require(:runtime)
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            $LOAD_PATH << File.dirname(__FILE__) + '/lib'
         
     | 
| 
      
 14 
     | 
    
         
            +
            require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'warden-oauthed'))
         
     | 
| 
      
 15 
     | 
    
         
            +
            require File.expand_path(File.join(File.dirname(__FILE__), 'spec', 'app'))
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            run Example.app
         
     | 
| 
         @@ -0,0 +1,39 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Warden
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Oauthed
         
     | 
| 
      
 3 
     | 
    
         
            +
                module Oauth
         
     | 
| 
      
 4 
     | 
    
         
            +
                  class Proxy
         
     | 
| 
      
 5 
     | 
    
         
            +
                    attr_accessor :client_id, :secret, :scopes, :oauth_domain, :callback_url
         
     | 
| 
      
 6 
     | 
    
         
            +
                    def initialize(client_id, secret, scopes, oauth_domain, callback_url)
         
     | 
| 
      
 7 
     | 
    
         
            +
                      @client_id, @secret, @scopes, @oauth_domain, @callback_url = client_id, secret, scopes, oauth_domain, callback_url
         
     | 
| 
      
 8 
     | 
    
         
            +
                    end
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                    def ssl_options
         
     | 
| 
      
 11 
     | 
    
         
            +
                      ca_file = "/usr/lib/ssl/certs/ca-certificates.crt"
         
     | 
| 
      
 12 
     | 
    
         
            +
                      if File.exists?(ca_file)
         
     | 
| 
      
 13 
     | 
    
         
            +
                        { :ca_file => ca_file }
         
     | 
| 
      
 14 
     | 
    
         
            +
                      else
         
     | 
| 
      
 15 
     | 
    
         
            +
                        { :ca_file => ''}
         
     | 
| 
      
 16 
     | 
    
         
            +
                      end
         
     | 
| 
      
 17 
     | 
    
         
            +
                    end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                    def client
         
     | 
| 
      
 20 
     | 
    
         
            +
                      @client ||= OAuth2::Client.new(@client_id, @secret,
         
     | 
| 
      
 21 
     | 
    
         
            +
                                                     :ssl           => ssl_options,
         
     | 
| 
      
 22 
     | 
    
         
            +
                                                     :site          => oauth_domain,
         
     | 
| 
      
 23 
     | 
    
         
            +
                                                     :authorize_url => '/oauth/authorize')
         
     | 
| 
      
 24 
     | 
    
         
            +
                    end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                    def api_for(code)
         
     | 
| 
      
 27 
     | 
    
         
            +
                      client.auth_code.get_token(code, :redirect_uri => callback_url)
         
     | 
| 
      
 28 
     | 
    
         
            +
                    end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                    def authorize_url
         
     | 
| 
      
 31 
     | 
    
         
            +
                      client.auth_code.authorize_url(
         
     | 
| 
      
 32 
     | 
    
         
            +
                        :scope        => scopes,
         
     | 
| 
      
 33 
     | 
    
         
            +
                        :redirect_uri => callback_url
         
     | 
| 
      
 34 
     | 
    
         
            +
                      )
         
     | 
| 
      
 35 
     | 
    
         
            +
                    end
         
     | 
| 
      
 36 
     | 
    
         
            +
                  end
         
     | 
| 
      
 37 
     | 
    
         
            +
                end
         
     | 
| 
      
 38 
     | 
    
         
            +
              end
         
     | 
| 
      
 39 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,65 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Warden::Strategies.add(:oauthed) do
         
     | 
| 
      
 2 
     | 
    
         
            +
              # Need to make sure that we have a pure representation of the query string.
         
     | 
| 
      
 3 
     | 
    
         
            +
              # Rails adds an "action" parameter which causes the openid gem to error
         
     | 
| 
      
 4 
     | 
    
         
            +
              def params
         
     | 
| 
      
 5 
     | 
    
         
            +
                @params ||= Rack::Utils.parse_query(request.query_string)
         
     | 
| 
      
 6 
     | 
    
         
            +
              end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              def authenticate!
         
     | 
| 
      
 9 
     | 
    
         
            +
                if params['code']
         
     | 
| 
      
 10 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 11 
     | 
    
         
            +
                    api = api_for(params['code'])
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                    resp = api.get '/api/v1/me' do |request|
         
     | 
| 
      
 14 
     | 
    
         
            +
                      request.params['access_token'] = api.token
         
     | 
| 
      
 15 
     | 
    
         
            +
                    end.body
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                    user = JSON.parse(resp)
         
     | 
| 
      
 18 
     | 
    
         
            +
                    success!(Warden::Oauthed::Oauth::User.new(user['user'], api.token))
         
     | 
| 
      
 19 
     | 
    
         
            +
                  rescue OAuth2::Error
         
     | 
| 
      
 20 
     | 
    
         
            +
                    %(<p>Outdated ?code=#{params['code']}:</p><p>#{$!}</p><p><a href="/auth/oauthed">Retry</a></p>)
         
     | 
| 
      
 21 
     | 
    
         
            +
                  end
         
     | 
| 
      
 22 
     | 
    
         
            +
                else
         
     | 
| 
      
 23 
     | 
    
         
            +
                  env['rack.session']['return_to'] = env['REQUEST_URI']
         
     | 
| 
      
 24 
     | 
    
         
            +
                  throw(:warden, [ 302, {'Location' => authorize_url}, [ ]])
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              private
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              def oauth_client
         
     | 
| 
      
 31 
     | 
    
         
            +
                oauth_proxy.client
         
     | 
| 
      
 32 
     | 
    
         
            +
              end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              def authorize_url
         
     | 
| 
      
 35 
     | 
    
         
            +
                oauth_proxy.authorize_url
         
     | 
| 
      
 36 
     | 
    
         
            +
              end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              def api_for(code)
         
     | 
| 
      
 39 
     | 
    
         
            +
                oauth_proxy.api_for(code)
         
     | 
| 
      
 40 
     | 
    
         
            +
              end
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              def oauth_proxy
         
     | 
| 
      
 43 
     | 
    
         
            +
                @oauth_proxy ||= Warden::Oauthed::Oauth::Proxy.new(env['warden'].config[:oauthed_client_id],
         
     | 
| 
      
 44 
     | 
    
         
            +
                  env['warden'].config[:oauthed_secret],
         
     | 
| 
      
 45 
     | 
    
         
            +
                  env['warden'].config[:oauthed_scopes],
         
     | 
| 
      
 46 
     | 
    
         
            +
                  env['warden'].config[:oauthed_oauth_domain],
         
     | 
| 
      
 47 
     | 
    
         
            +
                  callback_url)
         
     | 
| 
      
 48 
     | 
    
         
            +
              end
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
              def callback_url
         
     | 
| 
      
 51 
     | 
    
         
            +
                absolute_url(request, env['warden'].config[:oauthed_callback_url], env['HTTP_X_FORWARDED_PROTO'])
         
     | 
| 
      
 52 
     | 
    
         
            +
              end
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
              def absolute_url(request, suffix = nil, proto = "http")
         
     | 
| 
      
 55 
     | 
    
         
            +
                port_part = 
         
     | 
| 
      
 56 
     | 
    
         
            +
                  case request.scheme
         
     | 
| 
      
 57 
     | 
    
         
            +
                  when "http"
         
     | 
| 
      
 58 
     | 
    
         
            +
                    request.port == 80 ? "" : ":#{request.port}"
         
     | 
| 
      
 59 
     | 
    
         
            +
                  when "https"
         
     | 
| 
      
 60 
     | 
    
         
            +
                    request.port == 443 ? "" : ":#{request.port}"
         
     | 
| 
      
 61 
     | 
    
         
            +
                  end
         
     | 
| 
      
 62 
     | 
    
         
            +
                proto = "http" if proto.nil?
         
     | 
| 
      
 63 
     | 
    
         
            +
                "#{proto}://#{request.host}#{port_part}#{suffix}"
         
     | 
| 
      
 64 
     | 
    
         
            +
              end
         
     | 
| 
      
 65 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,14 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'warden'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'oauth2'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'json'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            module Warden
         
     | 
| 
      
 6 
     | 
    
         
            +
              module Oauthed
         
     | 
| 
      
 7 
     | 
    
         
            +
                class OauthedMisconfiguredError < StandardError; end
         
     | 
| 
      
 8 
     | 
    
         
            +
              end
         
     | 
| 
      
 9 
     | 
    
         
            +
            end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            require 'warden-oauthed/user'
         
     | 
| 
      
 12 
     | 
    
         
            +
            require 'warden-oauthed/proxy'
         
     | 
| 
      
 13 
     | 
    
         
            +
            require 'warden-oauthed/version'
         
     | 
| 
      
 14 
     | 
    
         
            +
            require 'warden-oauthed/strategy'
         
     | 
    
        data/spec/app.rb
    ADDED
    
    | 
         @@ -0,0 +1,64 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'sinatra'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Example
         
     | 
| 
      
 4 
     | 
    
         
            +
              class App < Sinatra::Base
         
     | 
| 
      
 5 
     | 
    
         
            +
                enable  :sessions
         
     | 
| 
      
 6 
     | 
    
         
            +
                enable  :raise_errors
         
     | 
| 
      
 7 
     | 
    
         
            +
                disable :show_exceptions
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                use Warden::Manager do |manager|
         
     | 
| 
      
 10 
     | 
    
         
            +
                  manager.default_strategies :oauthed
         
     | 
| 
      
 11 
     | 
    
         
            +
                  manager.failure_app = BadAuthentication
         
     | 
| 
      
 12 
     | 
    
         
            +
                  manager[:oauthed_client_id]    = ENV['APPLICATION_CLIENT_ID']
         
     | 
| 
      
 13 
     | 
    
         
            +
                  manager[:oauthed_secret]       = ENV['APPLICATION_CLIENT_SECRET']
         
     | 
| 
      
 14 
     | 
    
         
            +
                  manager[:oauthed_scopes]       = ENV['APPLICATION_SCOPES_REQUESTED']
         
     | 
| 
      
 15 
     | 
    
         
            +
                  manager[:oauthed_oauth_domain] = ENV['OAUTH_BASE_URL']
         
     | 
| 
      
 16 
     | 
    
         
            +
                  manager[:oauthed_callback_url] = '/auth/oauthed/callback'
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                helpers do
         
     | 
| 
      
 20 
     | 
    
         
            +
                  def ensure_authenticated
         
     | 
| 
      
 21 
     | 
    
         
            +
                    unless env['warden'].authenticate!
         
     | 
| 
      
 22 
     | 
    
         
            +
                      throw(:warden)
         
     | 
| 
      
 23 
     | 
    
         
            +
                    end
         
     | 
| 
      
 24 
     | 
    
         
            +
                  end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                  def user
         
     | 
| 
      
 27 
     | 
    
         
            +
                    env['warden'].user
         
     | 
| 
      
 28 
     | 
    
         
            +
                  end
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                get '/' do
         
     | 
| 
      
 32 
     | 
    
         
            +
                  ensure_authenticated
         
     | 
| 
      
 33 
     | 
    
         
            +
                  "Hello There,\n<pre>#{user.token}</pre>"
         
     | 
| 
      
 34 
     | 
    
         
            +
                end
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                get '/redirect_to' do
         
     | 
| 
      
 37 
     | 
    
         
            +
                  ensure_authenticated
         
     | 
| 
      
 38 
     | 
    
         
            +
                  "Hello There, #{user.name}! return_to is working!"
         
     | 
| 
      
 39 
     | 
    
         
            +
                end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                get '/auth/oauthed/callback' do
         
     | 
| 
      
 42 
     | 
    
         
            +
                  ensure_authenticated
         
     | 
| 
      
 43 
     | 
    
         
            +
                  redirect '/'
         
     | 
| 
      
 44 
     | 
    
         
            +
                end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                get '/logout' do
         
     | 
| 
      
 47 
     | 
    
         
            +
                  env['warden'].logout
         
     | 
| 
      
 48 
     | 
    
         
            +
                  "Peace!"
         
     | 
| 
      
 49 
     | 
    
         
            +
                end
         
     | 
| 
      
 50 
     | 
    
         
            +
              end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
              class BadAuthentication < Sinatra::Base
         
     | 
| 
      
 53 
     | 
    
         
            +
                get '/unauthenticated' do
         
     | 
| 
      
 54 
     | 
    
         
            +
                  status 403
         
     | 
| 
      
 55 
     | 
    
         
            +
                  "Unable to authenticate, sorry bud."
         
     | 
| 
      
 56 
     | 
    
         
            +
                end
         
     | 
| 
      
 57 
     | 
    
         
            +
              end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
              def self.app
         
     | 
| 
      
 60 
     | 
    
         
            +
                @app ||= Rack::Builder.new do
         
     | 
| 
      
 61 
     | 
    
         
            +
                  run App
         
     | 
| 
      
 62 
     | 
    
         
            +
                end
         
     | 
| 
      
 63 
     | 
    
         
            +
              end
         
     | 
| 
      
 64 
     | 
    
         
            +
            end
         
     | 
    
        data/spec/oauth_spec.rb
    ADDED
    
    | 
         @@ -0,0 +1,18 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.dirname(__FILE__) + '/spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe 'Warden::Oauthed' do
         
     | 
| 
      
 4 
     | 
    
         
            +
              it 'requesting an url that requires authentication redirects to github' do
         
     | 
| 
      
 5 
     | 
    
         
            +
                response = get '/'
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                uri = Addressable::URI.parse(response.headers['Location'])
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                uri.scheme.should eql('http')
         
     | 
| 
      
 10 
     | 
    
         
            +
                uri.host.should eql('localhost')
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                params = uri.query_values
         
     | 
| 
      
 13 
     | 
    
         
            +
                params['response_type'].should eql('code')
         
     | 
| 
      
 14 
     | 
    
         
            +
                params['scope'].should eql('public')
         
     | 
| 
      
 15 
     | 
    
         
            +
                params['client_id'].should match(/\w{20}/)
         
     | 
| 
      
 16 
     | 
    
         
            +
                params['redirect_uri'].should eql('http://example.org/auth/oauthed/callback')
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
            end
         
     | 
    
        data/spec/proxy_spec.rb
    ADDED
    
    | 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require File.dirname(__FILE__) + '/spec_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe 'Warden::Oauthed::Oauth::Proxy' do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before(:all) do
         
     | 
| 
      
 5 
     | 
    
         
            +
                sha = Digest::SHA1.hexdigest(Time.now.to_s)
         
     | 
| 
      
 6 
     | 
    
         
            +
                @proxy =  Warden::Oauthed::Oauth::Proxy.new(sha[0..19], sha[0..39],
         
     | 
| 
      
 7 
     | 
    
         
            +
                  'public',
         
     | 
| 
      
 8 
     | 
    
         
            +
                  'http://localhost:3000',
         
     | 
| 
      
 9 
     | 
    
         
            +
                  'http://example.org/auth/oauthed/callback')
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              it 'returns an authorize url' do
         
     | 
| 
      
 13 
     | 
    
         
            +
                uri = Addressable::URI.parse(@proxy.authorize_url)
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                uri.scheme.should eql('http')
         
     | 
| 
      
 16 
     | 
    
         
            +
                uri.host.should eql('localhost')
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                params = uri.query_values
         
     | 
| 
      
 19 
     | 
    
         
            +
                params['response_type'].should eql('code')
         
     | 
| 
      
 20 
     | 
    
         
            +
                params['scope'].should eql('public')
         
     | 
| 
      
 21 
     | 
    
         
            +
                params['client_id'].should match(/\w{20}/)
         
     | 
| 
      
 22 
     | 
    
         
            +
                params['redirect_uri'].should eql('http://example.org/auth/oauthed/callback')
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              it "has a client object" do
         
     | 
| 
      
 26 
     | 
    
         
            +
                @proxy.client.should_not be_nil
         
     | 
| 
      
 27 
     | 
    
         
            +
              end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
              # it "returns access tokens" do
         
     | 
| 
      
 30 
     | 
    
         
            +
              #  lambda { @proxy.access_token_for(/\w{20}/.gen) }.should_not raise_error  
         
     | 
| 
      
 31 
     | 
    
         
            +
              # end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
    
        data/spec/spec_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Bundler.require(:default, :runtime, :test)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require File.join(File.dirname(__FILE__), '..', 'lib', 'warden-oauthed')
         
     | 
| 
      
 4 
     | 
    
         
            +
            require File.join(File.dirname(__FILE__), 'app')
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'rack/test'
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'webrat'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'addressable/uri'
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            require 'pp'
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            Webrat.configure do |config|
         
     | 
| 
      
 12 
     | 
    
         
            +
              config.mode = :rack
         
     | 
| 
      
 13 
     | 
    
         
            +
              config.application_port = 4567
         
     | 
| 
      
 14 
     | 
    
         
            +
            end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            RSpec.configure do |config|
         
     | 
| 
      
 17 
     | 
    
         
            +
              config.include(Rack::Test::Methods)
         
     | 
| 
      
 18 
     | 
    
         
            +
              config.include(Webrat::Methods)
         
     | 
| 
      
 19 
     | 
    
         
            +
              config.include(Webrat::Matchers)
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              config.before(:each) do
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              def app
         
     | 
| 
      
 25 
     | 
    
         
            +
                Example.app
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,33 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # -*- encoding: utf-8 -*-
         
     | 
| 
      
 2 
     | 
    
         
            +
            $LOAD_PATH.push File.expand_path('../lib', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'warden-oauthed/version'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Gem::Specification.new do |s|
         
     | 
| 
      
 6 
     | 
    
         
            +
              s.name        = 'warden-oauthed'
         
     | 
| 
      
 7 
     | 
    
         
            +
              s.version     = Warden::Oauthed::VERSION
         
     | 
| 
      
 8 
     | 
    
         
            +
              s.platform    = Gem::Platform::RUBY
         
     | 
| 
      
 9 
     | 
    
         
            +
              s.authors     = ['David Jaress', 'Seth Herr']
         
     | 
| 
      
 10 
     | 
    
         
            +
              s.homepage    = 'https://github.com/Zensaburou/warden-oauthed'
         
     | 
| 
      
 11 
     | 
    
         
            +
              s.summary     = 'A warden strategy for easy oauth integration with OAuth2 provided by Doorkeeper'
         
     | 
| 
      
 12 
     | 
    
         
            +
              s.license     = 'MIT'
         
     | 
| 
      
 13 
     | 
    
         
            +
              s.description = s.summary
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              s.add_dependency 'json',   '~>1.5'
         
     | 
| 
      
 16 
     | 
    
         
            +
              s.add_dependency 'warden', '~>1.0'
         
     | 
| 
      
 17 
     | 
    
         
            +
              s.add_dependency 'oauth2', '~>0.5.2'
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              s.add_development_dependency 'rack',      '~>1.6.0'
         
     | 
| 
      
 20 
     | 
    
         
            +
              s.add_development_dependency 'rake'
         
     | 
| 
      
 21 
     | 
    
         
            +
              s.add_development_dependency 'rerun'
         
     | 
| 
      
 22 
     | 
    
         
            +
              s.add_development_dependency 'rspec',     '~>2.8.0'
         
     | 
| 
      
 23 
     | 
    
         
            +
              s.add_development_dependency 'webrat'
         
     | 
| 
      
 24 
     | 
    
         
            +
              s.add_development_dependency 'sinatra'
         
     | 
| 
      
 25 
     | 
    
         
            +
              s.add_development_dependency 'shotgun'
         
     | 
| 
      
 26 
     | 
    
         
            +
              s.add_development_dependency 'addressable', '~>2.2.0'
         
     | 
| 
      
 27 
     | 
    
         
            +
              s.add_development_dependency 'rack-test',   '~>0.5.3'
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
              s.files         = `git ls-files`.split("\n")
         
     | 
| 
      
 30 
     | 
    
         
            +
              s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
         
     | 
| 
      
 31 
     | 
    
         
            +
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         
     | 
| 
      
 32 
     | 
    
         
            +
              s.require_paths = ["lib"]
         
     | 
| 
      
 33 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,236 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: warden-oauthed
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.1
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - David Jaress
         
     | 
| 
      
 8 
     | 
    
         
            +
            - Seth Herr
         
     | 
| 
      
 9 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 10 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 11 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2015-10-10 00:00:00.000000000 Z
         
     | 
| 
      
 13 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 14 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 15 
     | 
    
         
            +
              name: json
         
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 17 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 18 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 19 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 20 
     | 
    
         
            +
                    version: '1.5'
         
     | 
| 
      
 21 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 22 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 23 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 24 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 25 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 26 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 27 
     | 
    
         
            +
                    version: '1.5'
         
     | 
| 
      
 28 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 29 
     | 
    
         
            +
              name: warden
         
     | 
| 
      
 30 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 31 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 32 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 33 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 34 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 35 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 36 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 37 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 38 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 39 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 40 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 41 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 42 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 43 
     | 
    
         
            +
              name: oauth2
         
     | 
| 
      
 44 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 45 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 46 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 47 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 48 
     | 
    
         
            +
                    version: 0.5.2
         
     | 
| 
      
 49 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 50 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 51 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 52 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 53 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 54 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 55 
     | 
    
         
            +
                    version: 0.5.2
         
     | 
| 
      
 56 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 57 
     | 
    
         
            +
              name: rack
         
     | 
| 
      
 58 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 59 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 60 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 61 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 62 
     | 
    
         
            +
                    version: 1.6.0
         
     | 
| 
      
 63 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 64 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 65 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 66 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 67 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 68 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 69 
     | 
    
         
            +
                    version: 1.6.0
         
     | 
| 
      
 70 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 71 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 72 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 73 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 74 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 75 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 76 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 77 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 78 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 79 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 80 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 81 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 82 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 83 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 84 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 85 
     | 
    
         
            +
              name: rerun
         
     | 
| 
      
 86 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 87 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 88 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 89 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 90 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 91 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 92 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 93 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 94 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 95 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 96 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 97 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 98 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 99 
     | 
    
         
            +
              name: rspec
         
     | 
| 
      
 100 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 101 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 102 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 103 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 104 
     | 
    
         
            +
                    version: 2.8.0
         
     | 
| 
      
 105 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 106 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 107 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 108 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 109 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 110 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 111 
     | 
    
         
            +
                    version: 2.8.0
         
     | 
| 
      
 112 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 113 
     | 
    
         
            +
              name: webrat
         
     | 
| 
      
 114 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 115 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 116 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 117 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 118 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 119 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 120 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 121 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 122 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 123 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 124 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 125 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 126 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 127 
     | 
    
         
            +
              name: sinatra
         
     | 
| 
      
 128 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 129 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 130 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 131 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 132 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 133 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 134 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 135 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 136 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 137 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 138 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 139 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 140 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 141 
     | 
    
         
            +
              name: shotgun
         
     | 
| 
      
 142 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 143 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 144 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 145 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 146 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 147 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 148 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 149 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 150 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 151 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 152 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 153 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 154 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 155 
     | 
    
         
            +
              name: addressable
         
     | 
| 
      
 156 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 157 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 158 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 159 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 160 
     | 
    
         
            +
                    version: 2.2.0
         
     | 
| 
      
 161 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 162 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 163 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 164 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 165 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 166 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 167 
     | 
    
         
            +
                    version: 2.2.0
         
     | 
| 
      
 168 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 169 
     | 
    
         
            +
              name: rack-test
         
     | 
| 
      
 170 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 171 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 172 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 173 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 174 
     | 
    
         
            +
                    version: 0.5.3
         
     | 
| 
      
 175 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 176 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 177 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 178 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 179 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 180 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 181 
     | 
    
         
            +
                    version: 0.5.3
         
     | 
| 
      
 182 
     | 
    
         
            +
            description: A warden strategy for easy oauth integration with OAuth2 provided by
         
     | 
| 
      
 183 
     | 
    
         
            +
              Doorkeeper
         
     | 
| 
      
 184 
     | 
    
         
            +
            email: 
         
     | 
| 
      
 185 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 186 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 187 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 188 
     | 
    
         
            +
            files:
         
     | 
| 
      
 189 
     | 
    
         
            +
            - ".gitignore"
         
     | 
| 
      
 190 
     | 
    
         
            +
            - ".rspec"
         
     | 
| 
      
 191 
     | 
    
         
            +
            - ".travis.yml"
         
     | 
| 
      
 192 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 193 
     | 
    
         
            +
            - Guardfile
         
     | 
| 
      
 194 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
      
 195 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 196 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 197 
     | 
    
         
            +
            - config.ru
         
     | 
| 
      
 198 
     | 
    
         
            +
            - lib/warden-oauthed.rb
         
     | 
| 
      
 199 
     | 
    
         
            +
            - lib/warden-oauthed/proxy.rb
         
     | 
| 
      
 200 
     | 
    
         
            +
            - lib/warden-oauthed/strategy.rb
         
     | 
| 
      
 201 
     | 
    
         
            +
            - lib/warden-oauthed/user.rb
         
     | 
| 
      
 202 
     | 
    
         
            +
            - lib/warden-oauthed/version.rb
         
     | 
| 
      
 203 
     | 
    
         
            +
            - spec/app.rb
         
     | 
| 
      
 204 
     | 
    
         
            +
            - spec/oauth_spec.rb
         
     | 
| 
      
 205 
     | 
    
         
            +
            - spec/proxy_spec.rb
         
     | 
| 
      
 206 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     | 
| 
      
 207 
     | 
    
         
            +
            - warden-oauthed.gemspec
         
     | 
| 
      
 208 
     | 
    
         
            +
            homepage: https://github.com/Zensaburou/warden-oauthed
         
     | 
| 
      
 209 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 210 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 211 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 212 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 213 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 214 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 215 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 216 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 217 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 218 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 219 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 220 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 221 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 222 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 223 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 224 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 225 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 226 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 227 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 228 
     | 
    
         
            +
            rubygems_version: 2.4.8
         
     | 
| 
      
 229 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 230 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 231 
     | 
    
         
            +
            summary: A warden strategy for easy oauth integration with OAuth2 provided by Doorkeeper
         
     | 
| 
      
 232 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 233 
     | 
    
         
            +
            - spec/app.rb
         
     | 
| 
      
 234 
     | 
    
         
            +
            - spec/oauth_spec.rb
         
     | 
| 
      
 235 
     | 
    
         
            +
            - spec/proxy_spec.rb
         
     | 
| 
      
 236 
     | 
    
         
            +
            - spec/spec_helper.rb
         
     |