omniauth-is-oauth2 1.0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e2b7e0db6d4c4ba75499e029f9c227fd034972a4
4
+ data.tar.gz: f9cf380102e23e1acd9e8014502b82647f19a8ec
5
+ SHA512:
6
+ metadata.gz: 6f5d4e00f60e8802ba702eb87187f533b58a3b7f62324d40ff6d3eb409aeece1c0baeec87db92fcf14d88b6ef38bdb39a2ffd34df83c2f812f2adc2bf68fdb3a
7
+ data.tar.gz: 9b5560f35ee3d73d44a912fdcfdf9d787014e00f4990ecb2ee3be475cacbd0cea6189fcb8a9888597d63c6e1c79bebcad184c49a6c52e7a961370d5368676008
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.swp
19
+ Guardfile
20
+ coverage/
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'guard'
7
+ gem 'guard-rspec'
8
+ gem 'guard-bundler'
9
+
10
+ require 'rbconfig'
11
+
12
+ case RbConfig::CONFIG['target_os']
13
+ when /darwin/i
14
+ gem 'rb-fsevent', :require => false
15
+ gem 'growl', :require => false
16
+ when /linux/i
17
+ gem 'rb-inotify', :require => false
18
+ end
19
+ end
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # IS Identity OmniAuth OAuth2 Strategy
2
+
3
+ To use this gem you need to have a client set up by the Internet Solutions
4
+ Systems Integrators team. si@is.co.za
5
+
6
+ For me information regarding set up, https://wiki.is.co.za/index.php/Omniauth-is-oauth2
7
+
8
+ ## License
9
+
10
+ Copyright (C) 2012 by Rudi Kramer and Internet Solutions.
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in
20
+ all copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+ require 'ci/reporter/rake/rspec'
5
+
6
+ desc 'Default: run specs.'
7
+ task :default => :spec
8
+
9
+ desc "Run specs"
10
+ RSpec::Core::RakeTask.new
@@ -0,0 +1,3 @@
1
+ require "omniauth-is-oauth2/version"
2
+ require 'omniauth/strategies/is-oauth2'
3
+
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module ISOauth2
3
+ VERSION = "1.0.4.1"
4
+ end
5
+ end
@@ -0,0 +1,38 @@
1
+ require 'multi_json'
2
+ require 'omniauth-oauth2'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class ISOauth2 < OmniAuth::Strategies::OAuth2
7
+
8
+ option :name, 'isoauth2'
9
+
10
+ option :client_options, {
11
+ :authorize_url => '/oidc/auth',
12
+ :token_url => '/oidc/token',
13
+ }
14
+
15
+ option :authorize_params, {
16
+ :response_type => 'code'
17
+ }
18
+
19
+ uid{ raw_info['user_id'] }
20
+
21
+ info do
22
+ raw_info
23
+ end
24
+
25
+ extra do
26
+ {
27
+ 'raw_info' => raw_info
28
+ }
29
+ end
30
+
31
+ def raw_info
32
+ request = '/oidc/userinfo'
33
+ @raw_info ||= MultiJson.decode(access_token.get(request).body)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ OmniAuth.config.add_camelization 'isoauth2', 'ISOauth2'
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "omniauth-is-oauth2/version"
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.authors = ["Rudi Kramer"]
7
+ gem.email = ["rudi@is.co.za"]
8
+ gem.description = %q{A IS OAuth2 strategy for OmniAuth.}
9
+ gem.summary = %q{A IS OAuth2 strategy for OmniAuth.}
10
+ gem.homepage = "https://github.com/InternetSolutions/omniauth-is-oauth2.git"
11
+
12
+ gem.add_runtime_dependency 'omniauth', '~> 1.0'
13
+ gem.add_dependency 'omniauth-oauth2', '~> 1.0'
14
+
15
+ gem.add_development_dependency 'rspec', '~> 2.6'
16
+ gem.add_development_dependency 'webmock'
17
+ gem.add_development_dependency 'simplecov'
18
+ gem.add_development_dependency 'simplecov-rcov'
19
+ gem.add_development_dependency 'ci_reporter'
20
+ gem.add_development_dependency 'rack-test'
21
+ gem.add_development_dependency 'rake'
22
+
23
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
+ gem.files = `git ls-files`.split("\n")
25
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
26
+ gem.name = "omniauth-is-oauth2"
27
+ gem.require_paths = ["lib"]
28
+ gem.version = OmniAuth::ISOauth2::VERSION
29
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe OmniAuth::Strategies::ISOauth2 do
4
+ subject do
5
+ OmniAuth::Strategies::ISOauth2.new({})
6
+ end
7
+
8
+ context "client options" do
9
+ it 'should have correct name' do
10
+ subject.options.name.should eq("isoauth2")
11
+ end
12
+
13
+ it 'should have correct authorize url' do
14
+ subject.options.client_options.authorize_url.should eq('/oidc/auth')
15
+ end
16
+
17
+ it 'should have correct token url' do
18
+ subject.options.client_options.token_url.should eq('/oidc/token')
19
+ end
20
+
21
+ context 'authorize params'
22
+ it 'should have correct response_type' do
23
+ subject.options.authorize_params.response_type.should eq('code')
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,17 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'simplecov'
4
+ require 'simplecov-rcov'
5
+ SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
6
+ SimpleCov.start
7
+ require 'rspec'
8
+ require 'rack/test'
9
+ require 'omniauth'
10
+ require 'omniauth-is-oauth2'
11
+
12
+ Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
13
+
14
+ RSpec.configure do |config|
15
+ config.include Rack::Test::Methods
16
+ config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
17
+ end
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-is-oauth2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.4.1
5
+ platform: ruby
6
+ authors:
7
+ - Rudi Kramer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-14 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.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
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.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: webmock
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov-rcov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: ci_reporter
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rack-test
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description: A IS OAuth2 strategy for OmniAuth.
140
+ email:
141
+ - rudi@is.co.za
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".gitignore"
147
+ - Gemfile
148
+ - README.md
149
+ - Rakefile
150
+ - lib/omniauth-is-oauth2.rb
151
+ - lib/omniauth-is-oauth2/version.rb
152
+ - lib/omniauth/strategies/is-oauth2.rb
153
+ - omniauth-is-oauth2.gemspec
154
+ - spec/omniauth/strategies/is_spec.rb
155
+ - spec/spec_helper.rb
156
+ homepage: https://github.com/InternetSolutions/omniauth-is-oauth2.git
157
+ licenses: []
158
+ metadata: {}
159
+ post_install_message:
160
+ rdoc_options: []
161
+ require_paths:
162
+ - lib
163
+ required_ruby_version: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ required_rubygems_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ requirements: []
174
+ rubyforge_project:
175
+ rubygems_version: 2.2.2
176
+ signing_key:
177
+ specification_version: 4
178
+ summary: A IS OAuth2 strategy for OmniAuth.
179
+ test_files: []
180
+ has_rdoc: