patchwork-rb 0.1.9 → 0.1.10

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: 2d1aedce8e678200369c6550388c002085afd364d06a2aa98c4f4f1727c728c3
4
- data.tar.gz: 01fe72a9e84de16a83a98be88ecd770363ac2520f39857d054fa9fece6c1edea
3
+ metadata.gz: 2b8480ba1384033ccd3526de52d98c4e6767742ab5193d7b6c86ddf4e4e4ccba
4
+ data.tar.gz: 06aa3c3894aa8e811a2a055308c7dd69e4d12a92bdf1d0357058336d3691f1e7
5
5
  SHA512:
6
- metadata.gz: 5f1cf733c653e0186303cdc14f1b80d2f87c8c73cfc13f592c2ade0f197f0120266fb8d102005225b2fb194c6b2738308985a0c0405708b8f29ddbc517924fb5
7
- data.tar.gz: d7f9b1a2502da37c696732a96c0b4d2a8094918b5cfeb9fa8ff5c5563bc21a523c7008d961b9d076b005dbed90824d9c6f756cf08cddc65f20a6983957f2a7c1
6
+ metadata.gz: ee7adcdb22f7daa2ee0e3c530a986605ad5cea2adb3c38ef6aca81bb5401a90a62187e84e72336678677155db7f9d6a4191a5e5739943fc35969c20a85169473
7
+ data.tar.gz: b8bafbac2ab580b4be713b965a3386312493720483d777b5566eb2bc5f522113dffe305bb01ed51ebce8a61b079629ed41645f13e563302fdd7386a608cfaeee
data/README.md CHANGED
@@ -383,7 +383,7 @@ All of them except `ArgumentError` inherit from `Patchwork::Error`. None of them
383
383
  The primitives are public if you need to sign or verify outside Rack:
384
384
 
385
385
  ```ruby
386
- Patchwork::Signature.header(secrets: [secret], timestamp: Time.now.to_i, method: "POST", path: "/v1/runs", body: body)
386
+ Patchwork::Signature.header(secrets: [secret], timestamp: Time.now.to_i, method: "POST", path: "/v1/runs", body: body, query: nil)
387
387
  Patchwork::Signature.verify!(secrets: [current, previous], header: header, method: "POST", path: path, body: raw_body)
388
388
  Patchwork::SessionToken.verify(token) # => claims, or raises Patchwork::InvalidToken
389
389
  ```
@@ -29,8 +29,10 @@ module Patchwork
29
29
  mac(secret, payload(label, timestamp, method, path, query, digest(body)))
30
30
  end
31
31
 
32
- def self.header(secrets:, timestamp:, method:, path:, body:, query: nil, labels: nil)
33
- labels = (labels || (query.nil? ? [ V1 ] : LABELS)).map(&:to_s)
32
+ # Emits v2, which is what Patchwork sends. v1 is retired; pass
33
+ # labels: [V1] if you need to produce one for a test.
34
+ def self.header(secrets:, timestamp:, method:, path:, body:, query: nil, labels: [ V2 ])
35
+ labels = Array(labels).map(&:to_s)
34
36
  usable = usable!(secrets)
35
37
 
36
38
  values = labels.flat_map do |label|
@@ -1,3 +1,3 @@
1
1
  module Patchwork
2
- VERSION = "0.1.9".freeze
2
+ VERSION = "0.1.10".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patchwork-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chromablue Labs