omniauth-eve_online-sso 0.3.0 → 0.4.0

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: 6dd2c6d084b1b8a1cacf3d7bbfd48440dfb6740b8d6b2b1db7d8cea4dc87f47a
4
- data.tar.gz: 9fa07262440804cb457a8a9255e2ce17131b3761c0280aad39d108d5bd37bbb8
3
+ metadata.gz: 2ad822475338693f0bb8f3a0b6ae8e9fd92106a9474da2f4c11047963589883e
4
+ data.tar.gz: 26fd2e09e12aca85854fe028a3e6897dea90ca3d66d842548c86a76318e85fc0
5
5
  SHA512:
6
- metadata.gz: c8715b08277e7a56a051d141c0841f5894a953ba09dfaa25d23f56951e5ed1079fa35ecd5f6d7c5626e5fa709dd19564a7af980f62ac328de8b673d9e4f99d70
7
- data.tar.gz: 03424da4d83881bad17ef12436560686f22a9f2eabef9cc0942305f9205bad83ef96ce3fdb47f0847e7833fb7c60623544e5d2fdb4f38253c19660be411a77cc
6
+ metadata.gz: de6aeb0cdb3aeebcb3364d088bcca4b61bca5cfecb8c15c50812d2257c6413054c0520df83b5d2186945a3de538f1c492f5300620954084f9510e65d2fb2af5d
7
+ data.tar.gz: 52fb849eedf6254eb77d955c6a183f17c1c72f03ba585a2f236cd12e82b13b3e0d82c34b432885a4a08203398c149f09905a408df33181268aa0803c599ed1b6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.4.0
4
+
5
+ * Update `v2` EveOnline SSO support
6
+
3
7
  ## v0.3.0
4
8
 
5
9
  * Migrate to `/v2/oauth/authorize` and `/v2/oauth/token`
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-eve_online-sso (0.3.0)
4
+ omniauth-eve_online-sso (0.4.0)
5
+ jwt
5
6
  omniauth-oauth2
6
7
 
7
8
  GEM
@@ -12,7 +13,7 @@ GEM
12
13
  coderay (1.1.3)
13
14
  diff-lcs (1.4.4)
14
15
  docile (1.4.0)
15
- faraday (1.7.0)
16
+ faraday (1.8.0)
16
17
  faraday-em_http (~> 1.0)
17
18
  faraday-em_synchrony (~> 1.0)
18
19
  faraday-excon (~> 1.1)
@@ -32,7 +33,7 @@ GEM
32
33
  faraday-patron (1.0.0)
33
34
  faraday-rack (1.0.0)
34
35
  hashie (4.1.0)
35
- jwt (2.2.3)
36
+ jwt (2.3.0)
36
37
  method_source (1.0.0)
37
38
  multi_json (1.15.0)
38
39
  multi_xml (0.6.0)
@@ -50,7 +51,7 @@ GEM
50
51
  omniauth-oauth2 (1.7.1)
51
52
  oauth2 (~> 1.4)
52
53
  omniauth (>= 1.9, < 3)
53
- parallel (1.20.1)
54
+ parallel (1.21.0)
54
55
  parser (3.0.2.0)
55
56
  ast (~> 2.4.1)
56
57
  pry (0.14.1)
@@ -76,18 +77,18 @@ GEM
76
77
  diff-lcs (>= 1.2.0, < 2.0)
77
78
  rspec-support (~> 3.10.0)
78
79
  rspec-support (3.10.2)
79
- rubocop (1.18.4)
80
+ rubocop (1.20.0)
80
81
  parallel (~> 1.10)
81
82
  parser (>= 3.0.0.0)
82
83
  rainbow (>= 2.2.2, < 4.0)
83
84
  regexp_parser (>= 1.8, < 3.0)
84
85
  rexml
85
- rubocop-ast (>= 1.8.0, < 2.0)
86
+ rubocop-ast (>= 1.9.1, < 2.0)
86
87
  ruby-progressbar (~> 1.7)
87
88
  unicode-display_width (>= 1.4.0, < 3.0)
88
- rubocop-ast (1.10.0)
89
+ rubocop-ast (1.12.0)
89
90
  parser (>= 3.0.1.1)
90
- rubocop-performance (1.11.4)
91
+ rubocop-performance (1.11.5)
91
92
  rubocop (>= 1.7.0, < 2.0)
92
93
  rubocop-ast (>= 0.4.0)
93
94
  ruby-progressbar (1.11.0)
@@ -98,10 +99,10 @@ GEM
98
99
  simplecov_json_formatter (~> 0.1)
99
100
  simplecov-html (0.12.3)
100
101
  simplecov_json_formatter (0.1.3)
101
- standard (1.1.7)
102
- rubocop (= 1.18.4)
103
- rubocop-performance (= 1.11.4)
104
- unicode-display_width (2.0.0)
102
+ standard (1.3.0)
103
+ rubocop (= 1.20.0)
104
+ rubocop-performance (= 1.11.5)
105
+ unicode-display_width (2.1.0)
105
106
 
106
107
  PLATFORMS
107
108
  ruby
@@ -117,4 +118,4 @@ DEPENDENCIES
117
118
  standard
118
119
 
119
120
  BUNDLED WITH
120
- 2.2.25
121
+ 2.2.29
@@ -3,7 +3,7 @@
3
3
  module Omniauth
4
4
  module EveOnline
5
5
  module SSO
6
- VERSION = "0.3.0"
6
+ VERSION = "0.4.0"
7
7
  end
8
8
  end
9
9
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "omniauth-oauth2"
4
+ require "jwt"
4
5
 
5
6
  module OmniAuth
6
7
  module Strategies
@@ -12,16 +13,16 @@ module OmniAuth
12
13
  token_url: "/v2/oauth/token",
13
14
  site: "https://login.eveonline.com/"
14
15
 
15
- uid { raw_info["CharacterID"] }
16
+ uid { raw_info["character_id"] }
16
17
 
17
18
  info do
18
19
  {
19
- name: raw_info["CharacterName"],
20
- character_id: raw_info["CharacterID"],
21
- expires_on: raw_info["ExpiresOn"],
22
- scopes: raw_info["Scopes"],
23
- token_type: raw_info["TokenType"],
24
- character_owner_hash: raw_info["CharacterOwnerHash"]
20
+ name: raw_info["name"],
21
+ character_id: raw_info["character_id"],
22
+ expires_on: raw_info["expires_on"],
23
+ scopes: raw_info["scopes"],
24
+ token_type: raw_info["token_type"],
25
+ character_owner_hash: raw_info["owner"]
25
26
  }
26
27
  end
27
28
 
@@ -32,7 +33,13 @@ module OmniAuth
32
33
  end
33
34
 
34
35
  def raw_info
35
- @raw_info ||= access_token.get("/oauth/verify").parsed
36
+ @raw_info ||= JWT.decode(access_token.token, nil, false)
37
+ .find { |element| element.keys.include?("scp") }.tap do |hash|
38
+ hash["character_id"] = hash["sub"].split(":")[-1]
39
+ hash["scopes"] = hash["scp"].join(" ")
40
+ hash["token_type"] = hash["sub"].split(":")[0].capitalize
41
+ hash["expires_on"] = hash["exp"]
42
+ end
36
43
  end
37
44
  end
38
45
  end
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.required_ruby_version = ">= 2.6"
22
22
 
23
23
  spec.add_dependency "omniauth-oauth2"
24
+ spec.add_dependency "jwt"
24
25
 
25
26
  spec.add_development_dependency "bundler"
26
27
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-eve_online-sso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Zubkov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-15 00:00:00.000000000 Z
11
+ date: 2021-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jwt
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -128,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
142
  - !ruby/object:Gem::Version
129
143
  version: '0'
130
144
  requirements: []
131
- rubygems_version: 3.2.25
145
+ rubygems_version: 3.2.29
132
146
  signing_key:
133
147
  specification_version: 4
134
148
  summary: OmniAuth strategy for EveOnline SSO