omniauth-webflow 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdeb0c0b2d3116f3845630ec72d36f3a2bd2b3c33a612772dd64a8b63f693d32
4
- data.tar.gz: ba32be657fe24a8a1b7f0ccd9069f34d2794e68b7ca6046c7fe31ddbc779f7ce
3
+ metadata.gz: a64baaf2173308ad1706605ad3dfb4147ce16d07201517574aba75b1204f0510
4
+ data.tar.gz: 2fc84632f006e91cd8c35130c4d54cff3330875ef219288754da2a6de9150c7c
5
5
  SHA512:
6
- metadata.gz: ab958103ab845e0f37fa8ca049be7a0e352f5770129bb1d8b73b3cc3df08191fc3e7af01672d1bb66cf692eed12c44a07b0ded78be02393fab1f264c13a7da40
7
- data.tar.gz: 65294855f9c5ee1b2376e9df6eb84158ba28b8c5f3e1722a7d8ab78c15b1b33b67be4def9b95771a515e294a8cdd8184f55c3c667bd021da7841bb90ffb91b30
6
+ metadata.gz: 8e3fd536754d099a2f669c29ee3efb382a7877540f87bbede0592245c84cae27bfc1472fb142e9e547b066fe964de19528f9308ce667f933d6b35b3347c72665
7
+ data.tar.gz: 593876f74cd6e103662fdfc31cc1642cc68c1dcd47f30bce176337c9cacda13ef058fd9192b07fe4d4e1982642943f3c0480021d49546731db8b6c051ae0bc01
data/Gemfile.lock CHANGED
@@ -1,53 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-webflow (0.1.1)
4
+ omniauth-webflow (1.0.0)
5
5
  multi_json (~> 1.15)
6
6
  omniauth-oauth2 (~> 1.7)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
+ base64 (0.2.0)
11
12
  diff-lcs (1.3)
12
- faraday (1.8.0)
13
- faraday-em_http (~> 1.0)
14
- faraday-em_synchrony (~> 1.0)
15
- faraday-excon (~> 1.1)
16
- faraday-httpclient (~> 1.0.1)
17
- faraday-net_http (~> 1.0)
18
- faraday-net_http_persistent (~> 1.1)
19
- faraday-patron (~> 1.0)
20
- faraday-rack (~> 1.0)
21
- multipart-post (>= 1.2, < 3)
13
+ faraday (2.8.1)
14
+ base64
15
+ faraday-net_http (>= 2.0, < 3.1)
22
16
  ruby2_keywords (>= 0.0.4)
23
- faraday-em_http (1.0.0)
24
- faraday-em_synchrony (1.0.0)
25
- faraday-excon (1.1.0)
26
- faraday-httpclient (1.0.1)
27
- faraday-net_http (1.0.1)
28
- faraday-net_http_persistent (1.2.0)
29
- faraday-patron (1.0.0)
30
- faraday-rack (1.0.0)
17
+ faraday-net_http (3.0.2)
31
18
  hashie (5.0.0)
32
- jwt (2.3.0)
19
+ jwt (2.9.3)
20
+ base64
33
21
  multi_json (1.15.0)
34
22
  multi_xml (0.6.0)
35
- multipart-post (2.1.1)
36
- oauth2 (1.4.7)
37
- faraday (>= 0.8, < 2.0)
23
+ oauth2 (2.0.9)
24
+ faraday (>= 0.17.3, < 3.0)
38
25
  jwt (>= 1.0, < 3.0)
39
- multi_json (~> 1.3)
40
26
  multi_xml (~> 0.5)
41
- rack (>= 1.2, < 3)
42
- omniauth (2.0.4)
27
+ rack (>= 1.2, < 4)
28
+ snaky_hash (~> 2.0)
29
+ version_gem (~> 1.1)
30
+ omniauth (2.1.2)
43
31
  hashie (>= 3.4.6)
44
- rack (>= 1.6.2, < 3)
32
+ rack (>= 2.2.3)
45
33
  rack-protection
46
- omniauth-oauth2 (1.7.2)
47
- oauth2 (~> 1.4)
48
- omniauth (>= 1.9, < 3)
49
- rack (2.2.3)
50
- rack-protection (2.1.0)
34
+ omniauth-oauth2 (1.8.0)
35
+ oauth2 (>= 1.4, < 3)
36
+ omniauth (~> 2.0)
37
+ rack (3.1.8)
38
+ rack-protection (3.0.6)
51
39
  rack
52
40
  rake (12.3.3)
53
41
  rspec (3.9.0)
@@ -64,6 +52,10 @@ GEM
64
52
  rspec-support (~> 3.9.0)
65
53
  rspec-support (3.9.3)
66
54
  ruby2_keywords (0.0.5)
55
+ snaky_hash (2.0.1)
56
+ hashie
57
+ version_gem (~> 1.1, >= 1.1.1)
58
+ version_gem (1.1.4)
67
59
 
68
60
  PLATFORMS
69
61
  ruby
@@ -74,4 +66,4 @@ DEPENDENCIES
74
66
  rspec (~> 3.0)
75
67
 
76
68
  BUNDLED WITH
77
- 2.1.2
69
+ 2.2.27
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # omniauth-webflow
2
2
 
3
- This gem is an [OmniAuth 1.0](https://github.com/omniauth/omniauth) Strategy for authenticating with the [Webflow API](https://developers.webflow.com/) (version 1.0.0)
3
+ This gem is an [OmniAuth](https://github.com/omniauth/omniauth) Strategy for authenticating with the [Webflow API](https://developers.webflow.com/v2.0.0) (Data API version 2.0.0)
4
4
 
5
5
  ## Setup
6
6
 
@@ -17,7 +17,7 @@ After registering a new application with Webflow take note of the `client_id` an
17
17
  Add this line to your application's Gemfile:
18
18
 
19
19
  ```ruby
20
- gem 'omniauth-webflow'
20
+ gem 'omniauth-webflow' ~> 1.0.0
21
21
  ```
22
22
 
23
23
  And then execute:
@@ -28,9 +28,11 @@ In your Rails app, add the Webflow provider to your Omniauth middleware, e.g. in
28
28
 
29
29
  ```ruby
30
30
  Rails.application.config.middleware.use OmniAuth::Builder do
31
- provider :webflow, ENV['WEBFLOW_CLIENT_ID'], ENV['WEBFLOW_CLIENT_SECRET']
31
+ provider :webflow, ENV['WEBFLOW_CLIENT_ID'], ENV['WEBFLOW_CLIENT_SECRET'],
32
+ scope: 'authorized_user:read sites:read' # this is an example scope
32
33
  end
33
34
  ```
35
+ Specify [scopes](https://docs.developers.webflow.com/reference/scopes) as required.
34
36
 
35
37
  ## Contributing
36
38
 
@@ -1,28 +1,23 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'omniauth-oauth2'
2
4
 
3
5
  module OmniAuth
4
6
  module Strategies
5
7
  class Webflow < OmniAuth::Strategies::OAuth2
6
- API_VERSION = "1.0.0"
7
-
8
- option :name, "webflow"
8
+ option :name, 'webflow'
9
9
  option :client_options, {
10
- site: "https://api.webflow.com",
10
+ site: 'https://api.webflow.com',
11
11
  authorize_url: 'https://webflow.com/oauth/authorize',
12
12
  token_url: 'https://api.webflow.com/oauth/access_token'
13
13
  }
14
- # option :token_params, { parse: :json }
15
- # option :auth_token_params, { mode: :query, param_name: :token }
16
14
 
17
- uid { raw_info['_id'] }
15
+ uid { raw_info['authorization']['id'] }
18
16
 
19
17
  info do
20
18
  {
21
- id: raw_info["_id"],
22
- grant_type: raw_info["grantType"],
23
- users: raw_info["users"],
24
- orgs: raw_info["orgs"],
25
- sites: raw_info["sites"],
19
+ id: raw_info['authorization']['id'],
20
+ grant_type: raw_info['authorization']['grantType']
26
21
  }
27
22
  end
28
23
 
@@ -33,17 +28,14 @@ module OmniAuth
33
28
  end
34
29
 
35
30
  def raw_info
36
- @raw_info ||= access_token.get("https://api.webflow.com/info?api_version=#{API_VERSION}").parsed
31
+ @raw_info ||= access_token.get('https://api.webflow.com/v2/token/introspect').parsed
37
32
  end
38
33
 
39
- protected
40
-
41
- # had to override this method as it was merging the redirect_uri into the params which was breaking the Webflow /access_token request
42
- def build_access_token
43
- verifier = request.params["code"]
44
- client.auth_code.get_token(verifier, token_params.to_hash(:symbolize_keys => true), deep_symbolize(options.auth_token_params))
34
+ # The Webflow API requires the redirect_uri to match exactly what you have in your Webflow Application settings
35
+ # This method ensures any query params are removed before the build_access_token step occurs
36
+ def callback_url
37
+ full_host + callback_path
45
38
  end
46
-
47
39
  end
48
40
  end
49
- end
41
+ end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Webflow
3
- VERSION = '0.1.1'.freeze
3
+ VERSION = '1.0.0'.freeze
4
4
  end
5
5
  end
@@ -27,9 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ['lib']
29
29
 
30
- # spec.add_runtime_dependency 'omniauth-oauth2'
31
- # spec.add_runtime_dependency 'multi_json'
32
-
33
30
  spec.add_dependency 'omniauth-oauth2', '~> 1.7'
34
31
  spec.add_dependency 'multi_json', '~> 1.15'
35
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-webflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-15 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2