git-fit 0.11.2 → 0.11.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 +4 -4
- data/lib/git_fit/sync/garmin_base_di.rb +0 -39
- data/lib/git_fit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 276921601668a2e97d554de9e446f64e0fe6986e681d5eada7d9688757b51d98
|
|
4
|
+
data.tar.gz: 925e3e271c03e659b406426d03f4714eaff62fb57961738455f43d6926bd0c25
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02537c373595d27fc4d65288a7608d4eb5713500eddb022e881aa9df09c68c423522cf6b065da4852bc65c155fd331836e20497ddb29dc64635a12896d3c70ae
|
|
7
|
+
data.tar.gz: 8fd6c2b178cf4a6a0e38345e0e5884cdea0ce9da14573ab3f775adb918a335e6b1cad6a2d6d92fa135c94919fcd7ac25b2870a2b963b306af206d74ce3de226c
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative 'garmin_base'
|
|
4
|
-
require 'open3'
|
|
5
4
|
|
|
6
5
|
module GitFit
|
|
7
6
|
module Sync
|
|
@@ -157,44 +156,6 @@ module GitFit
|
|
|
157
156
|
save_tokens
|
|
158
157
|
true
|
|
159
158
|
end
|
|
160
|
-
|
|
161
|
-
# @deprecated Kept for local script reference only.
|
|
162
|
-
# email+password SSO strategies are not called by `authenticate`
|
|
163
|
-
# because garmin.com DI auth requires MFA, handled by
|
|
164
|
-
# git fit auth garmin outside Ruby.
|
|
165
|
-
#
|
|
166
|
-
# Note: method naming (strategy_a = curl_cffi, strategy_b = Playwright) is
|
|
167
|
-
# historical. In git fit auth garmin, Playwright runs first (cookies
|
|
168
|
-
# persist 365d → no repeat MFA), curl_cffi is the fallback.
|
|
169
|
-
def strategy_a_login
|
|
170
|
-
script = File.expand_path('../../../scripts/garmin_auth.py', __dir__)
|
|
171
|
-
return nil unless File.exist?(script)
|
|
172
|
-
|
|
173
|
-
stdout, stderr, status = Open3.capture3(
|
|
174
|
-
{'SYNC__GARMIN__EMAIL' => @email, 'SYNC__GARMIN__PASSWORD' => @password, 'SYNC__GARMIN__DOMAIN' => @domain},
|
|
175
|
-
'python3', script
|
|
176
|
-
)
|
|
177
|
-
warn stderr unless stderr.empty?
|
|
178
|
-
JSON.parse(stdout) if status.success?
|
|
179
|
-
rescue StandardError => e
|
|
180
|
-
puts "Strategy A (curl_cffi) failed: #{e.message}"
|
|
181
|
-
nil
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
def strategy_b_login
|
|
185
|
-
script = File.expand_path('../../../scripts/garmin_auth_playwright.py', __dir__)
|
|
186
|
-
return nil unless File.exist?(script)
|
|
187
|
-
|
|
188
|
-
stdout, stderr, status = Open3.capture3(
|
|
189
|
-
{'SYNC__GARMIN__EMAIL' => @email, 'SYNC__GARMIN__PASSWORD' => @password, 'SYNC__GARMIN__DOMAIN' => @domain},
|
|
190
|
-
'python3', script
|
|
191
|
-
)
|
|
192
|
-
warn stderr unless stderr.empty?
|
|
193
|
-
JSON.parse(stdout) if status.success?
|
|
194
|
-
rescue StandardError => e
|
|
195
|
-
puts "Strategy B (Playwright) failed: #{e.message}"
|
|
196
|
-
nil
|
|
197
|
-
end
|
|
198
159
|
end
|
|
199
160
|
end
|
|
200
161
|
end
|
data/lib/git_fit/version.rb
CHANGED