Sha256: 4d76a708930ff798786d7f9bda91c96cc5e7f7bb215c3c76c411be40d8aad19c

Contents?: true

Size: 453 Bytes

Versions: 5

Compression:

Stored size: 453 Bytes

Contents

require 'rest-core/middleware'

class RestCore::Oauth2Query
  def self.members; [:oauth_token_name, :oauth_token]; end
  include RestCore::Middleware

  def call env
    local = if oauth_token(env)
              env.merge(REQUEST_QUERY =>
                          {oauth_token_name(env) => oauth_token(env)}.
                           merge(env[REQUEST_QUERY] || {}))
            else
              env
            end

    app.call(local)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rest-core-0.2.3 lib/rest-core/middleware/oauth2_query.rb
rest-core-0.2.2 lib/rest-core/middleware/oauth2_query.rb
rest-core-0.2.1 lib/rest-core/middleware/oauth2_query.rb
rest-core-0.2.0 lib/rest-core/middleware/oauth2_query.rb
rest-core-0.0.1 lib/rest-core/middleware/oauth2_query.rb