omniauth-etrade 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cdea334540526f79621fe6725720869ea67d0660
4
- data.tar.gz: 27710cb645f30ce1f19b4ef4229c96e40da01664
3
+ metadata.gz: 2a13b4faadfddfa04581b5d94cff2aba966a3e86
4
+ data.tar.gz: 08add985bb607cf701b7c6321fe297512dc43b63
5
5
  SHA512:
6
- metadata.gz: b162d3a5b075362abb39767b54fe39071a45883e3c6878a378eed70669f1a96e8e277ac42ed8a09cca5e005e757788f234ad9965ec335b6141ec3eeaf1ea6746
7
- data.tar.gz: de49a820cc9a1ad0aa79b855cd0947af4416e839ac81a16bc37a8a9760cff556b51d0b89c06a14911d2fc8e6a80cd18487be06271679d6b4b09a841b0269fd81
6
+ metadata.gz: 761615071f5182cc940deffa694c033732884fcc6143fea7b59cac195b26903c707010c5ba28a1d8eabcbd3ee0c41996f4bf5926a3b02375f8b6fc4c2e44f0be
7
+ data.tar.gz: d30bbcb10c2defab5f110f9f611f9ca8d4c84f76a81905f2a7c441ac728b60b504c34089b8e0f414884ec87eb240a145315aaaaf8a0e39a59c65df60b278a27f
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Etrade
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -3,6 +3,7 @@ require 'omniauth-oauth'
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Etrade < OmniAuth::Strategies::OAuth
6
+
6
7
  option :client_options, {
7
8
  :site => 'https://etws.etrade.com',
8
9
  :authorize_url => 'https://us.etrade.com/e/t/etws/authorize',
@@ -14,6 +15,25 @@ module OmniAuth
14
15
  'oob'
15
16
  end
16
17
 
18
+ def request_phase
19
+ request_token = consumer.get_request_token({:oauth_callback => callback_url}, options.request_params)
20
+ session['oauth'] ||= {}
21
+ session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
22
+
23
+ if request_token.callback_confirmed?
24
+ redirect request_token.authorize_url({key: options.consumer_key}.merge(options[:authorize_params])).sub! 'oauth_token', 'token'
25
+ else
26
+ redirect request_token.authorize_url(options[:authorize_params].merge(oauth_callback: callback_url, key: options.consumer_key)).sub! 'oauth_token', 'token'
27
+ end
28
+
29
+ rescue ::Timeout::Error => e
30
+ fail!(:timeout, e)
31
+ rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
32
+ fail!(:service_unavailable, e)
33
+ end
34
+
35
+
36
+
17
37
  uid { raw_info['uid'] }
18
38
 
19
39
  info do
@@ -29,7 +49,8 @@ module OmniAuth
29
49
  end
30
50
 
31
51
  def raw_info
32
- @raw_info ||= MultiJson.decode(access_token.get('/1/account/info').body)
52
+ Rails.logger.debug(access_token.to_yaml)
53
+ @raw_info ||= MultiJson.decode(access_token.get('/1/account/info').body)
33
54
  end
34
55
 
35
56
  end
@@ -8,10 +8,10 @@ Gem::Specification.new do |spec|
8
8
  spec.name = "omniauth-etrade"
9
9
  spec.version = OmniAuth::Etrade::VERSION
10
10
  spec.authors = ["Athens Holloway"]
11
- spec.email = ["athensholloway@gmail.com"]
11
+ spec.email = ["athens@uvest.co"]
12
12
  spec.description = %q{OmniAuth strategy of E*TRADE}
13
13
  spec.summary = %q{OmniAuth strategy of E*TRADE}
14
- spec.homepage = "https://github.com/athensholloway/omniauth-etrade"
14
+ spec.homepage = "https://github.com/uvest/omniauth-etrade"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-etrade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Athens Holloway
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-22 00:00:00.000000000 Z
11
+ date: 2013-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -124,7 +124,7 @@ dependencies:
124
124
  version: '0'
125
125
  description: OmniAuth strategy of E*TRADE
126
126
  email:
127
- - athensholloway@gmail.com
127
+ - athens@uvest.co
128
128
  executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
@@ -139,7 +139,7 @@ files:
139
139
  - lib/omniauth-etrade/version.rb
140
140
  - lib/omniauth/strategies/etrade.rb
141
141
  - omniauth-etrade.gemspec
142
- homepage: https://github.com/athensholloway/omniauth-etrade
142
+ homepage: https://github.com/uvest/omniauth-etrade
143
143
  licenses:
144
144
  - MIT
145
145
  metadata: {}