omniauth-idcat_mobil 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8300ff0763d3f698d9554aaea9af39888e587e27ebe5a0932833dccf7540da0
4
- data.tar.gz: 17ec09c05d66d34b82ba663b1947d0db218b91bacc47894278eef36bf9b8cf8c
3
+ metadata.gz: 37d52ae58802955d43e15d2492906f84dba0b4a9f6a042436fad68ebc1093f33
4
+ data.tar.gz: 131dc83ac5dc43b4ee47d66ff3213341394ae01469273ef6adb8580e72be6129
5
5
  SHA512:
6
- metadata.gz: a96b0fa966251a2ae1e8247e49e811584f6010dce67f7f9931b35d08e9beb31c08ac47c27ee80975e12acc931d6e4e6d3d526fff946c772c81517637c2592743
7
- data.tar.gz: a3c684b87be83c364752e7c528e848259003f5a9cd1ab9edaf7e5c93d805e6ef15f78c5a366a8d60b5687eb28c8d2bea16fc65aa8ed7012a1afa7e6d259e8a08
6
+ metadata.gz: 129387454f49df2062c14dce03ba6a5720b1be7fa11697f28026096d38da62ebcbbc62ff4953c5833cc7269a398dcb9bf8ef0a99a152bb4d61c4b0a7030d5707
7
+ data.tar.gz: b6dea50779fdd2b3835e6944b0dee4b58bccb9907d036fa6e3d1d9189c77f402525057399acb6085988abff36145dccf971adca0144be0801bb8729095e51268
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.3
1
+ 2.7.5
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## next version:
4
4
 
5
+ ## Version 0.2.2 (PATCH)
6
+ - Fix internal `log` method is wrongly invoked from `omniauth`.
7
+ - Bump Ruby version to 2.7.5
8
+
5
9
  ## Version 0.2.1 (PATCH)
6
10
  - Apply security upgrades
7
11
  - Add a .ruby-version file
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module IdCatMobil
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -77,8 +77,8 @@ module OmniAuth
77
77
  #
78
78
  # We're overriding solely to log.
79
79
  def request_phase
80
- log("In `request_phase`, with params: redirect_uri=>#{callback_url}, options=>#{options.authorize_params}")
81
- log("`request_phase`, redirecting the user to AOC...")
80
+ idcat_log("In `request_phase`, with params: redirect_uri=>#{callback_url}, options=>#{options.authorize_params}")
81
+ idcat_log("`request_phase`, redirecting the user to AOC...")
82
82
  super
83
83
  end
84
84
 
@@ -88,18 +88,18 @@ module OmniAuth
88
88
  # In case of success we still have to ask the authentication provider for the access_token.
89
89
  # That's what we do in this callback.
90
90
  def callback_phase
91
- log("In `callback_phase` with request params: #{request.params}")
92
- log("Both should be equal otherwise a 'CSRF detected' error is raised: params state[#{request.params["state"]}] =? [#{session.delete("omniauth.state")}] session state.")
91
+ idcat_log("In `callback_phase` with request params: #{request.params}")
92
+ idcat_log("Both should be equal otherwise a 'CSRF detected' error is raised: params state[#{request.params["state"]}] =? [#{session.delete("omniauth.state")}] session state.")
93
93
  super
94
94
  end
95
95
 
96
96
  def raw_info
97
- log("Access token response was: #{access_token.response}")
98
- log("Performing getUserInfo...")
97
+ idcat_log("Access token response was: #{access_token.response}")
98
+ idcat_log("Performing getUserInfo...")
99
99
  unless @raw_info
100
100
  response= access_token.get(options.user_info_path)
101
101
  result= %i(status headers body).collect {|m| response.send(m)}
102
- log("getUserInfo response status/headers/body: #{result}")
102
+ idcat_log("getUserInfo response status/headers/body: #{result}")
103
103
  @raw_info= response.parsed
104
104
  # Logout to avoid problems with IdCat mòbil's cookie session when trying to login again.
105
105
  logout_url= URI.join(options.site, "/o/oauth2/logout?token=#{access_token.token}").to_s
@@ -114,12 +114,16 @@ module OmniAuth
114
114
  full_host + script_name + callback_path
115
115
  end
116
116
 
117
- def log(msg)
118
- logger.debug(msg)
117
+ # --------------------------------------------------
118
+ private
119
+ # --------------------------------------------------
120
+
121
+ def idcat_log(msg)
122
+ idcat_logger.debug(msg)
119
123
  end
120
124
 
121
- def logger
122
- @logger||= defined?(Rails.logger) ? Rails.logger : Logger.new(STDOUT, progname: 'idcat_mobil')
125
+ def idcat_logger
126
+ @idcat_logger||= defined?(Rails.logger) ? Rails.logger : Logger.new(STDOUT, progname: 'idcat_mobil')
123
127
  end
124
128
  end
125
129
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-idcat_mobil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Valls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-21 00:00:00.000000000 Z
11
+ date: 2022-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth