omniauth-figma-oauth2 1.0.1 → 1.0.2

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: 419b324efa0b450d75ecb6d80132ebb69da94603be509985821bef098e49a8f3
4
- data.tar.gz: 0ed78e72c4489f25d08cd004ab80adc6866d45cb7f4175c990d307746c8dd28f
3
+ metadata.gz: 16fb6386fc0f3e4f9eaca669f3c18130d97d804f9a4ac7c512a6cb61a2c1e683
4
+ data.tar.gz: 12b5f692b02be2a55255b2b418a5975e0d03989b2e05e14c440321eab741c4c2
5
5
  SHA512:
6
- metadata.gz: 2b90de45eebe675cf86e0b90c0bcaa494b9688cf2f8490fe4ca638b3265bea243baadbf56665a106d81b39d8d3288f7dabcd23c90e76e8f2650cbb07e365769e
7
- data.tar.gz: 59062fbaa6bc01fd6b15b6fb12cda17b52af32e146bf5c2228c12690fcf55fa6a1462b6e1e84b579aecae104072af656efb82359971ea83ac22d03b7852de2f5
6
+ metadata.gz: 64a1430e519d4b6015669be03a3ed65ca98ec30a5875e089cb414316c801eec93ee5ce39d63a062f8bbf7d172003d44bdde3565dd2ccf00c9a93630240cb882d
7
+ data.tar.gz: 4308c2396438c3e34f0c714bdc8fed288ae5c6a9f51f53a8b1d8b067f754fdcef9a2e63c6bf356219724f17880d368b00878398ba2ed85c90bb1a1c1a4f15374
data/CHANGELOG.md CHANGED
@@ -3,3 +3,13 @@
3
3
  ## [1.0.0] - 2024-08-22
4
4
 
5
5
  - Initial release
6
+
7
+
8
+ ## [1.0.1] - 2024-03-18
9
+
10
+ - Use the new API base URL structure to call Figma’s OAuth APIs: https://api.figma.com/v1/
11
+
12
+
13
+ ## [1.0.2] - 2024-03-18
14
+
15
+ - Send OAuth credentials in the request header
@@ -5,19 +5,18 @@ module OmniAuth
5
5
  class Figma < OmniAuth::Strategies::OAuth2
6
6
 
7
7
  option :name, 'figma'
8
- option :scope, 'file_read'
9
-
8
+ option :scope, 'files:read' # use 'files:read' instead of 'file_read' (check: https://www.figma.com/developers/api#authentication-scopes)
10
9
  option :client_options, {
11
- site: 'https://www.figma.com',
12
- authorize_url: '/oauth',
13
- token_url: '/v1/oauth/token'
10
+ site: 'https://api.figma.com/v1/',
11
+ authorize_url: 'https://www.figma.com/oauth',
12
+ token_url: 'oauth/token',
13
+ auth_scheme: :basic_auth # Ensures credentials are sent in the Authorization header
14
14
  }
15
15
 
16
- option :token_options, [:client_id, :client_secret]
17
- option :token_params, { parse: :json }
18
16
 
19
17
  uid { raw_info['id'].to_s }
20
18
 
19
+
21
20
  info do
22
21
  {
23
22
  :name => raw_info['handle'],
@@ -26,6 +25,7 @@ module OmniAuth
26
25
  }
27
26
  end
28
27
 
28
+
29
29
  credentials do
30
30
  {
31
31
  :access_token => access_token.token,
@@ -35,10 +35,12 @@ module OmniAuth
35
35
  }
36
36
  end
37
37
 
38
+
38
39
  def raw_info
39
40
  @raw_info = access_token.get('https://api.figma.com/v1/me').parsed
40
41
  end
41
42
 
43
+
42
44
  def callback_url
43
45
  full_host + script_name + callback_path
44
46
  end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Figma
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-figma-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Riedel
@@ -158,6 +158,7 @@ files:
158
158
  - lib/omniauth-figma/version.rb
159
159
  - lib/omniauth/strategies/figma.rb
160
160
  - omniauth-figma-oauth2-1.0.0.gem
161
+ - omniauth-figma-oauth2-1.0.1.gem
161
162
  - omniauth-figma-oauth2.gemspec
162
163
  homepage: https://github.com/phiele/omniauth-figma-oauth2
163
164
  licenses: