Skip to content

Commit

Permalink
Merge pull request #103 from cronofy/oauth2-v2
Browse files Browse the repository at this point in the history
Update Oauth2 dependency to v2
  • Loading branch information
AdamWhittingham authored May 19, 2023
2 parents 64abaf6 + 92e5152 commit 285dec5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.40.0]

* Update version of [OAuth2](https://rubygems.org/gems/oauth2) required [#102]

## [0.39.0]

* Add conferencing services authorization
Expand Down Expand Up @@ -222,6 +226,7 @@
[0.37.7]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.37.7
[0.38.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/0.38.0
[0.39.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/0.39.0
[0.40.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.40.0

[#13]: https://github.com/cronofy/cronofy-ruby/pull/13
[#16]: https://github.com/cronofy/cronofy-ruby/pull/16
Expand Down Expand Up @@ -270,5 +275,6 @@
[#97]: https://github.com/cronofy/cronofy-ruby/pull/97
[#99]: https://github.com/cronofy/cronofy-ruby/pull/99
[#100]: https://github.com/cronofy/cronofy-ruby/pull/100
[#102]: https://github.com/cronofy/cronofy-ruby/pull/102
[#104]: https://github.com/cronofy/cronofy-ruby/pull/104
[#108]: https://github.com/cronofy/cronofy-ruby/pull/108
2 changes: 1 addition & 1 deletion cronofy.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
spec.test_files = Dir['spec/**/*.rb']

spec.add_runtime_dependency "hashie", ">= 2.1", "< 5"
spec.add_runtime_dependency "oauth2", "~> 1.0"
spec.add_runtime_dependency "oauth2", ">= 2.0.4"

spec.add_development_dependency "bundler", ">= 1.6", "< 3"
spec.add_development_dependency "rake", "~> 10.0"
Expand Down
1 change: 1 addition & 0 deletions lib/cronofy/api_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def initialize(client, client_secret)
# @see Client#request
def request(verb, path, opts = {}, &block)
configure_authentication!(opts)
opts = { snaky: false }.merge(opts)
do_request { @client.request(verb, path, opts, &block) }
end

Expand Down
4 changes: 2 additions & 2 deletions lib/cronofy/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def initialize(options = {})

@client_credentials_missing = blank?(client_id) || blank?(client_secret)

@auth_client = OAuth2::Client.new(client_id, client_secret, site: ::Cronofy.app_url(data_center), connection_opts: { headers: { "User-Agent" => "Cronofy Ruby #{::Cronofy::VERSION}" } })
@api_client = OAuth2::Client.new(client_id, client_secret, site: ::Cronofy.api_url(data_center), connection_opts: { headers: { "User-Agent" => "Cronofy Ruby #{::Cronofy::VERSION}" } })
@auth_client = OAuth2::Client.new(client_id, client_secret, site: ::Cronofy.app_url(data_center), auth_scheme: :request_body, connection_opts: { headers: { "User-Agent" => "Cronofy Ruby #{::Cronofy::VERSION}" } })
@api_client = OAuth2::Client.new(client_id, client_secret, site: ::Cronofy.api_url(data_center), auth_scheme: :request_body, connection_opts: { headers: { "User-Agent" => "Cronofy Ruby #{::Cronofy::VERSION}" } })

set_access_token(access_token, refresh_token) if access_token || refresh_token
set_api_key(client_secret) if client_secret
Expand Down
2 changes: 1 addition & 1 deletion lib/cronofy/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Cronofy
VERSION = "0.37.7".freeze
VERSION = "0.40.0".freeze
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
require 'cronofy'

require 'webmock/rspec'
require 'securerandom'

0 comments on commit 285dec5

Please sign in to comment.