avro_turf 1.12.0 → 1.13.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: 94e8abd646816e6e375365c50ed19eebb3bfd4722548aba30fca974740fd7788
4
- data.tar.gz: 18bba7e20c8ac10b52177af05db7b4ea6b461f696f4230c7086d1b5e3a7479df
3
+ metadata.gz: 72327ac5cc542eaaf881cd7ab9fc6ad3189f488abdcd6119a39b7e51c9545e6e
4
+ data.tar.gz: e5af812736913725238ac20778151c706776cc619625e60ec6448460289827c8
5
5
  SHA512:
6
- metadata.gz: 8b2b977f70cdc2c497a2cf1449d9f84bf11a6d7ce62022fd9295a58ea1133fe10674431dbf765d8676ba404e54c73f5bc35016868fd6e3ce2cbef4ea5027de07
7
- data.tar.gz: a3ad6d0518e93b12a5371ac338bcb99e7f7acd22728d2527c16a57888e8fe39567d1c8bc57060451cf2b536c653e8cb470809e76381e2ec07a0c3b8cbaefe734
6
+ metadata.gz: 404704ea23a71ccbfd34354904c3a45ef52abf6c6d75c67570355e67a83b33a3f1b694baf6134e5d539c062aebd7509ee65da5ca8a9684f973d749860288f66b
7
+ data.tar.gz: bd5ffed0531358a52c355d73994ab6daec49f8da69b96f914d0f75dfcf8f049a84c02d8ac6f3b25cabe416640cfb82130c97ebfa6253c2321cefdafca44b1a32
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.13.0
6
+
7
+ - Set `idempotent: true` for the request except one that registers a new schema (#199)
8
+ - Use `connect_timeout` for `Excon`'s `dns_timeouts` that set the timeout for the connection to the Domain Name Server (#201)
9
+
5
10
  ## v1.12.0
6
11
 
7
12
  - Add `connect_timeout` parameter to `AvroTurf::Messaging` to set the timeout for the connection to the schema registry (#197)
data/avro_turf.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency "avro", ">= 1.8.0", "< 1.12"
23
- spec.add_dependency "excon", "~> 0.71"
23
+ spec.add_dependency "excon", "~> 0.103"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 2.0"
26
26
  spec.add_development_dependency "rake", "~> 13.0"
@@ -35,13 +35,14 @@ class AvroTurf::ConfluentSchemaRegistry
35
35
  client_key_pass: client_key_pass,
36
36
  client_cert_data: client_cert_data,
37
37
  client_key_data: client_key_data,
38
- connect_timeout: connect_timeout
38
+ connect_timeout: connect_timeout,
39
+ dns_timeouts: connect_timeout
39
40
  )
40
41
  end
41
42
 
42
43
  def fetch(id)
43
44
  @logger.info "Fetching schema with id #{id}"
44
- data = get("/schemas/ids/#{id}")
45
+ data = get("/schemas/ids/#{id}", idempotent: true)
45
46
  data.fetch("schema")
46
47
  end
47
48
 
@@ -57,29 +58,30 @@ class AvroTurf::ConfluentSchemaRegistry
57
58
 
58
59
  # List all subjects
59
60
  def subjects
60
- get('/subjects')
61
+ get('/subjects', idempotent: true)
61
62
  end
62
63
 
63
64
  # List all versions for a subject
64
65
  def subject_versions(subject)
65
- get("/subjects/#{subject}/versions")
66
+ get("/subjects/#{subject}/versions", idempotent: true)
66
67
  end
67
68
 
68
69
  # Get a specific version for a subject
69
70
  def subject_version(subject, version = 'latest')
70
- get("/subjects/#{subject}/versions/#{version}")
71
+ get("/subjects/#{subject}/versions/#{version}", idempotent: true)
71
72
  end
72
73
 
73
74
  # Get the subject and version for a schema id
74
75
  def schema_subject_versions(schema_id)
75
- get("/schemas/ids/#{schema_id}/versions")
76
+ get("/schemas/ids/#{schema_id}/versions", idempotent: true)
76
77
  end
77
78
 
78
79
  # Check if a schema exists. Returns nil if not found.
79
80
  def check(subject, schema)
80
81
  data = post("/subjects/#{subject}",
81
82
  expects: [200, 404],
82
- body: { schema: schema.to_s }.to_json)
83
+ body: { schema: schema.to_s }.to_json,
84
+ idempotent: true)
83
85
  data unless data.has_key?("error_code")
84
86
  end
85
87
 
@@ -91,28 +93,28 @@ class AvroTurf::ConfluentSchemaRegistry
91
93
  # http://docs.confluent.io/3.1.2/schema-registry/docs/api.html#compatibility
92
94
  def compatible?(subject, schema, version = 'latest')
93
95
  data = post("/compatibility/subjects/#{subject}/versions/#{version}",
94
- expects: [200, 404], body: { schema: schema.to_s }.to_json)
96
+ expects: [200, 404], body: { schema: schema.to_s }.to_json, idempotent: true)
95
97
  data.fetch('is_compatible', false) unless data.has_key?('error_code')
96
98
  end
97
99
 
98
100
  # Get global config
99
101
  def global_config
100
- get("/config")
102
+ get("/config", idempotent: true)
101
103
  end
102
104
 
103
105
  # Update global config
104
106
  def update_global_config(config)
105
- put("/config", body: config.to_json)
107
+ put("/config", body: config.to_json, idempotent: true)
106
108
  end
107
109
 
108
110
  # Get config for subject
109
111
  def subject_config(subject)
110
- get("/config/#{subject}")
112
+ get("/config/#{subject}", idempotent: true)
111
113
  end
112
114
 
113
115
  # Update config for subject
114
116
  def update_subject_config(subject, config)
115
- put("/config/#{subject}", body: config.to_json)
117
+ put("/config/#{subject}", body: config.to_json, idempotent: true)
116
118
  end
117
119
 
118
120
  private
@@ -55,7 +55,7 @@ class AvroTurf
55
55
  # client_key_pass - Password to go with client_key (optional).
56
56
  # client_cert_data - In-memory client certificate (optional).
57
57
  # client_key_data - In-memory client private key to go with client_cert_data (optional).
58
- # connect_timeout - Timeout to use in the connection with the schema registry (optional).
58
+ # connect_timeout - Timeout to use in the connection with the domain name server and the schema registry (optional).
59
59
  def initialize(
60
60
  registry: nil,
61
61
  registry_url: nil,
@@ -1,3 +1,3 @@
1
1
  class AvroTurf
2
- VERSION = "1.12.0"
2
+ VERSION = "1.13.0"
3
3
  end
@@ -444,7 +444,7 @@ describe AvroTurf::Messaging do
444
444
  it_behaves_like 'encoding and decoding with the schema_id from registry'
445
445
 
446
446
  it 'passes the connect timeout setting to Excon' do
447
- expect(Excon).to receive(:new).with(anything, hash_including(connect_timeout: 10)).and_call_original
447
+ expect(Excon).to receive(:new).with(anything, hash_including(connect_timeout: 10, dns_timeouts: 10)).and_call_original
448
448
  avro
449
449
  end
450
450
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avro_turf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2023-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.71'
39
+ version: '0.103'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.71'
46
+ version: '0.103'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement