From ec9932e4916843499fae71da2c83ec79c87db972 Mon Sep 17 00:00:00 2001 From: Ilya Zhitomirskiy Date: Tue, 14 Jun 2011 18:30:43 -0700 Subject: [PATCH] green on all the cucumbers WOOT --- app/controllers/authorizations_controller.rb | 2 ++ features/step_definitions/oauth_steps.rb | 3 ++- spec/chubbies/Gemfile.lock | 6 +----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/controllers/authorizations_controller.rb b/app/controllers/authorizations_controller.rb index 70f4d8a88..d0acde0ee 100644 --- a/app/controllers/authorizations_controller.rb +++ b/app/controllers/authorizations_controller.rb @@ -61,6 +61,8 @@ class AuthorizationsController < ApplicationController split = signed_string.split(';') time = split[2] nonce = split[3] + + return 'blank public key' if public_key.blank? return "invalid time" unless valid_time?(time) return 'invalid nonce' unless valid_nonce?(nonce) return 'invalid signature' unless verify_signature(signed_string, Base64.decode64(sig), public_key) diff --git a/features/step_definitions/oauth_steps.rb b/features/step_definitions/oauth_steps.rb index 3cee77c65..627b7dd94 100644 --- a/features/step_definitions/oauth_steps.rb +++ b/features/step_definitions/oauth_steps.rb @@ -7,7 +7,8 @@ Given /^Chubbies has been killed$/ do end Given /^Chubbies is registered on my pod$/ do - client = OAuth2::Provider.client_class.create_from_manifest!("localhost:#{Chubbies::PORT}/manifest.json") + manifest = JSON.parse(RestClient.get("localhost:#{Chubbies::PORT}/manifest.json").body) + client = OAuth2::Provider.client_class.create_from_manifest!(manifest) params = {:client_id => client.oauth_identifier, :client_secret => client.oauth_secret, :host => "localhost:9887"} diff --git a/spec/chubbies/Gemfile.lock b/spec/chubbies/Gemfile.lock index 4e8d13a30..301df52ac 100644 --- a/spec/chubbies/Gemfile.lock +++ b/spec/chubbies/Gemfile.lock @@ -3,7 +3,6 @@ PATH specs: diaspora-client (0.0.0) activerecord - em-synchrony faraday oauth2 sinatra @@ -21,12 +20,9 @@ GEM arel (~> 2.0.2) tzinfo (~> 0.3.23) activesupport (3.0.3) - addressable (2.2.6) + addressable (2.2.4) arel (2.0.10) builder (2.1.2) - em-synchrony (0.2.0) - eventmachine (>= 0.12.9) - eventmachine (0.12.10) faraday (0.6.1) addressable (~> 2.2.4) multipart-post (~> 1.1.0)