omniauth-krystal 1.0.0 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/krystal/version.rb +5 -6
- data/lib/omniauth/strategies/krystal.rb +11 -13
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f64140c4b23240abc668a188f8a6ea105859459f097cfb2aa99db58ef527e20b
|
4
|
+
data.tar.gz: 7c157cc63737b8ca5f2d96261f0724adf195921c35477cf6d6bbedd0993abd1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a2f572a95e3f70fd85c5441253ad44fac34c6ece74e90ab61ae02f4171d8f925c019d683e9c833d56de36c1a743af3eb00fdd7ee61f72c358da69cbf450a121
|
7
|
+
data.tar.gz: 606e3760ab86c72f57df206a93624a1d48b7a666714dcd8199a20befd5bc56d5eab1a2e746f21704e9034d95ed5ffafb0d0e731c5a4a1fe776bfd49713e921c6
|
@@ -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://identity.k.io/oauth2/auth'),
|
13
|
+
token_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_TOKEN_URL', 'https://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.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-18 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,14 +60,14 @@ 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
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
|
-
rubygems_version: 3.2.
|
70
|
+
rubygems_version: 3.2.33
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: OmniAuth strategy for Krystal Identity
|