cloud_events 0.6.0 → 0.7.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/CHANGELOG.md +6 -0
- data/lib/cloud_events/content_type.rb +1 -1
- data/lib/cloud_events/http_binding.rb +6 -0
- data/lib/cloud_events/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 036b0516dd1cbb3d6f2c4855809facc6edb4ac994b00355056182a704a072306
|
4
|
+
data.tar.gz: 4eccf559900a089b4a86ce269a30bd604dd4bcad3973ad5ffbe69735acb2a7e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0d255359ad545ec1f0898f437b2b220e72cc8766de1f59e0534c71c4863fd093b410e9350048506d8b99a22235d23aef9b9c4ca0fee757242229cdd283faaf2
|
7
|
+
data.tar.gz: 84a043396ad6cd11e6cd05fd7ce6bdd2993fcede29d2fc780c88419dc2bbd99d230c573b8c237f53940e033fe42449c0976e85c9842fef6dd829e798ecd4daa2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### v0.7.0 / 2022-01-14
|
4
|
+
|
5
|
+
* HttpBinding#probable_event? returns false if the request method is GET or HEAD.
|
6
|
+
* HttpBinding#decode_event raises NotCloudEventError if the request method is GET or HEAD.
|
7
|
+
* Fixed a NoMethodError if nil content was passed to the ContentType constructor.
|
8
|
+
|
3
9
|
### v0.6.0 / 2021-08-23
|
4
10
|
|
5
11
|
This update further clarifies and cleans up the encoding behavior of event payloads. In particular, the event object now includes explicitly encoded data in the new `data_encoded` field, and provides information on whether the existing `data` field contains an encoded or decoded form of the payload.
|
@@ -32,7 +32,7 @@ module CloudEvents
|
|
32
32
|
@params = []
|
33
33
|
@charset = default_charset || "us-ascii"
|
34
34
|
@error_message = nil
|
35
|
-
parse consume_comments string.strip
|
35
|
+
parse consume_comments @string.strip
|
36
36
|
@canonical_string = "#{@media_type}/#{@subtype}" +
|
37
37
|
@params.map { |k, v| "; #{k}=#{maybe_quote v}" }.join
|
38
38
|
full_freeze
|
@@ -20,6 +20,9 @@ module CloudEvents
|
|
20
20
|
#
|
21
21
|
JSON_FORMAT = "json"
|
22
22
|
|
23
|
+
# @private
|
24
|
+
ILLEGAL_METHODS = ["GET", "HEAD"].freeze
|
25
|
+
|
23
26
|
##
|
24
27
|
# Returns a default HTTP binding, including support for JSON format.
|
25
28
|
#
|
@@ -134,6 +137,7 @@ module CloudEvents
|
|
134
137
|
# @return [boolean] Whether the request is likely a CloudEvent.
|
135
138
|
#
|
136
139
|
def probable_event? env
|
140
|
+
return false if ILLEGAL_METHODS.include? env["REQUEST_METHOD"]
|
137
141
|
return true if env["HTTP_CE_SPECVERSION"]
|
138
142
|
content_type = ContentType.new env["CONTENT_TYPE"].to_s
|
139
143
|
content_type.media_type == "application" &&
|
@@ -163,6 +167,8 @@ module CloudEvents
|
|
163
167
|
# from the request.
|
164
168
|
#
|
165
169
|
def decode_event env, allow_opaque: false, **format_args
|
170
|
+
request_method = env["REQUEST_METHOD"]
|
171
|
+
raise NotCloudEventError, "Request method is #{request_method}" if ILLEGAL_METHODS.include? request_method
|
166
172
|
content_type_string = env["CONTENT_TYPE"]
|
167
173
|
content_type = ContentType.new content_type_string if content_type_string
|
168
174
|
content = read_with_charset env["rack.input"], content_type&.charset
|
data/lib/cloud_events/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The official Ruby implementation of the CloudEvents Specification. Provides
|
14
14
|
data types for events, and HTTP/JSON bindings for marshalling and unmarshalling
|
@@ -41,10 +41,10 @@ homepage: https://github.com/cloudevents/sdk-ruby
|
|
41
41
|
licenses:
|
42
42
|
- Apache-2.0
|
43
43
|
metadata:
|
44
|
-
changelog_uri: https://cloudevents.github.io/sdk-ruby/v0.
|
44
|
+
changelog_uri: https://cloudevents.github.io/sdk-ruby/v0.7.0/file.CHANGELOG.html
|
45
45
|
source_code_uri: https://github.com/cloudevents/sdk-ruby
|
46
46
|
bug_tracker_uri: https://github.com/cloudevents/sdk-ruby/issues
|
47
|
-
documentation_uri: https://cloudevents.github.io/sdk-ruby/v0.
|
47
|
+
documentation_uri: https://cloudevents.github.io/sdk-ruby/v0.7.0
|
48
48
|
post_install_message:
|
49
49
|
rdoc_options: []
|
50
50
|
require_paths:
|