Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sinatra 4.1 host Authorization #129

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/avro_deserializer_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "test_helper"
require "avro_turf/test/fake_confluent_schema_registry_server"
require_relative "support/authorized_fake_confluent_schema_registry_server"
require "webmock/minitest"
require "ostruct"

Expand All @@ -9,8 +9,8 @@ def setup
Streamy.configuration.avro_schema_registry_url = "http://registry.example.com"
Streamy.configuration.avro_schemas_path = "test/fixtures/schemas"
Serializers::AvroSerializer.clear_messaging_cache
FakeConfluentSchemaRegistryServer.clear
stub_request(:any, /^#{Streamy.configuration.avro_schema_registry_url}/).to_rack(FakeConfluentSchemaRegistryServer)
stub_request(:any, /^#{Streamy.configuration.avro_schema_registry_url}/).to_rack(AuthorizedFakeConfluentSchemaRegistryServer)
AuthorizedFakeConfluentSchemaRegistryServer.clear
end

class TestEvent < AvroEvent
Expand Down
6 changes: 3 additions & 3 deletions test/avro_event_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "test_helper"
require "avro_turf/test/fake_confluent_schema_registry_server"
require_relative "support/authorized_fake_confluent_schema_registry_server"
require "webmock/minitest"

module Streamy
Expand All @@ -8,8 +8,8 @@ def setup
Streamy.configuration.avro_schema_registry_url = "http://registry.example.com"
Streamy.configuration.avro_schemas_path = "test/fixtures/schemas"
Serializers::AvroSerializer.clear_messaging_cache
FakeConfluentSchemaRegistryServer.clear
stub_request(:any, /^#{Streamy.configuration.avro_schema_registry_url}/).to_rack(FakeConfluentSchemaRegistryServer)
stub_request(:any, /^#{Streamy.configuration.avro_schema_registry_url}/).to_rack(AuthorizedFakeConfluentSchemaRegistryServer)
AuthorizedFakeConfluentSchemaRegistryServer.clear
end

class TestEvent < AvroEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require "avro_turf/test/fake_confluent_schema_registry_server"

class AuthorizedFakeConfluentSchemaRegistryServer < FakeConfluentSchemaRegistryServer
set :host_authorization, permitted_hosts: ['example.org', 'registry.example.com']
end
Loading