sso 0.0.2 → 0.1.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sso.rb +6 -0
- data/spec/dummy/Rakefile +9 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/home_controller.rb +4 -0
- data/spec/dummy/app/controllers/sessions_controller.rb +39 -0
- data/spec/dummy/app/models/user.rb +9 -0
- data/spec/dummy/app/views/home/index.html.erb +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/sessions/new.html.erb +10 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +36 -0
- data/spec/dummy/config/boot.rb +4 -0
- data/spec/dummy/config/database.yml +38 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/doorkeeper.rb +23 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/secret_token.rb +10 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/sso.rb +37 -0
- data/spec/dummy/config/initializers/warden.rb +29 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/doorkeeper.en.yml +151 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +12 -0
- data/spec/dummy/db/migrate/20150302113121_add_users.rb +14 -0
- data/spec/dummy/db/migrate/20150303054803_create_doorkeeper_tables.rb +51 -0
- data/spec/dummy/db/migrate/20150303132931_create_passports_table.rb +38 -0
- data/spec/dummy/db/schema.rb +97 -0
- data/spec/integration/oauth/after_fetch_spec.rb +43 -0
- data/spec/integration/oauth/authorization_code_spec.rb +56 -0
- data/spec/integration/oauth/password_verification_spec.rb +67 -0
- data/spec/lib/sso/logging_spec.rb +39 -0
- data/spec/spec_helper.rb +54 -0
- data/spec/support/factories/doorkeeper/application.rb +21 -0
- data/spec/support/factories/server/passport.rb +10 -0
- data/spec/support/factories/server/user.rb +14 -0
- data/spec/support/sso/test.rb +9 -0
- data/spec/support/sso/test/cookie_stripper.rb +20 -0
- data/spec/support/sso/test/helpers.rb +56 -0
- metadata +283 -17
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe SSO::Client::Warden::Hooks::AfterFetch, type: :request, db: true do
|
4
|
+
|
5
|
+
# Client side
|
6
|
+
let(:warden_env) { {} }
|
7
|
+
let(:warden_request) { double :warden_request, ip: ip, user_agent: agent, env: warden_env }
|
8
|
+
let(:warden) { double :warden, request: warden_request }
|
9
|
+
let(:hook) { described_class.new passport: client_passport, warden: warden, options: {} }
|
10
|
+
let(:client_user) { double :client_user }
|
11
|
+
let(:client_passport) { ::SSO::Client::Passport.new id: passport_id, secret: passport_secret, state: passport_state, user: client_user }
|
12
|
+
|
13
|
+
# Shared
|
14
|
+
let!(:oauth_app) { create :unscoped_doorkeeper_application }
|
15
|
+
let(:passport_id) { server_passport.id }
|
16
|
+
let(:passport_state) { server_passport.state }
|
17
|
+
let(:passport_secret) { server_passport.secret }
|
18
|
+
let(:ip) { '198.51.100.74' }
|
19
|
+
let(:agent) { 'IE7' }
|
20
|
+
|
21
|
+
# Server side
|
22
|
+
let!(:server_user) { create :user }
|
23
|
+
let!(:server_passport) { create :passport, user: server_user, owner_id: server_user.id, ip: ip, agent: agent, application_id: oauth_app.id }
|
24
|
+
|
25
|
+
context 'no changes' do
|
26
|
+
it 'verifies the passport' do
|
27
|
+
expect(client_passport).to receive(:verified!)
|
28
|
+
hook.call
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'a user attribute changed which is not included in the state digest' do
|
33
|
+
before do
|
34
|
+
server_user.update_attribute :name, 'Something new'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'verifies the passport' do
|
38
|
+
expect(client_passport).to receive(:verified!)
|
39
|
+
hook.call
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'OAuth 2.0 Authorization Grant Flow', type: :request, db: true do
|
4
|
+
|
5
|
+
let!(:user) { create :user }
|
6
|
+
let!(:client) { create :unscoped_doorkeeper_application }
|
7
|
+
let(:redirect_uri) { client.redirect_uri }
|
8
|
+
|
9
|
+
let(:grant_params) { { client_id: client.uid, redirect_uri: redirect_uri, response_type: :code, scope: :insider, state: 'some_random_string' } }
|
10
|
+
let(:latest_grant) { Doorkeeper::AccessGrant.last }
|
11
|
+
let(:latest_passport) { SSO::Server::Passport.last }
|
12
|
+
|
13
|
+
before do
|
14
|
+
get_via_redirect '/oauth/authorize', grant_params
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'remembers the return path' do
|
18
|
+
expect(session[:return_path]).to eq "/oauth/authorize?#{grant_params.to_query}"
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'shows to the login page' do
|
22
|
+
expect(response).to render_template 'sessions/new'
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'Logging in' do
|
26
|
+
before do
|
27
|
+
post '/sessions', username: user.email, password: user.password
|
28
|
+
follow_redirect!
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'redirects to the application callback including the Grant Token' do
|
32
|
+
expect(latest_grant).to be_present
|
33
|
+
expect(response).to redirect_to "#{client.redirect_uri}?code=#{latest_grant.token}&state=some_random_string"
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'generates a passport with the grant token attached to it' do
|
37
|
+
expect(latest_passport.oauth_access_grant_id).to eq latest_grant.id
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'Exchanging the Authorization Grant for an Access Token' do
|
41
|
+
let(:grant) { ::Rack::Utils.parse_query(URI.parse(response.location).query).fetch('code') }
|
42
|
+
let(:grant_type) { :authorization_code }
|
43
|
+
let(:params) { { client_id: client.uid, client_secret: client.secret, code: grant, grant_type: grant_type, redirect_uri: redirect_uri } }
|
44
|
+
let(:access_token) { JSON.parse(response.body).fetch 'access_token' }
|
45
|
+
|
46
|
+
before do
|
47
|
+
post '/oauth/token', params
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'gets the access token' do
|
51
|
+
expect(access_token).to be_present
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'OAuth 2.0 Resource Owner Password Credentials Grant', type: :request, db: true do
|
4
|
+
|
5
|
+
let!(:user) { create :user }
|
6
|
+
let!(:client) { create :unscoped_doorkeeper_application }
|
7
|
+
|
8
|
+
let(:password) { user.password }
|
9
|
+
let(:params) { { grant_type: :password, client_id: client.uid, client_secret: client.secret, username: user.email, password: password } }
|
10
|
+
let(:headers) { { 'HTTP_ACCEPT' => 'application/json' } }
|
11
|
+
|
12
|
+
let(:latest_passport) { ::SSO::Server::Passport.last }
|
13
|
+
let(:passport_count) { ::SSO::Server::Passport.count }
|
14
|
+
let(:latest_access_token) { ::Doorkeeper::AccessToken.last }
|
15
|
+
let(:result) { JSON.parse(response.body) }
|
16
|
+
|
17
|
+
before do
|
18
|
+
post '/oauth/token', params, headers
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'correct password' do
|
22
|
+
it 'succeeds' do
|
23
|
+
expect(response.status).to eq 200
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'responds with JSON serialized params' do
|
27
|
+
expect(result).to be_instance_of Hash
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'includes the access_token' do
|
31
|
+
expect(result['access_token']).to eq latest_access_token.token
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'generates a passport with the grant token attached to it' do
|
35
|
+
expect(latest_passport.oauth_access_token_id).to eq latest_access_token.id
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'does not generate multiple passports' do
|
39
|
+
expect(passport_count).to eq 1
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'wrong password' do
|
44
|
+
let(:password) { 'wrong-password-sent-by-hackerz' }
|
45
|
+
|
46
|
+
it 'fails' do
|
47
|
+
expect(response.status).to eq 401
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'responds with JSON serialized params' do
|
51
|
+
expect(result).to be_instance_of Hash
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'provides a errornous status' do
|
55
|
+
expect(result['status']).to eq 'error'
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'provides a useful code' do
|
59
|
+
expect(result['code']).to eq 'authentication_failed'
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'does not generate anny passports' do
|
63
|
+
expect(passport_count).to eq 0
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe SSO::Logging do
|
4
|
+
|
5
|
+
let(:instance) { MyTestNamespace::MyClass.new }
|
6
|
+
let(:logger) { ::Logger.new '/dev/null' }
|
7
|
+
|
8
|
+
before do
|
9
|
+
::SSO.config.logger = logger
|
10
|
+
stub_const 'MyTestNamespace', Module.new
|
11
|
+
stub_const 'MyTestNamespace::MyClass', Class.new { include SSO::Logging }
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#logger' do
|
15
|
+
it 'is a logger' do
|
16
|
+
expect(instance.logger).to be_instance_of ::Logger
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#debug' do
|
21
|
+
it 'delegates to the logger' do
|
22
|
+
expect(logger).to receive(:debug).with('MyTestNamespace::MyClass') do |_, &block|
|
23
|
+
expect(block.call).to eq 'Say what?'
|
24
|
+
end
|
25
|
+
instance.debug { 'Say what?' }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'logger missing' do
|
30
|
+
let(:logger) {}
|
31
|
+
|
32
|
+
describe '#debug' do
|
33
|
+
it 'does not break' do
|
34
|
+
instance.debug { 'Should I freak out now?' }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
ENV['RACK_ENV'] = 'test'
|
2
|
+
|
3
|
+
unless ENV['TRAVIS']
|
4
|
+
require 'simplecov'
|
5
|
+
SimpleCov.start
|
6
|
+
end
|
7
|
+
|
8
|
+
require 'sso'
|
9
|
+
require 'sso/server' # <- The dummy app is an SSO Server
|
10
|
+
require 'sso/client' # <- For integration tests from client to server
|
11
|
+
|
12
|
+
require File.expand_path('../dummy/config/environment', __FILE__)
|
13
|
+
|
14
|
+
require 'rspec/rails'
|
15
|
+
require 'factory_girl_rails'
|
16
|
+
require 'database_cleaner'
|
17
|
+
require 'timecop'
|
18
|
+
require 'webmock'
|
19
|
+
|
20
|
+
Dir[Pathname.pwd.join('spec/support/**/*.rb')].each { |f| require f }
|
21
|
+
|
22
|
+
RSpec.configure do |config|
|
23
|
+
|
24
|
+
config.include FactoryGirl::Syntax::Methods
|
25
|
+
config.include SSO::Test::Helpers
|
26
|
+
|
27
|
+
config.color = true
|
28
|
+
config.disable_monkey_patching!
|
29
|
+
config.fail_fast = true
|
30
|
+
config.raise_errors_for_deprecations!
|
31
|
+
config.use_transactional_fixtures = false
|
32
|
+
|
33
|
+
config.before :suite do
|
34
|
+
DatabaseCleaner.strategy = :transaction
|
35
|
+
DatabaseCleaner.clean_with :truncation
|
36
|
+
end
|
37
|
+
|
38
|
+
config.before :each do
|
39
|
+
redirect_httparty_to_rails_stack
|
40
|
+
end
|
41
|
+
|
42
|
+
config.before :each, db: true do
|
43
|
+
DatabaseCleaner.start
|
44
|
+
end
|
45
|
+
|
46
|
+
config.after :each do
|
47
|
+
Timecop.return
|
48
|
+
end
|
49
|
+
|
50
|
+
config.after :each, db: true do
|
51
|
+
DatabaseCleaner.clean
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :parent_of_all_doorkeeper_applications, class: Doorkeeper::Application do
|
3
|
+
|
4
|
+
factory :insider_doorkeeper_application do
|
5
|
+
scopes { :insider }
|
6
|
+
end
|
7
|
+
|
8
|
+
factory :outsider_doorkeeper_application do
|
9
|
+
scopes { :outsider }
|
10
|
+
end
|
11
|
+
|
12
|
+
factory :unscoped_doorkeeper_application do
|
13
|
+
end
|
14
|
+
|
15
|
+
uid { SecureRandom.hex }
|
16
|
+
secret { SecureRandom.hex }
|
17
|
+
name { %w(Alpha Beta Gamma Delta Epsilon).sample }
|
18
|
+
redirect_uri { "https://#{name.downcase}.example.com#{['/subpath', nil].sample}/auth/sso/callback" }
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :parent_of_all_users, class: User do
|
3
|
+
|
4
|
+
factory :user do
|
5
|
+
end
|
6
|
+
|
7
|
+
name { %w(Alice Bob Carol Eve Frank).sample }
|
8
|
+
email { "#{name.downcase}@email.com" }
|
9
|
+
password { %w(p4ssword s3same l3tmein).sample }
|
10
|
+
tags { [[%w(password_expired superuser).sample, %w(admin confirmed).sample], []].sample }
|
11
|
+
vip { [true, false].sample }
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module SSO
|
2
|
+
module Test
|
3
|
+
# There is no good way to simulate disabled cookies in Rails,
|
4
|
+
# so we inject this Middleware which actually removes them from our incoming requests.
|
5
|
+
#
|
6
|
+
class CookieStripper
|
7
|
+
|
8
|
+
def initialize(app)
|
9
|
+
fail 'What are you doing?' unless Rails.env.test?
|
10
|
+
@app = app
|
11
|
+
end
|
12
|
+
|
13
|
+
def call(env)
|
14
|
+
Rack::Request.new(env).cookies.clear if SSO::Test.strip_cookies
|
15
|
+
@app.call(env)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
module SSO
|
4
|
+
module Test
|
5
|
+
module Helpers
|
6
|
+
|
7
|
+
def redirect_httparty_to_rails_stack
|
8
|
+
redirect_httparty :get
|
9
|
+
redirect_httparty :post
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def redirect_httparty(method)
|
15
|
+
allow(HTTParty).to receive(method) do |url, options|
|
16
|
+
::SSO.config.logger.warn('SSO::Test::Helpers') do
|
17
|
+
"RSpec caught an outgoing HTTParty request to #{url.inspect} and re-routes it back into the Rails integration test framework..."
|
18
|
+
end
|
19
|
+
|
20
|
+
url = URI.parse url
|
21
|
+
expect(url.host).to include '.example.com'
|
22
|
+
expect(url.scheme).to eq 'https'
|
23
|
+
|
24
|
+
if options[:basic_auth].present?
|
25
|
+
basic_auth_header = 'Basic ' + Base64.encode64("#{options[:basic_auth][:username]}:#{options[:basic_auth][:password]}")
|
26
|
+
options[:headers]['HTTP_AUTHORIZATION'] = basic_auth_header
|
27
|
+
end
|
28
|
+
|
29
|
+
case method
|
30
|
+
when :post
|
31
|
+
query_string = options[:query].to_query.present? ? "?#{options[:query].to_query}" : nil
|
32
|
+
send method, "#{url.path}#{query_string}", options[:body], options[:headers]
|
33
|
+
when :get
|
34
|
+
send method, url.path, options[:query], options[:headers]
|
35
|
+
else
|
36
|
+
fail NotImplementedError
|
37
|
+
end
|
38
|
+
|
39
|
+
convert_rails_response_to_httparty_response response
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def convert_rails_response_to_httparty_response(response)
|
44
|
+
parsed_response = JSON.parse response.body
|
45
|
+
OpenStruct.new code: response.code.to_i, parsed_response: parsed_response
|
46
|
+
|
47
|
+
rescue JSON::ParserError
|
48
|
+
::SSO.config.logger.warn('SSO::Test::Helpers') do
|
49
|
+
'It looks like I could not parse that JSON response. I will behave just like HTTParty and not raise an Exception for this.'
|
50
|
+
end
|
51
|
+
OpenStruct.new code: response.code.to_i
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.1.0.alpha1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- halo
|
@@ -10,6 +10,34 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2015-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: doorkeeper
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: operation
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.0.3
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: httparty
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,22 +72,50 @@ dependencies:
|
|
44
72
|
requirements:
|
45
73
|
- - ">="
|
46
74
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
75
|
+
version: 0.1.8
|
48
76
|
type: :runtime
|
49
77
|
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.8
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: warden
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.2.3
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.2.3
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: database_cleaner
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
50
106
|
version_requirements: !ruby/object:Gem::Requirement
|
51
107
|
requirements:
|
52
108
|
- - ">="
|
53
109
|
- !ruby/object:Gem::Version
|
54
110
|
version: '0'
|
55
111
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
112
|
+
name: factory_girl_rails
|
57
113
|
requirement: !ruby/object:Gem::Requirement
|
58
114
|
requirements:
|
59
115
|
- - ">="
|
60
116
|
- !ruby/object:Gem::Version
|
61
117
|
version: '0'
|
62
|
-
type: :
|
118
|
+
type: :development
|
63
119
|
prerelease: false
|
64
120
|
version_requirements: !ruby/object:Gem::Requirement
|
65
121
|
requirements:
|
@@ -67,28 +123,190 @@ dependencies:
|
|
67
123
|
- !ruby/object:Gem::Version
|
68
124
|
version: '0'
|
69
125
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
126
|
+
name: guard-rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 4.2.3
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 4.2.3
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: guard-rubocop
|
71
141
|
requirement: !ruby/object:Gem::Requirement
|
72
142
|
requirements:
|
73
143
|
- - ">="
|
74
144
|
- !ruby/object:Gem::Version
|
75
145
|
version: '0'
|
76
|
-
type: :
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pg
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rails
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rspec-rails
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: rubocop
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
77
203
|
prerelease: false
|
78
204
|
version_requirements: !ruby/object:Gem::Requirement
|
79
205
|
requirements:
|
80
206
|
- - ">="
|
81
207
|
- !ruby/object:Gem::Version
|
82
208
|
version: '0'
|
83
|
-
|
84
|
-
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: simplecov
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: 0.9.0
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: 0.9.0
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: timecop
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: webmock
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
251
|
+
description: Leveraging Doorkeeper as single-sign-on OAuth server. To provide true
|
252
|
+
single-sign-OUT, every request on an OAuth client app is verified with the SSO server.
|
85
253
|
email:
|
86
254
|
executables: []
|
87
255
|
extensions: []
|
88
256
|
extra_rdoc_files: []
|
89
|
-
files:
|
90
|
-
|
91
|
-
|
257
|
+
files:
|
258
|
+
- lib/sso.rb
|
259
|
+
- spec/dummy/Rakefile
|
260
|
+
- spec/dummy/app/assets/javascripts/application.js
|
261
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
262
|
+
- spec/dummy/app/controllers/application_controller.rb
|
263
|
+
- spec/dummy/app/controllers/home_controller.rb
|
264
|
+
- spec/dummy/app/controllers/sessions_controller.rb
|
265
|
+
- spec/dummy/app/models/user.rb
|
266
|
+
- spec/dummy/app/views/home/index.html.erb
|
267
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
268
|
+
- spec/dummy/app/views/sessions/new.html.erb
|
269
|
+
- spec/dummy/bin/bundle
|
270
|
+
- spec/dummy/bin/rails
|
271
|
+
- spec/dummy/bin/rake
|
272
|
+
- spec/dummy/bin/setup
|
273
|
+
- spec/dummy/config.ru
|
274
|
+
- spec/dummy/config/application.rb
|
275
|
+
- spec/dummy/config/boot.rb
|
276
|
+
- spec/dummy/config/database.yml
|
277
|
+
- spec/dummy/config/environment.rb
|
278
|
+
- spec/dummy/config/environments/development.rb
|
279
|
+
- spec/dummy/config/environments/test.rb
|
280
|
+
- spec/dummy/config/initializers/assets.rb
|
281
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
282
|
+
- spec/dummy/config/initializers/doorkeeper.rb
|
283
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
284
|
+
- spec/dummy/config/initializers/secret_token.rb
|
285
|
+
- spec/dummy/config/initializers/session_store.rb
|
286
|
+
- spec/dummy/config/initializers/sso.rb
|
287
|
+
- spec/dummy/config/initializers/warden.rb
|
288
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
289
|
+
- spec/dummy/config/locales/doorkeeper.en.yml
|
290
|
+
- spec/dummy/config/locales/en.yml
|
291
|
+
- spec/dummy/config/routes.rb
|
292
|
+
- spec/dummy/db/migrate/20150302113121_add_users.rb
|
293
|
+
- spec/dummy/db/migrate/20150303054803_create_doorkeeper_tables.rb
|
294
|
+
- spec/dummy/db/migrate/20150303132931_create_passports_table.rb
|
295
|
+
- spec/dummy/db/schema.rb
|
296
|
+
- spec/integration/oauth/after_fetch_spec.rb
|
297
|
+
- spec/integration/oauth/authorization_code_spec.rb
|
298
|
+
- spec/integration/oauth/password_verification_spec.rb
|
299
|
+
- spec/lib/sso/logging_spec.rb
|
300
|
+
- spec/spec_helper.rb
|
301
|
+
- spec/support/factories/doorkeeper/application.rb
|
302
|
+
- spec/support/factories/server/passport.rb
|
303
|
+
- spec/support/factories/server/user.rb
|
304
|
+
- spec/support/sso/test.rb
|
305
|
+
- spec/support/sso/test/cookie_stripper.rb
|
306
|
+
- spec/support/sso/test/helpers.rb
|
307
|
+
homepage: https://github.com/halo/sso
|
308
|
+
licenses:
|
309
|
+
- MIT
|
92
310
|
metadata: {}
|
93
311
|
post_install_message:
|
94
312
|
rdoc_options: []
|
@@ -98,16 +316,64 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
316
|
requirements:
|
99
317
|
- - ">="
|
100
318
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
319
|
+
version: 2.0.0
|
102
320
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
321
|
requirements:
|
104
|
-
- - "
|
322
|
+
- - ">"
|
105
323
|
- !ruby/object:Gem::Version
|
106
|
-
version:
|
324
|
+
version: 1.3.1
|
107
325
|
requirements: []
|
108
326
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
327
|
+
rubygems_version: 2.4.5
|
110
328
|
signing_key:
|
111
329
|
specification_version: 4
|
112
|
-
summary:
|
113
|
-
test_files:
|
330
|
+
summary: Leveraging Doorkeeper as single-sign-on OAuth server.
|
331
|
+
test_files:
|
332
|
+
- spec/dummy/app/assets/javascripts/application.js
|
333
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
334
|
+
- spec/dummy/app/controllers/application_controller.rb
|
335
|
+
- spec/dummy/app/controllers/home_controller.rb
|
336
|
+
- spec/dummy/app/controllers/sessions_controller.rb
|
337
|
+
- spec/dummy/app/models/user.rb
|
338
|
+
- spec/dummy/app/views/home/index.html.erb
|
339
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
340
|
+
- spec/dummy/app/views/sessions/new.html.erb
|
341
|
+
- spec/dummy/bin/bundle
|
342
|
+
- spec/dummy/bin/rails
|
343
|
+
- spec/dummy/bin/rake
|
344
|
+
- spec/dummy/bin/setup
|
345
|
+
- spec/dummy/config/application.rb
|
346
|
+
- spec/dummy/config/boot.rb
|
347
|
+
- spec/dummy/config/database.yml
|
348
|
+
- spec/dummy/config/environment.rb
|
349
|
+
- spec/dummy/config/environments/development.rb
|
350
|
+
- spec/dummy/config/environments/test.rb
|
351
|
+
- spec/dummy/config/initializers/assets.rb
|
352
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
353
|
+
- spec/dummy/config/initializers/doorkeeper.rb
|
354
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
355
|
+
- spec/dummy/config/initializers/secret_token.rb
|
356
|
+
- spec/dummy/config/initializers/session_store.rb
|
357
|
+
- spec/dummy/config/initializers/sso.rb
|
358
|
+
- spec/dummy/config/initializers/warden.rb
|
359
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
360
|
+
- spec/dummy/config/locales/doorkeeper.en.yml
|
361
|
+
- spec/dummy/config/locales/en.yml
|
362
|
+
- spec/dummy/config/routes.rb
|
363
|
+
- spec/dummy/config.ru
|
364
|
+
- spec/dummy/db/migrate/20150302113121_add_users.rb
|
365
|
+
- spec/dummy/db/migrate/20150303054803_create_doorkeeper_tables.rb
|
366
|
+
- spec/dummy/db/migrate/20150303132931_create_passports_table.rb
|
367
|
+
- spec/dummy/db/schema.rb
|
368
|
+
- spec/dummy/Rakefile
|
369
|
+
- spec/integration/oauth/after_fetch_spec.rb
|
370
|
+
- spec/integration/oauth/authorization_code_spec.rb
|
371
|
+
- spec/integration/oauth/password_verification_spec.rb
|
372
|
+
- spec/lib/sso/logging_spec.rb
|
373
|
+
- spec/spec_helper.rb
|
374
|
+
- spec/support/factories/doorkeeper/application.rb
|
375
|
+
- spec/support/factories/server/passport.rb
|
376
|
+
- spec/support/factories/server/user.rb
|
377
|
+
- spec/support/sso/test/cookie_stripper.rb
|
378
|
+
- spec/support/sso/test/helpers.rb
|
379
|
+
- spec/support/sso/test.rb
|