fridge 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/fridge.rb +1 -2
- data/lib/fridge/version.rb +1 -1
- data/spec/fridge/rails_helpers_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e778b64e5e08eca5fee8b818ddd9ece69f9b6777
|
4
|
+
data.tar.gz: 06949113737a9413e4cdf04821e9caf33dd94307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d336321d0f8ed2d749a55d3c58bfcdb467c013d63d9bb869ebff8b9ec498e21ee81a7452a3e0a74257de8acd4a8dbfdd813da136724430e84de384eaf3d367
|
7
|
+
data.tar.gz: 43e493486f03b0d08196303b8076ef42bc7dc8d7e0b0dc584a287bc88f2bf95782c819f50028e24a548b5fd877bb5a4b73c59f4eeb9c20ac822326aeadba91e0
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ And then run `bundle install`.
|
|
23
23
|
| `private_key` | Private token signing key | A PEM-formatted key |
|
24
24
|
| `public_key` | Public token verification key (the private key's complement) | A PEM-formatted key |
|
25
25
|
| `signing_algorithm` | Algorithm to use for sigining and verification | `RS512`, `RS256` |
|
26
|
-
| `validator` | A lambda used to perform custom validation of tokens
|
26
|
+
| `validator` | A lambda used to perform custom validation of tokens | Any `Proc` |
|
27
27
|
|
28
28
|
Resource servers must configure a public key corresponding to an authorization server, in order to verify tokens issued by that server. Authorization servers must configure a private key.
|
29
29
|
|
data/lib/fridge.rb
CHANGED
@@ -18,7 +18,6 @@ module Fridge
|
|
18
18
|
|
19
19
|
# A validator must raise an exception or return a false value for an
|
20
20
|
# invalid token
|
21
|
-
has :validator, classes: [Proc],
|
22
|
-
default: -> (access_token) { access_token.valid? }
|
21
|
+
has :validator, classes: [Proc], default: ->(token) { token.valid? }
|
23
22
|
end
|
24
23
|
end
|
data/lib/fridge/version.rb
CHANGED
@@ -72,7 +72,7 @@ describe Controller, type: :controller do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
it 'should raise an error if custom validation fails' do
|
75
|
-
Fridge.configuration.validator = ->
|
75
|
+
Fridge.configuration.validator = ->(token) { false }
|
76
76
|
expect { controller.current_token }.to raise_error Fridge::InvalidToken
|
77
77
|
end
|
78
78
|
|