omniauth-linear 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/lib/omniauth/strategies/linear.rb +13 -7
- data/lib/omniauth-linear/version.rb +1 -1
- data/omniauth-linear.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b15af26154ea53db658069088d2631ffe11ce70e68828cb8c38190974dc6b3ce
|
4
|
+
data.tar.gz: 2a1fcc493714b189949b7b3ac9583cdcd7e6e3de086e58b689b8b87dca58b5ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abe2526f15c5723eeeb2ea89b8c81d18e3e4d461e36e51af77380656ea1bc4a780379d05ce343033a82db7b214d6fe39c8fbed68de0106809264584f7686dc5c
|
7
|
+
data.tar.gz: b7850dc202621e39f5d09029b6d953af1e6fbc07cae15a144bac90fc9b96369999181643532688f3caa91ac8ce35ea15c54ab9efcf5d008b166f5391e1488ccd
|
data/Gemfile
CHANGED
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
|
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
|
-
|
45
|
-
headers
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
data/omniauth-linear.gemspec
CHANGED
@@ -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 '
|
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.
|
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:
|
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:
|
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.
|