omniauth-timber-cantina 0.0.2 → 0.0.3
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/.travis.yml +4 -4
- data/Rakefile +1 -2
- data/lib/omniauth/strategies/timber_cantina.rb +14 -11
- data/lib/omniauth/timber/cantina/version.rb +1 -1
- data/lib/omniauth/timber/cantina.rb +1 -1
- data/lib/omniauth-timber-cantina.rb +2 -2
- data/omniauth-timber-cantina.gemspec +2 -2
- data/spec/omniauth/strategies/omniauth_timber_cantina_spec.rb +10 -15
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93eb0c949625d3690386f8e0bc51b5af59bea691
|
4
|
+
data.tar.gz: 7de6f6075d2c3c2624090a41261487a6899e74e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a95093bd404b276c9e2ecfa5b07bfe210a7798490ff32ff2a8f6a5eee89ace03ea900458ee10480420ff77f04bb3235a2a0e890b91bb0af0d9469d0d64627d17
|
7
|
+
data.tar.gz: 5ee06a3d89024606d4139c160eb8138526de5f2eddad99de5b60535117f9e2ee3cfd55782009e9c249dc3e0d992b3a748ef12f6c969cbad576dcd13d1f50e260
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
require
|
2
|
-
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -2,30 +2,33 @@ require 'omniauth-oauth2'
|
|
2
2
|
|
3
3
|
module OmniAuth
|
4
4
|
module Strategies
|
5
|
+
# Basic authentication strategy for Timber Cantina
|
5
6
|
class TimberCantina < OmniAuth::Strategies::OAuth2
|
6
7
|
option :name, :timber_cantina
|
7
8
|
|
8
|
-
option :client_options,
|
9
|
-
|
10
|
-
|
11
|
-
}
|
9
|
+
option :client_options,
|
10
|
+
site: 'https://cantina.budh.nl',
|
11
|
+
authorize_url: '/oauth/authorize'
|
12
12
|
|
13
|
-
uid { raw_info[
|
13
|
+
uid { raw_info['id'] }
|
14
14
|
|
15
15
|
info do
|
16
16
|
{
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
17
|
+
email: raw_info['email'],
|
18
|
+
name: raw_info['name'],
|
19
|
+
api_access_enabled: raw_info['api_access_enabled'],
|
20
|
+
application_permissions: raw_info['application_permissions']
|
21
21
|
# and anything else you want to return to your API consumers
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
25
|
+
def callback_url
|
26
|
+
full_host + script_name + callback_path
|
27
|
+
end
|
28
|
+
|
25
29
|
def raw_info
|
26
30
|
@raw_info ||= access_token.get('/api/v1/me.json').parsed
|
27
31
|
end
|
28
|
-
|
29
32
|
end
|
30
33
|
end
|
31
|
-
end
|
34
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'omniauth/timber/cantina'
|
2
|
+
require 'omniauth/strategies/timber_cantina'
|
@@ -8,10 +8,10 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = 'omniauth-timber-cantina'
|
9
9
|
spec.version = Omniauth::Timber::Cantina::VERSION
|
10
10
|
spec.authors = ['Johan Kok']
|
11
|
-
spec.email = ['
|
11
|
+
spec.email = ['webmaster@boomdenhaag.nl']
|
12
12
|
spec.summary = %q{OmniAuth strategy for Timber Cantina SSO application.}
|
13
13
|
spec.description = %q{OmniAuth strategy for Timber Cantina SSO application.}
|
14
|
-
spec.homepage = 'https://github.com/
|
14
|
+
spec.homepage = 'https://github.com/boom-den-haag/omniauth-timber-cantina'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -4,38 +4,33 @@ describe OmniAuth::Strategies::TimberCantina do
|
|
4
4
|
subject { OmniAuth::Strategies::TimberCantina.new({}) }
|
5
5
|
|
6
6
|
|
7
|
-
context
|
7
|
+
context 'client options' do
|
8
8
|
it 'should have correct site' do
|
9
|
-
expect(subject.options.client_options.site).to eq
|
9
|
+
expect(subject.options.client_options.site).to eq 'https://cantina.budh.nl'
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'should have correct authorize url' do
|
13
13
|
expect(subject.options.client_options.authorize_url).to eq '/oauth/authorize'
|
14
14
|
end
|
15
15
|
|
16
|
-
describe
|
16
|
+
describe 'should be able to customize' do
|
17
17
|
let(:custom_site) { 'http://localhost:3000' }
|
18
18
|
let(:custom_authorize_url) { '/admin_users/oauth/authorize' }
|
19
19
|
let(:custom) do
|
20
20
|
OmniAuth::Strategies::TimberCantina.new('KEY', 'SECRET',
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
}
|
27
|
-
)
|
21
|
+
client_options: {
|
22
|
+
site: custom_site,
|
23
|
+
authorize_url: custom_authorize_url
|
24
|
+
})
|
28
25
|
end
|
29
26
|
|
30
|
-
it
|
27
|
+
it 'for site' do
|
31
28
|
expect(custom.options.client_options.site).to eq custom_site
|
32
29
|
end
|
33
30
|
|
34
|
-
it
|
31
|
+
it 'for authorize url' do
|
35
32
|
expect(custom.options.client_options.authorize_url).to eq custom_authorize_url
|
36
33
|
end
|
37
|
-
|
38
34
|
end
|
39
35
|
end
|
40
|
-
|
41
|
-
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-timber-cantina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan Kok
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -88,7 +88,7 @@ dependencies:
|
|
88
88
|
version: 3.2.0
|
89
89
|
description: OmniAuth strategy for Timber Cantina SSO application.
|
90
90
|
email:
|
91
|
-
-
|
91
|
+
- webmaster@boomdenhaag.nl
|
92
92
|
executables: []
|
93
93
|
extensions: []
|
94
94
|
extra_rdoc_files: []
|
@@ -107,7 +107,7 @@ files:
|
|
107
107
|
- omniauth-timber-cantina.gemspec
|
108
108
|
- spec/omniauth/strategies/omniauth_timber_cantina_spec.rb
|
109
109
|
- spec/spec_helper.rb
|
110
|
-
homepage: https://github.com/
|
110
|
+
homepage: https://github.com/boom-den-haag/omniauth-timber-cantina
|
111
111
|
licenses:
|
112
112
|
- MIT
|
113
113
|
metadata: {}
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.6.14
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: OmniAuth strategy for Timber Cantina SSO application.
|