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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6b8f1d4a5090fe9722110044d32e179747140a59095bfa8cb204da5181d320f
4
- data.tar.gz: e5fa5304418ee9327a68828e670c6b32e8df582d3279f85b1babe9158af7608f
3
+ metadata.gz: 56ec07176f9367f81157404f348697f64620a6520ca7bf801cb94be0a6a39249
4
+ data.tar.gz: ca20e79a4d654ae44384fbbc64c28b7a911c9dbd894c6acbc1174052f9896608
5
5
  SHA512:
6
- metadata.gz: 1f2caff1c291833e5e980181bc80541c5d90190b3863b97fce823c66ebb8f19272c098a9bf2d04511375c0af91d25808de1ba9fecccbe8bb49fe7f9c260f1bb6
7
- data.tar.gz: d840d82fc9ce7167e112cfd78b62e98090fcd3085d0c51f7e0390eb7746556ea2071fb0b7489f0ae51c19d8e81996f5f7062a255726d9926f43a20a71d8d1bac
6
+ metadata.gz: '02168900ebb51a9f53c197669a406791d403b444f6475cfbc8e0dc4e0ea020cc4b2a844ba9d858b589696440f5965eeb217b5876a86e83ab4e3a53949861e79e'
7
+ data.tar.gz: 0e98dc8e79a08544b76db6903b8874646f6b5262e94c9805429c22d14551b2c8e5acdbfb98b35a8c801884463eb7a806707594ac6ce849a85204df0571a4a3c8
@@ -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 = serialize_json_arg(private_jwk, name: "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 = serialize_json_arg(public_jwk, name: "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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vestauth
4
- VERSION = "0.5.1"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vestauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - motdotla