omniauth-linear 1.0.0 → 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: 112244442c3304052014fec93e0d063cf86adfe3800c2145534fa49fcacb9314
4
- data.tar.gz: c82bf6b82db1c1f2c4232c06631311b31ccb2963e65ba3e190815574b9b9575e
3
+ metadata.gz: b15af26154ea53db658069088d2631ffe11ce70e68828cb8c38190974dc6b3ce
4
+ data.tar.gz: 2a1fcc493714b189949b7b3ac9583cdcd7e6e3de086e58b689b8b87dca58b5ea
5
5
  SHA512:
6
- metadata.gz: 7616ebdbe4abe0d64d2a0d49ef98effbfacf772b09151d45d68b77349ef97cc0ba4d6afbbec993dd30f1a4e344eefbaa1dbe03834f7a56a296133c62950abfbd
7
- data.tar.gz: 77132846776d5e826bc5ca2005d94bd3865ea6f88f87bb858e83cd894720fa6758aa8b684cfad0df1c32370d3139ee2e230f0d1aa3beb71df351aba89b46d85f
6
+ metadata.gz: abe2526f15c5723eeeb2ea89b8c81d18e3e4d461e36e51af77380656ea1bc4a780379d05ce343033a82db7b214d6fe39c8fbed68de0106809264584f7686dc5c
7
+ data.tar.gz: b7850dc202621e39f5d09029b6d953af1e6fbc07cae15a144bac90fc9b96369999181643532688f3caa91ac8ce35ea15c54ab9efcf5d008b166f5391e1488ccd
data/Gemfile CHANGED
@@ -10,5 +10,5 @@ group :development, :test do
10
10
  gem 'rb-fsevent'
11
11
  gem 'growl'
12
12
  gem 'rake'
13
- gem 'graphlient'
13
+ gem 'graphql-client'
14
14
  end
data/README.md CHANGED
@@ -16,7 +16,7 @@ gem 'omniauth-linear'
16
16
 
17
17
  ```ruby
18
18
  use OmniAuth::Builder do
19
- provider :linear, ENV['LINEARAPP_CLIENT_ID'], ENV['LINEARAPP_CLIENT_SECRET']
19
+ provider :linear, ENV['LINEARAPP_CLIENT_ID'], ENV['LINEARAPP_CLIENT_SECRET'], { scope: 'read,issues:create' }
20
20
  end
21
21
  ```
22
22
 
@@ -26,7 +26,7 @@ In `config/initializers/linear.rb`
26
26
 
27
27
  ```ruby
28
28
  Rails.application.config.middleware.use OmniAuth::Builder do
29
- provider :linear, ENV['LINEARAPP_CLIENT_ID'], ENV['LINEARAPP_CLIENT_SECRET']
29
+ provider :linear, ENV['LINEARAPP_CLIENT_ID'], ENV['LINEARAPP_CLIENT_SECRET'], { scope: 'read,issues:create' }
30
30
  end
31
31
  ```
32
32
 
@@ -1,5 +1,6 @@
1
1
  require 'omniauth-oauth2'
2
- require 'graphlient'
2
+ require "graphql/client"
3
+ require "graphql/client/http"
3
4
 
4
5
  module OmniAuth
5
6
  module Strategies
@@ -41,12 +42,16 @@ module OmniAuth
41
42
 
42
43
  def me
43
44
  @me ||= begin
44
- client = Graphlient::Client.new(options.client_options.site,
45
- headers: {
46
- 'Authorization' => "Bearer #{access_token.token}"
47
- },
48
- )
49
- response = client.query <<~GRAPHQL
45
+ http = GraphQL::Client::HTTP.new(options.client_options.site) do |obj|
46
+ def headers(context)
47
+ {"Authorization" => "Bearer #{context[:token]}"}
48
+ end
49
+ end
50
+ schema = GraphQL::Client.load_schema(http)
51
+ client = GraphQL::Client.new(schema: schema, execute: http)
52
+ client.allow_dynamic_queries = true
53
+
54
+ gql = client.parse <<~GRAPHQL
50
55
  query {
51
56
  viewer {
52
57
  id
@@ -55,6 +60,7 @@ module OmniAuth
55
60
  }
56
61
  }
57
62
  GRAPHQL
63
+ response = client.query(gql, context: {token: access_token.token})
58
64
  response.data
59
65
  end
60
66
  end
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Linear
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.add_dependency 'omniauth', '~> 1.5'
20
20
  gem.add_dependency 'omniauth-oauth2', '>= 1.4.0', '< 2.0'
21
- gem.add_dependency 'graphlient'
21
+ gem.add_dependency 'graphql-client'
22
22
  gem.add_development_dependency 'rspec', '~> 3.5'
23
23
  gem.add_development_dependency 'rack-test'
24
24
  gem.add_development_dependency 'simplecov'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-linear
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quentin Rousseau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-07 00:00:00.000000000 Z
11
+ date: 2022-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -45,7 +45,7 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '2.0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: graphlient
48
+ name: graphql-client
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubygems_version: 3.0.3
157
+ rubygems_version: 3.0.3.1
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Official OmniAuth strategy for Linear.