vestauth 0.5.1 → 0.6.0
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/vestauth/binary.rb +2 -30
- data/lib/vestauth/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: 56ec07176f9367f81157404f348697f64620a6520ca7bf801cb94be0a6a39249
|
|
4
|
+
data.tar.gz: ca20e79a4d654ae44384fbbc64c28b7a911c9dbd894c6acbc1174052f9896608
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '02168900ebb51a9f53c197669a406791d403b444f6475cfbc8e0dc4e0ea020cc4b2a844ba9d858b589696440f5965eeb217b5876a86e83ab4e3a53949861e79e'
|
|
7
|
+
data.tar.gz: 0e98dc8e79a08544b76db6903b8874646f6b5262e94c9805429c22d14551b2c8e5acdbfb98b35a8c801884463eb7a806707594ac6ce849a85204df0571a4a3c8
|
data/lib/vestauth/binary.rb
CHANGED
|
@@ -28,7 +28,7 @@ module Vestauth
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def agent_headers(http_method:, uri:, private_jwk:, id:)
|
|
31
|
-
private_jwk =
|
|
31
|
+
private_jwk = private_jwk.as_json.to_json
|
|
32
32
|
|
|
33
33
|
command = [
|
|
34
34
|
@executable,
|
|
@@ -46,7 +46,7 @@ module Vestauth
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def primitives_verify(http_method:, uri:, signature_header:, signature_input_header:, public_jwk:)
|
|
49
|
-
public_jwk =
|
|
49
|
+
public_jwk = public_jwk.as_json.to_json
|
|
50
50
|
|
|
51
51
|
command = [
|
|
52
52
|
@executable,
|
|
@@ -75,33 +75,5 @@ module Vestauth
|
|
|
75
75
|
|
|
76
76
|
JSON.parse(stdout)
|
|
77
77
|
end
|
|
78
|
-
|
|
79
|
-
def serialize_json_arg(value, name:)
|
|
80
|
-
return value if value.is_a?(String)
|
|
81
|
-
|
|
82
|
-
return JSON.generate(value) if value.is_a?(Hash) || value.is_a?(Array)
|
|
83
|
-
|
|
84
|
-
if value.respond_to?(:to_h)
|
|
85
|
-
json = serialize_json_arg_from_to_h(value)
|
|
86
|
-
return json unless json.nil?
|
|
87
|
-
end
|
|
88
|
-
return JSON.generate(value.as_json) if value.respond_to?(:as_json)
|
|
89
|
-
|
|
90
|
-
raise ArgumentError, "#{name} must be a JSON string, Hash/Array, or object responding to #to_h"
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def serialize_json_arg_from_to_h(value)
|
|
94
|
-
JSON.generate(value.to_h)
|
|
95
|
-
rescue StandardError => e
|
|
96
|
-
raise unless action_controller_unfiltered_parameters?(e)
|
|
97
|
-
|
|
98
|
-
nil
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
def action_controller_unfiltered_parameters?(error)
|
|
102
|
-
error.instance_of?(Object.const_get("ActionController::UnfilteredParameters"))
|
|
103
|
-
rescue NameError
|
|
104
|
-
false
|
|
105
|
-
end
|
|
106
78
|
end
|
|
107
79
|
end
|
data/lib/vestauth/version.rb
CHANGED