omniauth-exact 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.rubocop.yml +54 -0
- data/.travis.yml +21 -0
- data/Gemfile +26 -0
- data/Guardfile +10 -0
- data/README.md +0 -0
- data/Rakefile +18 -0
- data/lib/omniauth/strategies/exact.rb +37 -0
- data/lib/omniauth-exact/version.rb +5 -0
- data/lib/omniauth-exact.rb +2 -0
- data/omniauth-exact.gemspec +24 -0
- data/spec/helper.rb +28 -0
- data/spec/omniauth/strategies/exact_spec.rb +4 -0
- metadata +108 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1ad3883a055e502b0dc4f3425ea48bec23cb8666
|
4
|
+
data.tar.gz: 82dc1307a96650591ab878e62a78704ec4b7d00d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d2c6a31dc80727598b348bdd224c1f3235eb0a5a9c1cec0b36e2487ee1635047e075c82d5e1aaa39e9912ddc91abc73209c714fff640b70c69bae365870c8aff
|
7
|
+
data.tar.gz: f4a1f9e03f88b2e1d7ce9b7fb7f29b64a773f10803a16b91270e9aed6f0cf4d32cf1b897947243fb01056f77fc9630b7f8c03217980b0ef67fdb0233c2503020
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
Metrics/BlockNesting:
|
2
|
+
Max: 2
|
3
|
+
|
4
|
+
Metrics/LineLength:
|
5
|
+
AllowURI: true
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
Metrics/MethodLength:
|
9
|
+
CountComments: false
|
10
|
+
Max: 15
|
11
|
+
|
12
|
+
Metrics/ParameterLists:
|
13
|
+
Max: 4
|
14
|
+
CountKeywordArgs: true
|
15
|
+
|
16
|
+
Style/AccessModifierIndentation:
|
17
|
+
EnforcedStyle: outdent
|
18
|
+
|
19
|
+
Style/CollectionMethods:
|
20
|
+
PreferredMethods:
|
21
|
+
map: 'collect'
|
22
|
+
reduce: 'inject'
|
23
|
+
find: 'detect'
|
24
|
+
find_all: 'select'
|
25
|
+
|
26
|
+
Style/Documentation:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Style/DotPosition:
|
30
|
+
EnforcedStyle: trailing
|
31
|
+
|
32
|
+
Style/DoubleNegation:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Style/EachWithObject:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Style/Encoding:
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
Style/HashSyntax:
|
42
|
+
EnforcedStyle: hash_rockets
|
43
|
+
|
44
|
+
Style/Lambda:
|
45
|
+
Enabled: false
|
46
|
+
|
47
|
+
Style/RaiseArgs:
|
48
|
+
EnforcedStyle: compact
|
49
|
+
|
50
|
+
Style/SpaceInsideHashLiteralBraces:
|
51
|
+
EnforcedStyle: no_space
|
52
|
+
|
53
|
+
Style/TrailingComma:
|
54
|
+
EnforcedStyleForMultiline: 'comma'
|
data/.travis.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
bundler_args: --without development
|
2
|
+
env:
|
3
|
+
global:
|
4
|
+
- JRUBY_OPTS="$JRUBY_OPTS --debug"
|
5
|
+
language: ruby
|
6
|
+
rvm:
|
7
|
+
- 1.8.7
|
8
|
+
- 1.9.3
|
9
|
+
- 2.0.0
|
10
|
+
- 2.1
|
11
|
+
- jruby-18mode
|
12
|
+
- jruby-19mode
|
13
|
+
- jruby-head
|
14
|
+
- rbx-2
|
15
|
+
- ruby-head
|
16
|
+
matrix:
|
17
|
+
allow_failures:
|
18
|
+
- rvm: jruby-head
|
19
|
+
- rvm: ruby-head
|
20
|
+
fast_finish: true
|
21
|
+
sudo: false
|
data/Gemfile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rake'
|
4
|
+
|
5
|
+
group :development do
|
6
|
+
platforms :ruby_19, :ruby_20, :ruby_21 do
|
7
|
+
gem 'guard'
|
8
|
+
gem 'guard-rspec'
|
9
|
+
gem 'guard-bundler'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
group :test do
|
14
|
+
gem 'coveralls'
|
15
|
+
gem 'json', :platforms => [:jruby, :ruby_18, :ruby_19]
|
16
|
+
gem 'mime-types', '~> 1.25', :platforms => [:jruby, :ruby_18]
|
17
|
+
gem 'rack-test'
|
18
|
+
gem 'rest-client', '~> 1.6.0', :platforms => [:jruby, :ruby_18]
|
19
|
+
gem 'rspec', '~> 3.0.0'
|
20
|
+
gem 'rubocop', '>= 0.28', :platforms => [:ruby_19, :ruby_20, :ruby_21]
|
21
|
+
gem 'simplecov', '>= 0.9'
|
22
|
+
gem 'webmock'
|
23
|
+
end
|
24
|
+
|
25
|
+
# Specify your gem's dependencies in omniauth-oauth2.gemspec
|
26
|
+
gemspec
|
data/Guardfile
ADDED
data/README.md
ADDED
File without changes
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new
|
6
|
+
|
7
|
+
task test: :spec
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'rubocop/rake_task'
|
11
|
+
RuboCop::RakeTask.new
|
12
|
+
rescue LoadError
|
13
|
+
task :rubocop do
|
14
|
+
$stderr.puts 'RuboCop is disabled'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
task :default => [:spec, :rubocop]
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Exact < OmniAuth::Strategies::OAuth2
|
6
|
+
option :client_options, {
|
7
|
+
site: 'https://start.exactonline.nl',
|
8
|
+
authorize_url: 'https://start.exactonline.nl/api/oauth2/auth',
|
9
|
+
token_url: 'https://start.exactonline.nl/api/oauth2/token'
|
10
|
+
}
|
11
|
+
|
12
|
+
def request_phase
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
uid{ raw_info['feed']['entry']['content']['properties']['UserID']['__content__'] }
|
17
|
+
|
18
|
+
info do
|
19
|
+
{
|
20
|
+
name: raw_info['feed']['entry']['content']['properties']['FullName'],
|
21
|
+
email: raw_info['feed']['entry']['content']['properties']['Email'],
|
22
|
+
division: raw_info['feed']['entry']['content']['properties']['CurrentDivision']['__content__']
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
extra do
|
27
|
+
{
|
28
|
+
'raw_info' => raw_info
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
def raw_info
|
33
|
+
@raw_info ||= access_token.get('/api/v1/current/Me').parsed
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'omniauth-exact/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.add_dependency 'omniauth', '~> 1.2'
|
7
|
+
gem.add_dependency 'omniauth-oauth2', '>= 1.1.1', '< 2.0'
|
8
|
+
|
9
|
+
gem.add_development_dependency 'bundler', '~> 1.0'
|
10
|
+
|
11
|
+
gem.authors = ['Marek Podlesny']
|
12
|
+
gem.email = ['zzk@chickenkiller.org']
|
13
|
+
gem.description = 'OmniAuth strategy for Exact online'
|
14
|
+
gem.summary = gem.description
|
15
|
+
gem.homepage = 'https://github.com/zzk/omniauth-exact'
|
16
|
+
gem.licenses = %w(MIT)
|
17
|
+
|
18
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
|
19
|
+
gem.files = `git ls-files`.split("\n")
|
20
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
gem.name = 'omniauth-exact'
|
22
|
+
gem.require_paths = %w(lib)
|
23
|
+
gem.version = OmniAuth::Exact::VERSION
|
24
|
+
end
|
data/spec/helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('..', __FILE__)
|
2
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
|
4
|
+
if RUBY_VERSION >= '1.9'
|
5
|
+
require 'simplecov'
|
6
|
+
require 'coveralls'
|
7
|
+
|
8
|
+
SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
|
9
|
+
|
10
|
+
SimpleCov.start do
|
11
|
+
minimum_coverage(76)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'rspec'
|
16
|
+
require 'rack/test'
|
17
|
+
require 'webmock/rspec'
|
18
|
+
require 'omniauth'
|
19
|
+
require 'omniauth-exact'
|
20
|
+
|
21
|
+
RSpec.configure do |config|
|
22
|
+
config.expect_with :rspec do |c|
|
23
|
+
c.syntax = :expect
|
24
|
+
end
|
25
|
+
config.extend OmniAuth::Test::StrategyMacros, type: :strategy
|
26
|
+
config.include Rack::Test::Methods
|
27
|
+
config.include WebMock::API
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-exact
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Marek Podlesny
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: omniauth-oauth2
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.1.1
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '2.0'
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.1.1
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bundler
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '1.0'
|
61
|
+
description: OmniAuth strategy for Exact online
|
62
|
+
email:
|
63
|
+
- zzk@chickenkiller.org
|
64
|
+
executables: []
|
65
|
+
extensions: []
|
66
|
+
extra_rdoc_files: []
|
67
|
+
files:
|
68
|
+
- ".gitignore"
|
69
|
+
- ".rspec"
|
70
|
+
- ".rubocop.yml"
|
71
|
+
- ".travis.yml"
|
72
|
+
- Gemfile
|
73
|
+
- Guardfile
|
74
|
+
- README.md
|
75
|
+
- Rakefile
|
76
|
+
- lib/omniauth-exact.rb
|
77
|
+
- lib/omniauth-exact/version.rb
|
78
|
+
- lib/omniauth/strategies/exact.rb
|
79
|
+
- omniauth-exact.gemspec
|
80
|
+
- spec/helper.rb
|
81
|
+
- spec/omniauth/strategies/exact_spec.rb
|
82
|
+
homepage: https://github.com/zzk/omniauth-exact
|
83
|
+
licenses:
|
84
|
+
- MIT
|
85
|
+
metadata: {}
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 2.4.5
|
103
|
+
signing_key:
|
104
|
+
specification_version: 4
|
105
|
+
summary: OmniAuth strategy for Exact online
|
106
|
+
test_files:
|
107
|
+
- spec/helper.rb
|
108
|
+
- spec/omniauth/strategies/exact_spec.rb
|