omniauth-linear 1.0.0 → 1.0.1

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: 112244442c3304052014fec93e0d063cf86adfe3800c2145534fa49fcacb9314
4
- data.tar.gz: c82bf6b82db1c1f2c4232c06631311b31ccb2963e65ba3e190815574b9b9575e
3
+ metadata.gz: 9b5959c5984ffabb34eaa54921f2a7654322cb1e823762ca435729d363caf9fc
4
+ data.tar.gz: afee27f2a374d79f0ed615dc19a81d63aec829cc99a5edb5d79953d677538e02
5
5
  SHA512:
6
- metadata.gz: 7616ebdbe4abe0d64d2a0d49ef98effbfacf772b09151d45d68b77349ef97cc0ba4d6afbbec993dd30f1a4e344eefbaa1dbe03834f7a56a296133c62950abfbd
7
- data.tar.gz: 77132846776d5e826bc5ca2005d94bd3865ea6f88f87bb858e83cd894720fa6758aa8b684cfad0df1c32370d3139ee2e230f0d1aa3beb71df351aba89b46d85f
6
+ metadata.gz: 4c9320de46fc3d6c084a5de782dbf947349835565c2f996bec6476e91993b73416c42e7377de0747998c2730fcdbea90d028751335a858cae67b35c721c9fa6c
7
+ data.tar.gz: c476481613c76ec25e000bfd44ef57362475685b0ddede8d1156347b48cf18afea02e60f5c8c1a4ca04daeec9cb4c955b620ddb76736c0bbfc9f032021d4c74f
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.1"
4
4
  end
5
5
  end
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.1
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
@@ -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.