bookingsync-engine 6.0.1 → 6.1.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: e0385a6488ced00cb5b4ccdfc0dd1e7e68fcd6a099ec0c32d0a3324866cf064e
4
- data.tar.gz: 80bf1d59e2a5afe618d7f7730fb7d2d52029715c2f32518bfb60296b08564dc5
3
+ metadata.gz: 6ac89ba5e094ffb7d546f1629805a2075c8f11ea95d5b8f3abe978833d526699
4
+ data.tar.gz: aa26d78da10aa51bc3327b5890e4151a9bea644c8d66feadcf352632ea377adf
5
5
  SHA512:
6
- metadata.gz: 762fe0e7cae097ca2c6fc40f1628a7a90b1a16b5be4624caeb423beb20960a6556e3d4f89ca390c6d63fd70057bd57d381a908ba010c0d58a036e3367016367f
7
- data.tar.gz: 442b40eaad8e2c4db85f9bec81b9dc8897874eeea63c8af562b614878a9e8fd13f860548f7f641b7cafab5b6d29417f3827132c59e87ad0b911971bc4c210b6c
6
+ metadata.gz: 376c432508676e1cf375ea83444ea7123c6d5ab370c48a32b0b59f442abb0fc99f51c0b1d2e12368c12a7bc93eb3a5f530d29094e62767bd810c8e45db3495e8
7
+ data.tar.gz: 53980a3a000185fd1bf2c840404e4985c8590183f852247a4eca25c00e45eb131f2f9b223eefb3b9e64a6753bdbf8c2008c6475736a429c81fecf598e1379e3d
@@ -1,3 +1,3 @@
1
1
  module BookingSync
2
- ENGINE_VERSION = "6.0.1"
2
+ ENGINE_VERSION = "6.1.0"
3
3
  end
@@ -83,7 +83,8 @@ module BookingSync
83
83
 
84
84
  client_options = {
85
85
  site: ENV["BOOKINGSYNC_URL"] || 'https://www.bookingsync.com',
86
- connection_opts: connection_options
86
+ connection_opts: connection_options,
87
+ auth_scheme: ::BookingSyncEngine.oauth_client_auth_scheme
87
88
  }
88
89
  client_options[:ssl] = { verify: ENV['BOOKINGSYNC_VERIFY_SSL'] != 'false' }
89
90
  OAuth2::Client.new(client_id, client_secret, client_options)
@@ -11,6 +11,9 @@ module BookingSyncEngine
11
11
  cattr_accessor :oauth_client_connection_options
12
12
  self.oauth_client_connection_options = { request: { timeout: 2 } }
13
13
 
14
+ cattr_accessor :oauth_client_auth_scheme
15
+ self.oauth_client_auth_scheme = :request_body
16
+
14
17
  cattr_accessor :token_refresh_timeout_retry_count
15
18
  self.token_refresh_timeout_retry_count = 2
16
19
 
@@ -12,8 +12,8 @@ RSpec.describe AuthenticatedController, type: :controller do
12
12
  it "renders autosubmitted form" do
13
13
  get :index
14
14
  expect(response.status).to eq(200)
15
- expect(response.body).to include("action='/auth/bookingsync' method='post'")
16
- expect(response.body).to include("<input type='hidden' name='account_id' value=''>")
15
+ expect(response.body).to include("action=\"/auth/bookingsync\" method=\"post\"")
16
+ expect(response.body).to include("<input type=\"hidden\" name=\"account_id\" value=\"\">")
17
17
  expect(response.header["Content-Type"]).to include("text/html")
18
18
  end
19
19
  end
@@ -24,8 +24,8 @@ RSpec.describe AuthenticatedController, type: :controller do
24
24
  it "renders autosubmitted form" do
25
25
  get :index
26
26
  expect(response.status).to eq(200)
27
- expect(response.body).to include("action='/auth/bookingsync' method='post'")
28
- expect(response.body).to include("<input type='hidden' name='account_id' value=''>")
27
+ expect(response.body).to include("action=\"/auth/bookingsync\" method=\"post\"")
28
+ expect(response.body).to include("<input type=\"hidden\" name=\"account_id\" value=\"\">")
29
29
  end
30
30
  end
31
31
  end
@@ -37,8 +37,8 @@ RSpec.describe AuthenticatedController, type: :controller do
37
37
  it "renders autosubmitted form" do
38
38
  get :index, xhr: true
39
39
  expect(response.status).to eq(401)
40
- expect(response.body).to include("action='/auth/bookingsync' method='post'")
41
- expect(response.body).to include("<input type='hidden' name='account_id' value=''>")
40
+ expect(response.body).to include("action=\"/auth/bookingsync\" method=\"post\"")
41
+ expect(response.body).to include("<input type=\"hidden\" name=\"account_id\" value=\"\">")
42
42
  end
43
43
  end
44
44
 
@@ -48,8 +48,8 @@ RSpec.describe AuthenticatedController, type: :controller do
48
48
  it "renders autosubmitted form" do
49
49
  get :index, xhr: true
50
50
  expect(response.status).to eq(401)
51
- expect(response.body).to include("action='/auth/bookingsync' method='post'")
52
- expect(response.body).to include("<input type='hidden' name='account_id' value=''>")
51
+ expect(response.body).to include("action=\"/auth/bookingsync\" method=\"post\"")
52
+ expect(response.body).to include("<input type=\"hidden\" name=\"account_id\" value=\"\">")
53
53
  end
54
54
  end
55
55
  end
@@ -1,6 +1,16 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require 'rails/all'
3
+ require "rails"
4
+ require "active_model/railtie"
5
+ require "active_record/railtie"
6
+ require "action_controller/railtie"
7
+ require "action_mailer/railtie"
8
+ require "action_view/railtie"
9
+ # require "active_storage/engine"
10
+ # require "action_mailbox/engine"
11
+ # require "action_text/engine"
12
+ # require "action_cable/engine"
13
+ require "rails/test_unit/railtie"
4
14
 
5
15
  Bundler.require(*Rails.groups)
6
16
  require "bookingsync"
@@ -1,5 +1,5 @@
1
1
  # Set up gems listed in the Gemfile.
2
2
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
3
 
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
5
  $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -9,3 +9,4 @@ test:
9
9
  encoding: unicode
10
10
  database: bookingsync_engine_test
11
11
  pool: 5
12
+ url: <%= ENV['DATABASE_URL'] %>
@@ -1,16 +1,18 @@
1
1
  Dummy::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
4
+ # In the development environment your application's code is reloaded any time
5
+ # it changes. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
7
+ config.enable_reloading = true
8
8
 
9
9
  # Do not eager load code on boot.
10
10
  config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Disable caching.
14
16
  config.action_controller.perform_caching = false
15
17
 
16
18
  # Don't care if the mailer can't send.
@@ -19,11 +21,6 @@ Dummy::Application.configure do
19
21
  # Print deprecation notices to the Rails logger.
20
22
  config.active_support.deprecation = :log
21
23
 
22
- # Raise an error on page load if there are pending migrations
24
+ # Raise an error on page load if there are pending migrations.
23
25
  config.active_record.migration_error = :page_load
24
-
25
- # Debug mode disables concatenation and preprocessing of assets.
26
- # This option may cause significant delays in view rendering with a large
27
- # number of complex assets.
28
- config.assets.debug = true
29
- end
26
+ end
@@ -5,23 +5,22 @@ Dummy::Application.configure do
5
5
  # test suite. You never need to work with it otherwise. Remember that
6
6
  # your test database is "scratch space" for the test suite and is wiped
7
7
  # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
8
+ config.enable_reloading = false
9
9
 
10
- # Do not eager load code on boot. This avoids loading your whole application
11
- # just for the purpose of running a single test. If you are using a tool that
12
- # preloads Rails for running tests, you may have to set it to true.
13
- config.eager_load = false
10
+ # Eager loading loads your whole application. When running a single test locally,
11
+ # this probably isn't necessary. It's a good idea to do in a CI environment.
12
+ config.eager_load = ENV["CI"].present?
14
13
 
15
- # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_files = true
17
- config.static_cache_control = "public, max-age=3600"
14
+ # Configure public file server for tests with Cache-Control for performance.
15
+ config.public_file_server.enabled = true
16
+ config.public_file_server.headers = { "Cache-Control" => "public, max-age=3600" }
18
17
 
19
18
  # Show full error reports and disable caching.
20
- config.consider_all_requests_local = true
19
+ config.consider_all_requests_local = true
21
20
  config.action_controller.perform_caching = false
22
21
 
23
22
  # Raise exceptions instead of rendering exception templates.
24
- config.action_dispatch.show_exceptions = false
23
+ config.action_dispatch.show_exceptions = :none
25
24
 
26
25
  # Disable request forgery protection in test environment.
27
26
  config.action_controller.allow_forgery_protection = false
@@ -33,4 +32,4 @@ Dummy::Application.configure do
33
32
 
34
33
  # Print deprecation notices to the stderr.
35
34
  config.active_support.deprecation = :stderr
36
- end
35
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookingsync-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastien Grosjean
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-16 00:00:00.000000000 Z
12
+ date: 2026-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -286,8 +286,6 @@ files:
286
286
  - spec/dummy/db/migrate/20190623220013_add_custom_booking_sync_key_id_to_accounts.rb
287
287
  - spec/dummy/db/migrate/20190623220132_add_custom_booking_sync_key_id_to_multi_applications_accounts.rb
288
288
  - spec/dummy/db/schema.rb
289
- - spec/dummy/log/development.log
290
- - spec/dummy/log/test.log
291
289
  - spec/dummy/public/404.html
292
290
  - spec/dummy/public/422.html
293
291
  - spec/dummy/public/500.html
@@ -322,73 +320,71 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
320
  - !ruby/object:Gem::Version
323
321
  version: '0'
324
322
  requirements: []
325
- rubygems_version: 3.0.1
323
+ rubygems_version: 3.5.22
326
324
  signing_key:
327
325
  specification_version: 4
328
326
  summary: A Rails engine to simplify integration with BookingSync API
329
327
  test_files:
330
- - spec/spec_helper.rb
331
- - spec/dummy/app/models/account.rb
332
- - spec/dummy/app/models/application.rb
333
- - spec/dummy/app/models/multi_applications_account.rb
334
- - spec/dummy/app/models/application_record.rb
335
- - spec/dummy/app/controllers/application_controller.rb
336
- - spec/dummy/app/controllers/authenticated_controller.rb
337
- - spec/dummy/app/controllers/home_controller.rb
338
- - spec/dummy/app/views/layouts/application.html.erb
328
+ - spec/controllers/authenticated_controller_spec.rb
329
+ - spec/controllers/sessions_controller_spec.rb
330
+ - spec/dummy/README.rdoc
331
+ - spec/dummy/Rakefile
339
332
  - spec/dummy/app/assets/config/manifest.js
340
333
  - spec/dummy/app/assets/javascripts/application.js
341
334
  - spec/dummy/app/assets/stylesheets/application.css
335
+ - spec/dummy/app/controllers/application_controller.rb
336
+ - spec/dummy/app/controllers/authenticated_controller.rb
337
+ - spec/dummy/app/controllers/home_controller.rb
342
338
  - spec/dummy/app/helpers/application_helper.rb
343
- - spec/dummy/bin/rake
339
+ - spec/dummy/app/models/account.rb
340
+ - spec/dummy/app/models/application.rb
341
+ - spec/dummy/app/models/application_record.rb
342
+ - spec/dummy/app/models/multi_applications_account.rb
343
+ - spec/dummy/app/views/layouts/application.html.erb
344
344
  - spec/dummy/bin/bundle
345
345
  - spec/dummy/bin/rails
346
- - spec/dummy/config/routes.rb
347
- - spec/dummy/config/locales/en.yml
348
- - spec/dummy/config/database.yml.travis
349
- - spec/dummy/config/environments/production.rb
350
- - spec/dummy/config/environments/development.rb
351
- - spec/dummy/config/environments/test.rb
352
- - spec/dummy/config/environment.rb
346
+ - spec/dummy/bin/rake
353
347
  - spec/dummy/config/application.rb
354
- - spec/dummy/config/database.yml
355
348
  - spec/dummy/config/boot.rb
349
+ - spec/dummy/config/database.yml
356
350
  - spec/dummy/config/database.yml.docker
351
+ - spec/dummy/config/database.yml.travis
352
+ - spec/dummy/config/environment.rb
353
+ - spec/dummy/config/environments/development.rb
354
+ - spec/dummy/config/environments/production.rb
355
+ - spec/dummy/config/environments/test.rb
357
356
  - spec/dummy/config/initializers/backtrace_silencers.rb
358
357
  - spec/dummy/config/initializers/bookingsync-engine.rb
359
- - spec/dummy/config/initializers/mime_types.rb
360
358
  - spec/dummy/config/initializers/filter_parameter_logging.rb
359
+ - spec/dummy/config/initializers/inflections.rb
360
+ - spec/dummy/config/initializers/mime_types.rb
361
+ - spec/dummy/config/initializers/secret_token.rb
361
362
  - spec/dummy/config/initializers/session_store.rb
362
363
  - spec/dummy/config/initializers/wrap_parameters.rb
363
- - spec/dummy/config/initializers/secret_token.rb
364
- - spec/dummy/config/initializers/inflections.rb
364
+ - spec/dummy/config/locales/en.yml
365
+ - spec/dummy/config/routes.rb
365
366
  - spec/dummy/config.ru
366
- - spec/dummy/Rakefile
367
- - spec/dummy/public/favicon.ico
368
- - spec/dummy/public/422.html
369
- - spec/dummy/public/500.html
370
- - spec/dummy/public/404.html
371
- - spec/dummy/db/schema.rb
367
+ - spec/dummy/db/migrate/20140522110326_create_accounts.rb
372
368
  - spec/dummy/db/migrate/20140522110454_add_o_auth_fields_to_accounts.rb
369
+ - spec/dummy/db/migrate/20181130062531_create_multi_applications_accounts.rb
373
370
  - spec/dummy/db/migrate/20181130062650_add_o_auth_fields_to_multi_applications_accounts.rb
374
371
  - spec/dummy/db/migrate/20181130063056_create_applications.rb
375
372
  - spec/dummy/db/migrate/20181130063104_add_credentials_fields_to_applications.rb
376
373
  - spec/dummy/db/migrate/20190623220013_add_custom_booking_sync_key_id_to_accounts.rb
377
374
  - spec/dummy/db/migrate/20190623220132_add_custom_booking_sync_key_id_to_multi_applications_accounts.rb
378
- - spec/dummy/db/migrate/20140522110326_create_accounts.rb
379
- - spec/dummy/db/migrate/20181130062531_create_multi_applications_accounts.rb
380
- - spec/dummy/log/test.log
381
- - spec/dummy/log/development.log
382
- - spec/dummy/README.rdoc
383
- - spec/models/account_spec.rb
384
- - spec/models/multi_application_account_spec.rb
385
- - spec/models/application_spec.rb
386
- - spec/support/omniauth.rb
387
- - spec/lib/bookingsync/engine/credentials_resolver_spec.rb
375
+ - spec/dummy/db/schema.rb
376
+ - spec/dummy/public/404.html
377
+ - spec/dummy/public/422.html
378
+ - spec/dummy/public/500.html
379
+ - spec/dummy/public/favicon.ico
380
+ - spec/fixtures/accounts.yml
381
+ - spec/helpers/auth_helpers_spec.rb
388
382
  - spec/lib/bookingsync/engine/application_credentials_spec.rb
383
+ - spec/lib/bookingsync/engine/credentials_resolver_spec.rb
389
384
  - spec/lib/bookingsync/engine/retryable_spec.rb
390
- - spec/fixtures/accounts.yml
385
+ - spec/models/account_spec.rb
386
+ - spec/models/application_spec.rb
387
+ - spec/models/multi_application_account_spec.rb
391
388
  - spec/routing/oauth_routing_spec.rb
392
- - spec/controllers/authenticated_controller_spec.rb
393
- - spec/controllers/sessions_controller_spec.rb
394
- - spec/helpers/auth_helpers_spec.rb
389
+ - spec/spec_helper.rb
390
+ - spec/support/omniauth.rb
@@ -1,2 +0,0 @@
1
-  (550.3ms) CREATE DATABASE "bookingsync_engine_development" ENCODING = 'unicode'
2
-  (356.4ms) CREATE DATABASE "bookingsync_engine_test" ENCODING = 'unicode'