darrrr 0.1.4 → 0.1.5
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/darrrr.rb +4 -12
- data/lib/darrrr/provider.rb +2 -3
- 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: ad72010cfec2769fc738c5794089a2ce31e1d1b8dddb427d7570055dc8db2c9b
|
4
|
+
data.tar.gz: 19bd04a3cefc965cef5d1e837d2cb5522485b5dd5052fc620c513342a11a8836
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df9cbc3abd3a989f15364393b7b50e43f24b3668e730541687808de59694625934dc938b4106538a0029a1af3072af677cad3c276b5b8b401d40e98baed6974d
|
7
|
+
data.tar.gz: fc3765b35e8b5d9f0a3320df2a6eb0e76caa7cd83f74d91791b630dd04ae07d0209a9f77e1a5b2ac96a30a0fb8e0c08a8f12096a8b4e7bb7fba69de1914195cc
|
data/lib/darrrr.rb
CHANGED
@@ -58,13 +58,13 @@ module Darrrr
|
|
58
58
|
class << self
|
59
59
|
# recovery provider data is only loaded (and cached) upon use.
|
60
60
|
attr_accessor :recovery_providers, :account_providers, :cache, :allow_unsafe_urls,
|
61
|
-
:privacy_policy, :icon_152px, :authority
|
61
|
+
:privacy_policy, :icon_152px, :authority, :faraday_config_callback
|
62
62
|
|
63
63
|
# Find and load remote recovery provider configuration data.
|
64
64
|
#
|
65
65
|
# provider_origin: the origin that contains the config data in a well-known
|
66
66
|
# location.
|
67
|
-
def recovery_provider(provider_origin
|
67
|
+
def recovery_provider(provider_origin)
|
68
68
|
unless self.recovery_providers
|
69
69
|
raise "No recovery providers configured"
|
70
70
|
end
|
@@ -72,11 +72,7 @@ module Darrrr
|
|
72
72
|
if provider_origin == this_recovery_provider&.origin
|
73
73
|
this_recovery_provider
|
74
74
|
elsif self.recovery_providers.include?(provider_origin)
|
75
|
-
RecoveryProvider.new(provider_origin).
|
76
|
-
if block_given?
|
77
|
-
yield provider
|
78
|
-
end
|
79
|
-
}.load
|
75
|
+
RecoveryProvider.new(provider_origin).load
|
80
76
|
else
|
81
77
|
raise UnknownProviderError, "Unknown recovery provider: #{provider_origin}"
|
82
78
|
end
|
@@ -101,11 +97,7 @@ module Darrrr
|
|
101
97
|
if provider_origin == this_account_provider&.origin
|
102
98
|
this_account_provider
|
103
99
|
elsif self.account_providers.include?(provider_origin)
|
104
|
-
AccountProvider.new(provider_origin).
|
105
|
-
if block_given?
|
106
|
-
yield provider
|
107
|
-
end
|
108
|
-
}.load
|
100
|
+
AccountProvider.new(provider_origin).load
|
109
101
|
else
|
110
102
|
raise UnknownProviderError, "Unknown account provider: #{provider_origin}"
|
111
103
|
end
|
data/lib/darrrr/provider.rb
CHANGED
@@ -9,7 +9,6 @@ module Darrrr
|
|
9
9
|
|
10
10
|
def self.included(base)
|
11
11
|
base.instance_eval do
|
12
|
-
attr_accessor :faraday_config_callback
|
13
12
|
# this represents the account/recovery provider on this web app
|
14
13
|
class << self
|
15
14
|
attr_accessor :this
|
@@ -77,8 +76,8 @@ module Darrrr
|
|
77
76
|
|
78
77
|
private def faraday
|
79
78
|
Faraday.new do |f|
|
80
|
-
if
|
81
|
-
|
79
|
+
if Darrrr.faraday_config_callback
|
80
|
+
Darrrr.faraday_config_callback.call(f)
|
82
81
|
else
|
83
82
|
f.adapter(Faraday.default_adapter)
|
84
83
|
end
|