ace-hitl-contract 0.2.0 → 0.2.1
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 +6 -0
- data/lib/ace/hitl/contract/managed_envelope.rb +3 -1
- data/lib/ace/hitl/contract/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: cb90db31c845024c2415ceab4ad473bfd6843323cc5d9a6e6c3a4df6f822e7e3
|
|
4
|
+
data.tar.gz: 267b6eb9266824a22151ce5c5a38b260d4f384424090ba07148afc1bf34c063f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1539a233ebf5dd1eda0b6efc2aee3958d934d61d50b4bb4f1ba4e7911d6fedde8dde7fce9e48fa96621b4ac142ba72be1471d8b9d5c46e3477c45a68ac5e3db1
|
|
7
|
+
data.tar.gz: 2ac3d16e9465cd971f258767f43252255cc2de2e8564a115d56743c7efd59d00e918d3023430e68a8ad03a8c8c9811717dc52cea78a94fa562555781040cf85a
|
data/CHANGELOG.md
CHANGED
|
@@ -20,6 +20,7 @@ module Ace
|
|
|
20
20
|
OPTIONAL = %w[payload_sha256 message effect].freeze
|
|
21
21
|
TOKEN = /\A[A-Za-z0-9][A-Za-z0-9._:-]{0,127}\z/
|
|
22
22
|
COMPACT = /\A[0-9a-z][0-9a-z]{4,63}\z/
|
|
23
|
+
PROTECTED_ATTEMPT = /\Alaunch-[0-9a-f]{24}\z/
|
|
23
24
|
DIGEST = /\A[0-9a-f]{64}\z/
|
|
24
25
|
KINDS = %w[text choice confirm review question decision verification otp proposal].freeze
|
|
25
26
|
MESSAGE_SCHEMA = "ace.hitl.hermes.message/v1"
|
|
@@ -39,7 +40,8 @@ module Ace
|
|
|
39
40
|
raise InvalidEnvelope, "unsupported managed envelope version" unless data["schema"] == SCHEMA
|
|
40
41
|
%w[request_id request_incarnation project requester correlation_id].each { |key| token!(data[key], key) }
|
|
41
42
|
%w[assignment_id attempt_id].each do |key|
|
|
42
|
-
raise InvalidEnvelope, "invalid #{key}" unless data[key].is_a?(String) &&
|
|
43
|
+
raise InvalidEnvelope, "invalid #{key}" unless data[key].is_a?(String) &&
|
|
44
|
+
(COMPACT.match?(data[key]) || (key == "attempt_id" && PROTECTED_ATTEMPT.match?(data[key])))
|
|
43
45
|
end
|
|
44
46
|
raise InvalidEnvelope, "unsupported managed request kind" unless KINDS.include?(data["kind"])
|
|
45
47
|
reverse!(data["reverse"])
|