omniauth-krystal 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 +4 -4
- data/lib/omniauth/krystal/version.rb +5 -6
- data/lib/omniauth/strategies/krystal.rb +11 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '049356cb76b852f8c9b154677f14aff9f4e17af839d22a37f35a6b28b985960a'
|
4
|
+
data.tar.gz: d157b48040898ca1cd86638e6ad8e0baf5285b80473ed5936e3fab7cc74102cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9cc23de7e8bc7de9d5c0a49e3f1d53fdae9da0a26f74cbf25fc115d99a3c29db75e30b4b65a00bfb59be72f6a49218a8158a60260d9ebaf85217656ca1ad007
|
7
|
+
data.tar.gz: 6c82a640fabd5e3ef1388e5f63e3aaab6f6dad2ed93266337c6a3f469f8d449f80940201a8469ff6da545a45292f64b9559e242cacdbfcd2da1c749a2e431621
|
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
module OmniAuth
|
4
4
|
module Krystal
|
5
|
-
|
6
5
|
VERSION_FILE = File.expand_path('../../../VERSION', __dir__)
|
7
|
-
if File.file?(VERSION_FILE)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
VERSION = if File.file?(VERSION_FILE)
|
7
|
+
File.read(VERSION_FILE).strip
|
8
|
+
else
|
9
|
+
'0.0.0'
|
10
|
+
end
|
12
11
|
end
|
13
12
|
end
|
@@ -5,21 +5,22 @@ require 'omniauth/strategies/oauth2'
|
|
5
5
|
module OmniAuth
|
6
6
|
module Strategies
|
7
7
|
class Krystal < OmniAuth::Strategies::OAuth2
|
8
|
+
option :name, 'krystal'
|
8
9
|
|
9
|
-
option :
|
10
|
+
option :client_options,
|
11
|
+
site: ENV.fetch('KRYSTAL_IDENTITY_API_URL', 'https://identity.k.io/api/v1'),
|
12
|
+
authorize_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_AUTHORIZE_URL', 'https://oauth.identity.k.io/oauth2/auth'),
|
13
|
+
token_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_TOKEN_URL', 'https://oauth.identity.k.io/oauth2/token')
|
10
14
|
|
11
|
-
option :
|
12
|
-
|
13
|
-
authorize_url: ENV.fetch("KRYSTAL_IDENTITY_OAUTH_AUTHORIZE_URL", "https://oauth.identity.k.io/oauth2/auth"),
|
14
|
-
token_url: ENV.fetch("KRYSTAL_IDENTITY_OAUTH_TOKEN_URL", "https://oauth.identity.k.io/oauth2/token")
|
15
|
-
|
15
|
+
option :authorize_params,
|
16
|
+
scope: 'user.profile'
|
16
17
|
|
17
|
-
uid { raw_info[
|
18
|
+
uid { raw_info['user']['id'] }
|
18
19
|
|
19
20
|
info do
|
20
21
|
{
|
21
22
|
name: "#{raw_info['user']['first_name']} #{raw_info['user']['last_name']}",
|
22
|
-
email: raw_info[
|
23
|
+
email: raw_info['user']['email_address']
|
23
24
|
}
|
24
25
|
end
|
25
26
|
|
@@ -31,7 +32,7 @@ module OmniAuth
|
|
31
32
|
end
|
32
33
|
|
33
34
|
def scope
|
34
|
-
access_token[
|
35
|
+
access_token['scope']
|
35
36
|
end
|
36
37
|
|
37
38
|
def callback_url
|
@@ -39,11 +40,8 @@ module OmniAuth
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def raw_info
|
42
|
-
@raw_info ||= access_token.get(
|
43
|
+
@raw_info ||= access_token.get('user').parsed
|
43
44
|
end
|
44
|
-
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
49
|
-
OmniAuth.config.add_camelization "krystal", "Krystal"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-krystal
|
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
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.7'
|
41
41
|
description: OmniAuth strategy for Krystal Identity
|
42
42
|
email:
|
43
43
|
- adam@krystal.uk
|
@@ -60,7 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
60
|
requirements:
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '
|
63
|
+
version: '2.6'
|
64
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|