oa-webmoney 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 206a52b6f38d7d2a0cddb2c90f0b1061c83c3054
4
+ data.tar.gz: e2398d22d23aec51c170c9315cdbefbd9394ff22
5
+ SHA512:
6
+ metadata.gz: ab50744c858e01b8ac1f973c0f6c49a2454dcd534acdb974a7eab293fffcd18389871de4716f5542f1c9127d64731d263f940e41dc3ea1dd0873b222b0cce3b9
7
+ data.tar.gz: 9f01a3bc1066a3d66a07dd4d0fb062bda212bb8cb1c220a9550ceb9669d05bf23af46756a63c9894775ac66aae98d5a15d97549bda1c429b59bed9dc90b145ef
data/README.md CHANGED
@@ -32,6 +32,7 @@ devise.rb
32
32
  :app_rids => {
33
33
  'localhost' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
34
34
  'example.com' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' }},
35
+ :trusted_addr => %w(127.0.0.1 172.16.0.0/16)
35
36
  :env => Rails.env,
36
37
  :wm_instance => Rails.webmoney #optional, if you have already used webmoney gem instance in your app
37
38
 
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Webmoney
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -1,3 +1,4 @@
1
+ require 'ipaddr'
1
2
  require 'omniauth'
2
3
  require 'webmoney'
3
4
 
@@ -39,11 +40,7 @@ module OmniAuth
39
40
  # 11
40
41
  :pwd_access_blocked => "Password access to the service blocked",
41
42
  # 12
42
- :user_blocked => "The user is temporarily blocked. Probably made the selection Ticket",
43
- # 201
44
- :ip_differs => "Ip address in the request differs from the address, which was an authorized user",
45
-
46
- :canceled => "Authorization was canceled by user"
43
+ :user_blocked => "The user is temporarily blocked. Probably made the selection Ticket"
47
44
  }
48
45
 
49
46
  option :credentials
@@ -59,14 +56,9 @@ module OmniAuth
59
56
  end
60
57
 
61
58
  def callback_phase
62
- if request.params["WmLogin_KeeperRetStr"] == "Canceled"
63
- return fail!(:canceled, OmniAuth::Error.new(ERROR_MESSAGES[:canceled]))
64
- end
65
-
66
- # work around for local development
67
- ip_to_check = [:development, :test].include?(options[:env].to_sym) ? extra[:WmLogin_UserAddress] : request.ip
59
+ return cancel_authentication! if cancel_authentication?
68
60
 
69
- check_req_params = extra.merge({:remote_ip => ip_to_check})
61
+ check_req_params = extra.merge({:remote_ip => extra[:WmLogin_UserAddress]})
70
62
 
71
63
  options[:wm_instance] ||= WmLib.new(:wmid => options[:credentials][:site_holder_wmid])
72
64
 
@@ -103,6 +95,16 @@ module OmniAuth
103
95
  super
104
96
  end
105
97
 
98
+ def cancel_authentication!
99
+ r = Rack::Response.new
100
+ r.redirect "/"
101
+ r.finish
102
+ end
103
+
104
+ def cancel_authentication?
105
+ %w(Canceled LoggedOff).include?(request.params["WmLogin_KeeperRetStr"])
106
+ end
107
+
106
108
  def uid
107
109
  extra[:WmLogin_WMID]
108
110
  end
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oa-webmoney
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Anton Orel
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-07-13 00:00:00.000000000 Z
11
+ date: 2014-04-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: webmoney
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.0.12
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: 0.0.12
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.1.rc.2
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: 1.1.rc.2
46
41
  description: OmniAuth Webmoney Strategy
@@ -50,7 +45,7 @@ executables: []
50
45
  extensions: []
51
46
  extra_rdoc_files: []
52
47
  files:
53
- - .gitignore
48
+ - ".gitignore"
54
49
  - CHANGES
55
50
  - Gemfile
56
51
  - LICENSE
@@ -62,27 +57,26 @@ files:
62
57
  - oa-webmoney.gemspec
63
58
  homepage: http://github.com/skyeagle/oa-webmoney
64
59
  licenses: []
60
+ metadata: {}
65
61
  post_install_message:
66
62
  rdoc_options: []
67
63
  require_paths:
68
64
  - lib
69
65
  required_ruby_version: !ruby/object:Gem::Requirement
70
- none: false
71
66
  requirements:
72
- - - ! '>='
67
+ - - ">="
73
68
  - !ruby/object:Gem::Version
74
69
  version: '0'
75
70
  required_rubygems_version: !ruby/object:Gem::Requirement
76
- none: false
77
71
  requirements:
78
- - - ! '>='
72
+ - - ">="
79
73
  - !ruby/object:Gem::Version
80
74
  version: '0'
81
75
  requirements: []
82
76
  rubyforge_project:
83
- rubygems_version: 1.8.24
77
+ rubygems_version: 2.2.1
84
78
  signing_key:
85
- specification_version: 3
79
+ specification_version: 4
86
80
  summary: OmniAuth Webmoney Strategy
87
81
  test_files: []
88
82
  has_rdoc: