aaf-mdqt 0.8.13 → 0.8.15

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
  SHA256:
3
- metadata.gz: be1d63bb8a3f20d6772c04152459512179d1c5df970c8883d1e0f9f9fbd0d00e
4
- data.tar.gz: 7261668be892cf1433722f655cf41e61fb7311b5cbed7bdcc47caa601ce7d964
3
+ metadata.gz: 96357a8c82a04fa11041ae886cb50c1939d7d643d3c31b1e57c3dfddff81fe20
4
+ data.tar.gz: 97f9b3787b32bf103b2329b7144d707f9b724f34e58a0e40eb2955a132d15022
5
5
  SHA512:
6
- metadata.gz: d8481f1e063048dbd4db16e7f336e92f499caef97eb9280c6e1ee59eee76950c79148ce4c09a78d38cefef051dc8596a156a7e79e5927489f7cd323d50ba08d3
7
- data.tar.gz: 154585d4d68116270865225b47d9dceb4dc0dbc73bdfc3789fa40d38eb5d82f36515de2e46330a49d144d32330463a997ba0d4471334673936947f4836e3ce00
6
+ metadata.gz: 54aab980b7d663eff218b7e9b80c2da0738c329581400eb46d8f3ca68a1f880d5d6d6c6d4e6b672b2d05ee6c020254bb9e26db25b0643c6e3f67396c47734b79
7
+ data.tar.gz: 88685d7a938d89bfef090a2aed53834b46de372706382f94c36cc7908e5039502efb2a556347b20fab378e58b96d28a1bd64beb03da62e2aa992ed355a56c5fc
@@ -144,7 +144,7 @@ module MDQT
144
144
  end
145
145
 
146
146
  def connection
147
- Faraday.new(:url => base_url) do |faraday|
147
+ con = Faraday.new(:url => base_url) do |faraday|
148
148
  faraday.request :url_encoded
149
149
  faraday.response :follow_redirects
150
150
  if cache?
@@ -158,8 +158,25 @@ module MDQT
158
158
  faraday.headers['Accept'] = 'application/samlmetadata+xml'
159
159
  faraday.headers['Accept-Charset'] = 'utf-8'
160
160
  faraday.headers['User-Agent'] = "MDQT v#{MDQT::VERSION}"
161
- #faraday.response :logger
162
- faraday.adapter :httpx
161
+ #faraday.adapter :httpx
162
+ end
163
+ enable_cache_logging if verbose?
164
+ con
165
+ end
166
+
167
+ def enable_cache_logging
168
+ ActiveSupport::Notifications.subscribe "http_cache.faraday" do |*args|
169
+ event = ActiveSupport::Notifications::Event.new(*args)
170
+ cache_status = event.payload[:cache_status]
171
+
172
+ case cache_status
173
+ when :fresh, :valid
174
+ STDERR.puts "cache hit"
175
+ when :invalid, :miss
176
+ STDERR.puts "cache miss"
177
+ when :unacceptable
178
+ STDERR.puts "cache ???"
179
+ end
163
180
  end
164
181
  end
165
182
 
@@ -168,7 +185,7 @@ module MDQT
168
185
  when :none, nil
169
186
  nil
170
187
  when :file, :files
171
- File.absolute_path(File.join(Dir.tmpdir, 'mdqt_cache'))
188
+ File.absolute_path(File.join('tmp', 'cache', 'mdqt'))
172
189
  when :memcached, :memcache
173
190
  'localhost:11211'
174
191
  end
@@ -186,9 +203,6 @@ module MDQT
186
203
  @cache_store = ActiveSupport::Cache.lookup_store(:mem_cache_store, [store_config])
187
204
  end
188
205
  end
189
-
190
206
  end
191
-
192
207
  end
193
-
194
- end
208
+ end
data/lib/mdqt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MDQT
2
- VERSION = "0.8.13"
2
+ VERSION = "0.8.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aaf-mdqt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.13
4
+ version: 0.8.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Birkinshaw
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-02-17 00:00:00.000000000 Z
12
+ date: 2025-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: commander