ask-auth 0.3.1 → 0.3.2
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/CHANGELOG.md +11 -0
- data/lib/ask/auth/version.rb +1 -1
- data/lib/ask/auth.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d41ca49d1114503dc3a3830efb730823fd598c1dca1249b2c06bc808be7c4743
|
|
4
|
+
data.tar.gz: 17b4718e99c515ba26424ce90b104ad4dfc416871e2ee2598ff5f62b67524bd7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90118e173e9fa7e9a675dacb331d14fe179f006b72679c2201a3395b121f0637dd91058f99efa098a1aefcf33224f730c40ce5bcbe9a80b37932edcfef73f791
|
|
7
|
+
data.tar.gz: 73b8d4681b7a3a74a7f92600e26c819e9123b796975d4100e6784fcb948f9412fecef3c7791dd095f41f114a00dadf59ed05c0e4f04eb9dddaee22fd74e5bba9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [0.3.2] — 2026-08-13
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- **`Ask::Auth.lookup` — non-raising credential resolution.** Same chain and
|
|
6
|
+
fallback semantics as `resolve`, but returns `nil` when nothing matches
|
|
7
|
+
instead of raising `MissingCredential`. For config-time resolution (e.g.
|
|
8
|
+
ERB in `database.yml`) where a missing credential should degrade to
|
|
9
|
+
nil/defaults rather than crash the boot. `resolve` is now implemented on
|
|
10
|
+
top of `lookup` and keeps its raising behavior.
|
|
11
|
+
|
|
1
12
|
## [0.3.1] — 2026-08-07
|
|
2
13
|
|
|
3
14
|
### Added
|
data/lib/ask/auth/version.rb
CHANGED
data/lib/ask/auth.rb
CHANGED
|
@@ -74,7 +74,21 @@ module Ask
|
|
|
74
74
|
#
|
|
75
75
|
# +names+:: One or more Symbols, Strings, or Arrays identifying the credential
|
|
76
76
|
# +user+:: Optional user record for per-user providers (Database, OAuth)
|
|
77
|
+
#
|
|
78
|
+
# Raises MissingCredential when nothing matches. Use +lookup+ for a
|
|
79
|
+
# non-raising variant.
|
|
77
80
|
def resolve(*names, user: nil)
|
|
81
|
+
value = lookup(*names, user: user)
|
|
82
|
+
return value unless value.nil?
|
|
83
|
+
|
|
84
|
+
raise MissingCredential, names
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Non-raising variant of +resolve+: returns nil when no provider
|
|
88
|
+
# matches, instead of raising MissingCredential. For config-time
|
|
89
|
+
# resolution (e.g. ERB in database.yml) where a missing credential
|
|
90
|
+
# should degrade to nil/defaults rather than crash the boot.
|
|
91
|
+
def lookup(*names, user: nil)
|
|
78
92
|
return nil if names.empty?
|
|
79
93
|
|
|
80
94
|
names.each do |name|
|
|
@@ -92,7 +106,7 @@ module Ask
|
|
|
92
106
|
end
|
|
93
107
|
end
|
|
94
108
|
|
|
95
|
-
|
|
109
|
+
nil
|
|
96
110
|
end
|
|
97
111
|
|
|
98
112
|
private
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ask-auth
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kaka Ruto
|
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
111
|
version: '0'
|
|
112
112
|
requirements: []
|
|
113
|
-
rubygems_version: 4.0.
|
|
113
|
+
rubygems_version: 4.0.18
|
|
114
114
|
specification_version: 4
|
|
115
115
|
summary: Credential resolution for the ask-rb ecosystem
|
|
116
116
|
test_files: []
|