omniauth-barong 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -0
- data/Gemfile.lock +1 -1
- data/lib/omniauth-barong.rb +3 -0
- data/lib/omniauth/barong.rb +2 -6
- data/lib/omniauth/barong/version.rb +4 -2
- data/lib/omniauth/strategies/barong.rb +60 -0
- data/omniauth-barong.gemspec +3 -3
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d814adf1dfdf69a96f98cd550efeaf874aef7b2e3c22c055d8e0173a84cb5d3f
|
4
|
+
data.tar.gz: 2dd0874ea5ad4f00d724d5ac843cff2c81f4d4c5bc8efbdd94778548a4cdb072
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ba012351bba70ee7d9058bd848dda5371b5b784905dde3458726d8eeda2fcb75db77f0b13ffcad8d1e0791aec05f3148c694fc66424df5f306833e2963791f3
|
7
|
+
data.tar.gz: faa5bd999ed0a90dcb87ffaa7eddb1f02461cc2bf8eb979f4d7b4eb02114d2371f43208956112271e07abc438e1ce6d66fc1e2c3f908c10d26e5d65e59ee3678
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/lib/omniauth/barong.rb
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'multi_json'
|
4
|
+
require 'jwt'
|
5
|
+
require 'omniauth/strategies/oauth2'
|
6
|
+
require 'uri'
|
7
|
+
|
8
|
+
module OmniAuth
|
9
|
+
module Strategies
|
10
|
+
class Barong < OmniAuth::Strategies::OAuth2
|
11
|
+
option :name, :barong
|
12
|
+
option :callback_url
|
13
|
+
option :domain, 'barong.io'
|
14
|
+
|
15
|
+
# This option is temporary dynamic due to barong development.
|
16
|
+
option :authorize_url, '/oauth/authorize'
|
17
|
+
option :raw_info_url, 'api/account'
|
18
|
+
|
19
|
+
args [
|
20
|
+
:client_id,
|
21
|
+
:client_secret,
|
22
|
+
:domain
|
23
|
+
]
|
24
|
+
|
25
|
+
def client
|
26
|
+
options.client_options.site = domain_url
|
27
|
+
options.client_options.authorize_url = options.authorize_url
|
28
|
+
options.client_options.redirect_uri = callback_url
|
29
|
+
super
|
30
|
+
end
|
31
|
+
|
32
|
+
# TODO: if we use 'localhost' as options.domain this will rise exception.
|
33
|
+
# Need to change to be able to use localhost as domain for testing.
|
34
|
+
# Temporary 'http://localhost' could be used.
|
35
|
+
def domain_url
|
36
|
+
domain_url = URI(options.domain)
|
37
|
+
domain_url = URI("https://#{domain_url}") if domain_url.scheme.nil?
|
38
|
+
domain_url.to_s
|
39
|
+
end
|
40
|
+
|
41
|
+
uid { raw_info["id"] }
|
42
|
+
|
43
|
+
info do
|
44
|
+
{
|
45
|
+
:email => raw_info['email'],
|
46
|
+
:role => raw_info['role'],
|
47
|
+
:level => @raw_info['level']
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
def raw_info
|
52
|
+
@raw_info ||= access_token.get(options.raw_info_url).parsed
|
53
|
+
end
|
54
|
+
|
55
|
+
def callback_url
|
56
|
+
options.callback_url || (full_host + script_name + callback_path)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
data/omniauth-barong.gemspec
CHANGED
@@ -5,9 +5,9 @@ require "omniauth/barong/version"
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "omniauth-barong"
|
8
|
-
spec.version =
|
9
|
-
spec.authors = ["Louis Bellet"]
|
10
|
-
spec.email = ["lbellet@heliostech.fr"]
|
8
|
+
spec.version = OmniAuth::Barong::VERSION
|
9
|
+
spec.authors = ["Louis Bellet","Yaroslav Savchuk"]
|
10
|
+
spec.email = ["lbellet@heliostech.fr","ysavchuk@heliostech.fr"]
|
11
11
|
|
12
12
|
spec.summary = %q{Authentification strategy for Barong server}
|
13
13
|
spec.description = %q{Barong is an opensource OAuth and KyC server}
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-barong
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis Bellet
|
8
|
+
- Yaroslav Savchuk
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
12
|
+
date: 2018-01-27 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: omniauth-oauth2
|
@@ -69,6 +70,7 @@ dependencies:
|
|
69
70
|
description: Barong is an opensource OAuth and KyC server
|
70
71
|
email:
|
71
72
|
- lbellet@heliostech.fr
|
73
|
+
- ysavchuk@heliostech.fr
|
72
74
|
executables: []
|
73
75
|
extensions: []
|
74
76
|
extra_rdoc_files: []
|
@@ -82,8 +84,10 @@ files:
|
|
82
84
|
- Rakefile
|
83
85
|
- bin/console
|
84
86
|
- bin/setup
|
87
|
+
- lib/omniauth-barong.rb
|
85
88
|
- lib/omniauth/barong.rb
|
86
89
|
- lib/omniauth/barong/version.rb
|
90
|
+
- lib/omniauth/strategies/barong.rb
|
87
91
|
- omniauth-barong.gemspec
|
88
92
|
homepage: https://www.peatio.tech/
|
89
93
|
licenses: []
|