gds-sso 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ class AuthorisationsController < ApplicationController
2
+ def cant_signin
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ <h1>Error</h1>
2
+
3
+ <p>ACCESS DENIED!</p>
data/config/routes.rb CHANGED
@@ -2,4 +2,5 @@ Rails.application.routes.draw do
2
2
  match '/auth/gds/callback', to: 'authentications#callback', as: :gds_sign_in
3
3
  match '/auth/gds/sign_out', to: 'authentications#sign_out', as: :gds_sign_out
4
4
  match '/auth/failure', to: 'authentications#failure', as: :auth_failure
5
+ match '/authorisations/cant_signin', to: 'authorisations#cant_signin', as: :cant_signin
5
6
  end
@@ -20,6 +20,10 @@ module GDS
20
20
  mattr_accessor :basic_auth_user
21
21
  mattr_accessor :basic_auth_password
22
22
  mattr_accessor :basic_auth_realm
23
+
24
+ # default_scope, usually the app, e.g. Publisher
25
+ mattr_accessor :default_scope
26
+
23
27
  @@basic_auth_realm = "API Access"
24
28
 
25
29
  def self.user_klass
@@ -1,6 +1,21 @@
1
1
  module GDS
2
2
  module SSO
3
3
  module ControllerMethods
4
+ class PermissionDeniedException < StandardError
5
+ end
6
+
7
+ def authorise_user!(scope, permission)
8
+ if not current_user.has_permission?(scope, permission)
9
+ raise PermissionDeniedException
10
+ end
11
+ end
12
+
13
+ def require_signin_permission!
14
+ authorise_user!(GDS::SSO::Config.default_scope, 'signin')
15
+ rescue PermissionDeniedException
16
+ redirect_to cant_signin_url
17
+ end
18
+
4
19
  def authenticate_user!
5
20
  warden.authenticate!
6
21
  end
data/lib/gds-sso/user.rb CHANGED
@@ -13,8 +13,22 @@ module GDS
13
13
  end
14
14
 
15
15
  module User
16
+ def has_permission?(scope, permission)
17
+ # NOTE: this line is a temporary helper until we have migrated users over to having permissions.
18
+ return true if permissions.has_key?("everything") && permissions["everything"][0] == "signin"
19
+
20
+ if permissions.has_key?(scope)
21
+ permissions[scope].include?(permission) || permissions[scope].include?("admin")
22
+ end
23
+ end
24
+
16
25
  def self.user_params_from_auth_hash(auth_hash)
17
- {'uid' => auth_hash['uid'], 'email' => auth_hash['info']['email'], 'name' => auth_hash['info']['name']}
26
+ {
27
+ 'uid' => auth_hash['uid'],
28
+ 'email' => auth_hash['info']['email'],
29
+ 'name' => auth_hash['info']['name'],
30
+ 'permissions' => auth_hash['extra']['user']['permissions']
31
+ }
18
32
  end
19
33
 
20
34
  extend ActiveSupport::Concern
@@ -22,12 +36,13 @@ module GDS
22
36
  module ClassMethods
23
37
  def find_for_gds_oauth(auth_hash)
24
38
  if user = self.find_by_uid(auth_hash["uid"])
39
+ user.update_attributes(GDS::SSO::User.user_params_from_auth_hash(auth_hash), as: :oauth)
25
40
  user
26
41
  else # Create a new user.
27
- self.create!(GDS::SSO::User.user_params_from_auth_hash(auth_hash))
42
+ self.create!(GDS::SSO::User.user_params_from_auth_hash(auth_hash), as: :oauth)
28
43
  end
29
44
  end
30
45
  end
31
46
  end
32
47
  end
33
- end
48
+ end
@@ -1,5 +1,5 @@
1
1
  module GDS
2
2
  module SSO
3
- VERSION = "0.6.1"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
@@ -2,8 +2,10 @@
2
2
  DELETE FROM `oauth_access_grants`;
3
3
  DELETE FROM `oauth_access_tokens`;
4
4
  DELETE FROM `oauth_applications`;
5
+ DELETE FROM `permissions`;
5
6
  DELETE FROM `users`;
6
7
 
7
8
  -- Setup fixture data
8
9
  INSERT INTO `oauth_applications` VALUES (1,'GDS_SSO integration test','gds-sso-test','secret','http://www.example-client.com/auth/gds/callback','2012-04-19 13:26:54','2012-04-19 13:26:54');
9
10
  INSERT INTO `users` (id, email, encrypted_password, created_at, updated_at, name, uid, is_admin) VALUES (1,'test@example-client.com','$2a$04$MdMkVFwTq5GLJJkHS8GLIe6dK1.C4ozzba5ZS5Ks2b/NenVsMGGRW','2012-04-19 13:26:54','2012-04-19 13:26:54','Test User','integration-uid', 0);
11
+ INSERT INTO `permissions` (id, user_id, application_id, permissions) VALUES (1,1,1,'["signin"]');
@@ -1,4 +1,4 @@
1
- class User
1
+ class User < OpenStruct
2
2
  include GDS::SSO::User
3
3
 
4
4
  def self.find_by_uid(something)
@@ -11,8 +11,9 @@ class User
11
11
  end
12
12
 
13
13
  def self.stub_user
14
- OpenStruct.new({ :uid => '1', :name => "User" })
14
+ User.new({ :uid => '1', :name => "User" })
15
15
  end
16
16
 
17
-
17
+ def update_attributes(*args)
18
+ end
18
19
  end
@@ -5,4 +5,5 @@ GDS::SSO.config do |config|
5
5
  config.oauth_root_url = "http://localhost:4567"
6
6
  config.basic_auth_user = 'test_api_user'
7
7
  config.basic_auth_password = 'api_user_password'
8
+ config.default_scope = 'test-app'
8
9
  end
@@ -1893,3 +1893,255 @@ Started GET "/restricted" for 127.0.0.1 at 2012-06-14 15:20:03 +0000
1893
1893
  Processing by ExampleController#restricted as JSON
1894
1894
  Authenticating with gds_sso_api_access strategy
1895
1895
  Completed 200 OK in 1ms (Views: 0.6ms)
1896
+
1897
+
1898
+ Started GET "/" for 127.0.0.1 at 2012-06-15 09:29:24 +0000
1899
+ Processing by ExampleController#index as HTML
1900
+ Rendered text template (0.0ms)
1901
+ Completed 200 OK in 49ms (Views: 48.3ms)
1902
+
1903
+
1904
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 09:29:24 +0000
1905
+ Processing by ExampleController#restricted as HTML
1906
+ Authenticating with gds_sso strategy
1907
+ Completed in 56ms
1908
+
1909
+
1910
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-15 09:29:24 +0000
1911
+
1912
+
1913
+ Started GET "/auth/gds/callback?code=9c40ca92c39c3338e549df12196d4f0b0a29bec28567bee9dfafa65266c6aa2d" for 127.0.0.1 at 2012-06-15 09:29:25 +0000
1914
+ Processing by AuthenticationsController#callback as HTML
1915
+ Parameters: {"code"=>"9c40ca92c39c3338e549df12196d4f0b0a29bec28567bee9dfafa65266c6aa2d"}
1916
+ Authenticating with gds_sso strategy
1917
+ Redirected to http://www.example-client.com/restricted
1918
+ Completed 302 Found in 1ms
1919
+
1920
+
1921
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 09:29:25 +0000
1922
+ Processing by ExampleController#restricted as HTML
1923
+ Completed 200 OK in 1ms (Views: 0.8ms)
1924
+
1925
+
1926
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 09:29:25 +0000
1927
+ Processing by ExampleController#restricted as HTML
1928
+ Authenticating with gds_sso strategy
1929
+ Completed in 0ms
1930
+
1931
+
1932
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-15 09:29:25 +0000
1933
+
1934
+
1935
+ Started GET "/auth/gds/callback?code=3e0d20f58159ab251f98c0a1913c9328f5101d883ce6c4cf65305ccc2c131e66" for 127.0.0.1 at 2012-06-15 09:29:26 +0000
1936
+ Processing by AuthenticationsController#callback as HTML
1937
+ Parameters: {"code"=>"3e0d20f58159ab251f98c0a1913c9328f5101d883ce6c4cf65305ccc2c131e66"}
1938
+ Authenticating with gds_sso strategy
1939
+ Redirected to http://www.example-client.com/restricted
1940
+ Completed 302 Found in 1ms
1941
+
1942
+
1943
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 09:29:26 +0000
1944
+ Processing by ExampleController#restricted as HTML
1945
+ Completed 200 OK in 1ms (Views: 0.5ms)
1946
+
1947
+
1948
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 09:29:26 +0000
1949
+ Processing by ExampleController#restricted as HTML
1950
+ Authenticating with gds_sso strategy
1951
+ Completed in 0ms
1952
+
1953
+
1954
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-15 09:29:26 +0000
1955
+
1956
+
1957
+ Started GET "/auth/gds/callback?code=0da2180655109b6b562a9892a4e9eadda13f4f6eae39187cfe19d41a9043e5f0" for 127.0.0.1 at 2012-06-15 09:29:26 +0000
1958
+ Processing by AuthenticationsController#callback as HTML
1959
+ Parameters: {"code"=>"0da2180655109b6b562a9892a4e9eadda13f4f6eae39187cfe19d41a9043e5f0"}
1960
+ Authenticating with gds_sso strategy
1961
+ Redirected to http://www.example-client.com/restricted
1962
+ Completed 302 Found in 1ms
1963
+
1964
+
1965
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 09:29:26 +0000
1966
+ Processing by ExampleController#restricted as HTML
1967
+ Completed 200 OK in 1ms (Views: 0.3ms)
1968
+
1969
+
1970
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 09:29:26 +0000
1971
+ Processing by ExampleController#restricted as JSON
1972
+ Authenticating with gds_sso_api_access strategy
1973
+ Completed in 42ms
1974
+
1975
+
1976
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 09:29:26 +0000
1977
+ Processing by ExampleController#restricted as JSON
1978
+ Authenticating with gds_sso_api_access strategy
1979
+ Completed 200 OK in 1ms (Views: 0.6ms)
1980
+
1981
+
1982
+ Started GET "/" for 127.0.0.1 at 2012-06-15 13:31:52 +0000
1983
+ Processing by ExampleController#index as HTML
1984
+ Rendered text template (0.0ms)
1985
+ Completed 200 OK in 85ms (Views: 84.1ms)
1986
+
1987
+
1988
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 13:31:54 +0000
1989
+ Processing by ExampleController#restricted as HTML
1990
+ Authenticating with gds_sso strategy
1991
+ Completed in 63ms
1992
+
1993
+
1994
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-15 13:31:54 +0000
1995
+
1996
+
1997
+ Started GET "/auth/gds/callback?code=dc271e7c6ff3bf2871a3de235b9b360f2c1beeffcc124ea5cb22f10e7defd283" for 127.0.0.1 at 2012-06-15 13:31:56 +0000
1998
+ Processing by AuthenticationsController#callback as HTML
1999
+ Parameters: {"code"=>"dc271e7c6ff3bf2871a3de235b9b360f2c1beeffcc124ea5cb22f10e7defd283"}
2000
+ Authenticating with gds_sso strategy
2001
+ Redirected to http://www.example-client.com/restricted
2002
+ Completed 302 Found in 1ms
2003
+
2004
+
2005
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 13:31:56 +0000
2006
+ Processing by ExampleController#restricted as HTML
2007
+ Completed 200 OK in 1ms (Views: 0.5ms)
2008
+
2009
+
2010
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 13:31:56 +0000
2011
+ Processing by ExampleController#restricted as HTML
2012
+ Authenticating with gds_sso strategy
2013
+ Completed in 0ms
2014
+
2015
+
2016
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-15 13:31:56 +0000
2017
+
2018
+
2019
+ Started GET "/auth/gds/callback?code=01c15754e25db8b5b19d3db424ce4dfa12db6a9e7ad7a3d90262e061fd3c94c4" for 127.0.0.1 at 2012-06-15 13:31:56 +0000
2020
+ Processing by AuthenticationsController#callback as HTML
2021
+ Parameters: {"code"=>"01c15754e25db8b5b19d3db424ce4dfa12db6a9e7ad7a3d90262e061fd3c94c4"}
2022
+ Authenticating with gds_sso strategy
2023
+ Redirected to http://www.example-client.com/restricted
2024
+ Completed 302 Found in 1ms
2025
+
2026
+
2027
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 13:31:57 +0000
2028
+ Processing by ExampleController#restricted as HTML
2029
+ Completed 200 OK in 1ms (Views: 0.6ms)
2030
+
2031
+
2032
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 13:31:57 +0000
2033
+ Processing by ExampleController#restricted as HTML
2034
+ Authenticating with gds_sso strategy
2035
+ Completed in 0ms
2036
+
2037
+
2038
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-15 13:31:57 +0000
2039
+
2040
+
2041
+ Started GET "/auth/gds/callback?code=2c062b374c37d273031353266145d4d4170d7478a1bb20151df4a793348f7e76" for 127.0.0.1 at 2012-06-15 13:31:57 +0000
2042
+ Processing by AuthenticationsController#callback as HTML
2043
+ Parameters: {"code"=>"2c062b374c37d273031353266145d4d4170d7478a1bb20151df4a793348f7e76"}
2044
+ Authenticating with gds_sso strategy
2045
+ Redirected to http://www.example-client.com/restricted
2046
+ Completed 302 Found in 1ms
2047
+
2048
+
2049
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 13:31:57 +0000
2050
+ Processing by ExampleController#restricted as HTML
2051
+ Completed 200 OK in 1ms (Views: 0.4ms)
2052
+
2053
+
2054
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 13:31:57 +0000
2055
+ Processing by ExampleController#restricted as JSON
2056
+ Authenticating with gds_sso_api_access strategy
2057
+ Completed in 147ms
2058
+
2059
+
2060
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-15 13:31:57 +0000
2061
+ Processing by ExampleController#restricted as JSON
2062
+ Authenticating with gds_sso_api_access strategy
2063
+ Completed 200 OK in 1ms (Views: 0.6ms)
2064
+
2065
+
2066
+ Started GET "/" for 127.0.0.1 at 2012-06-21 15:23:51 +0000
2067
+ Processing by ExampleController#index as HTML
2068
+ Rendered text template (0.0ms)
2069
+ Completed 200 OK in 101ms (Views: 100.7ms)
2070
+
2071
+
2072
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-21 15:23:51 +0000
2073
+ Processing by ExampleController#restricted as HTML
2074
+ Authenticating with gds_sso strategy
2075
+ Completed in 109ms
2076
+
2077
+
2078
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-21 15:23:51 +0000
2079
+
2080
+
2081
+ Started GET "/auth/gds/callback?code=1f09ad8d453e4d444493ec40749513a05785a432afad7c92310acde2dbfa3db2" for 127.0.0.1 at 2012-06-21 15:23:53 +0000
2082
+ Processing by AuthenticationsController#callback as HTML
2083
+ Parameters: {"code"=>"1f09ad8d453e4d444493ec40749513a05785a432afad7c92310acde2dbfa3db2"}
2084
+ Authenticating with gds_sso strategy
2085
+ Redirected to http://www.example-client.com/restricted
2086
+ Completed 302 Found in 1ms
2087
+
2088
+
2089
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-21 15:23:53 +0000
2090
+ Processing by ExampleController#restricted as HTML
2091
+ Completed 200 OK in 1ms (Views: 0.5ms)
2092
+
2093
+
2094
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2095
+ Processing by ExampleController#restricted as HTML
2096
+ Authenticating with gds_sso strategy
2097
+ Completed in 1ms
2098
+
2099
+
2100
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2101
+
2102
+
2103
+ Started GET "/auth/gds/callback?code=53b4e6e454c70af55cbba99846c50d4002fc756a0bc2c0592d0a8982cd1ea4d3" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2104
+ Processing by AuthenticationsController#callback as HTML
2105
+ Parameters: {"code"=>"53b4e6e454c70af55cbba99846c50d4002fc756a0bc2c0592d0a8982cd1ea4d3"}
2106
+ Authenticating with gds_sso strategy
2107
+ Redirected to http://www.example-client.com/restricted
2108
+ Completed 302 Found in 1ms
2109
+
2110
+
2111
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2112
+ Processing by ExampleController#restricted as HTML
2113
+ Completed 200 OK in 1ms (Views: 0.5ms)
2114
+
2115
+
2116
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2117
+ Processing by ExampleController#restricted as HTML
2118
+ Authenticating with gds_sso strategy
2119
+ Completed in 0ms
2120
+
2121
+
2122
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2123
+
2124
+
2125
+ Started GET "/auth/gds/callback?code=572e98666919cd2bf3765a3927e3f234e9742ab9ad12a7718b072e01c5381352" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2126
+ Processing by AuthenticationsController#callback as HTML
2127
+ Parameters: {"code"=>"572e98666919cd2bf3765a3927e3f234e9742ab9ad12a7718b072e01c5381352"}
2128
+ Authenticating with gds_sso strategy
2129
+ Redirected to http://www.example-client.com/restricted
2130
+ Completed 302 Found in 1ms
2131
+
2132
+
2133
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2134
+ Processing by ExampleController#restricted as HTML
2135
+ Completed 200 OK in 1ms (Views: 0.3ms)
2136
+
2137
+
2138
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-21 15:23:54 +0000
2139
+ Processing by ExampleController#restricted as JSON
2140
+ Authenticating with gds_sso_api_access strategy
2141
+ Completed in 159ms
2142
+
2143
+
2144
+ Started GET "/restricted" for 127.0.0.1 at 2012-06-21 15:23:55 +0000
2145
+ Processing by ExampleController#restricted as JSON
2146
+ Authenticating with gds_sso_api_access strategy
2147
+ Completed 200 OK in 1ms (Views: 0.5ms)
@@ -6,6 +6,7 @@ describe "Integration of client using GDS-SSO with signonotron" do
6
6
  before :all do
7
7
  wait_for_signonotron_to_start
8
8
  end
9
+
9
10
  before :each do
10
11
  @client_host = 'www.example-client.com'
11
12
  Capybara.current_driver = :mechanize
@@ -28,7 +28,7 @@ module Signonotron2IntegrationHelpers
28
28
 
29
29
  def load_signonotron_fixture
30
30
  fixtures_path = Pathname.new(File.join(File.dirname(__FILE__), '../fixtures/integration'))
31
- app = ENV['SIGNONOTRON_VERSION'] == "1" ? "sign-on-o-tron" : "signonotron2"
31
+ app = "signonotron2"
32
32
  path_to_app = Rails.root.join('..','..','tmp',app)
33
33
 
34
34
  db = YAML.load_file(fixtures_path + "#{app}_database.yml")['test']
@@ -2,9 +2,8 @@ namespace :signonotron do
2
2
  desc "Start signonotron (for integration tests)"
3
3
  task :start => :stop do
4
4
 
5
- @app_to_launch = ENV['SIGNONOTRON_VERSION'] == "1" ? "sign-on-o-tron" : "signonotron2"
5
+ @app_to_launch = "signonotron2"
6
6
 
7
- puts "ENV version: #{ENV['SIGNONOTRON_VERSION']}"
8
7
  puts "Launching: #{@app_to_launch}"
9
8
 
10
9
  gem_root = Pathname.new(File.dirname(__FILE__)) + '..' + '..'
data/test/user_test.rb CHANGED
@@ -8,12 +8,12 @@ class TestUser < Test::Unit::TestCase
8
8
  'uid' => 'abcde',
9
9
  'credentials' => {'token' => 'abcdefg', 'secret' => 'abcdefg'},
10
10
  'info' => {'name' => 'Matt Patterson', 'email' => 'matt@alphagov.co.uk'},
11
- 'extra' => {'user' => {'uid' => 'abcde', 'name' => 'Matt Patterson', 'email' => 'matt@alphagov.co.uk'}}
11
+ 'extra' => {'user' => {'permissions' => []}}
12
12
  }
13
13
  end
14
14
 
15
15
  def test_user_params_creation
16
- expected = {'uid' => 'abcde', 'name' => 'Matt Patterson', 'email' => 'matt@alphagov.co.uk'}
16
+ expected = {'uid' => 'abcde', 'name' => 'Matt Patterson', 'email' => 'matt@alphagov.co.uk', "permissions" => []}
17
17
  assert_equal expected, GDS::SSO::User.user_params_from_auth_hash(@auth_hash)
18
18
  end
19
19
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gds-sso
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.1
5
+ version: 0.7.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matt Patterson
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2012-06-14 00:00:00 Z
14
+ date: 2012-06-21 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - "="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.0.2
45
+ version: 0.0.3
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: *id003
@@ -57,20 +57,9 @@ dependencies:
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: rack
62
- requirement: &id005 !ruby/object:Gem::Requirement
63
- none: false
64
- requirements:
65
- - - "="
66
- - !ruby/object:Gem::Version
67
- version: 1.3.5
68
- type: :runtime
69
- prerelease: false
70
- version_requirements: *id005
71
60
  - !ruby/object:Gem::Dependency
72
61
  name: rake
73
- requirement: &id006 !ruby/object:Gem::Requirement
62
+ requirement: &id005 !ruby/object:Gem::Requirement
74
63
  none: false
75
64
  requirements:
76
65
  - - ~>
@@ -78,10 +67,10 @@ dependencies:
78
67
  version: 0.9.2
79
68
  type: :development
80
69
  prerelease: false
81
- version_requirements: *id006
70
+ version_requirements: *id005
82
71
  - !ruby/object:Gem::Dependency
83
72
  name: mocha
84
- requirement: &id007 !ruby/object:Gem::Requirement
73
+ requirement: &id006 !ruby/object:Gem::Requirement
85
74
  none: false
86
75
  requirements:
87
76
  - - ~>
@@ -89,10 +78,10 @@ dependencies:
89
78
  version: 0.9.0
90
79
  type: :development
91
80
  prerelease: false
92
- version_requirements: *id007
81
+ version_requirements: *id006
93
82
  - !ruby/object:Gem::Dependency
94
83
  name: capybara
95
- requirement: &id008 !ruby/object:Gem::Requirement
84
+ requirement: &id007 !ruby/object:Gem::Requirement
96
85
  none: false
97
86
  requirements:
98
87
  - - ~>
@@ -100,10 +89,10 @@ dependencies:
100
89
  version: 1.1.2
101
90
  type: :development
102
91
  prerelease: false
103
- version_requirements: *id008
92
+ version_requirements: *id007
104
93
  - !ruby/object:Gem::Dependency
105
94
  name: rspec-rails
106
- requirement: &id009 !ruby/object:Gem::Requirement
95
+ requirement: &id008 !ruby/object:Gem::Requirement
107
96
  none: false
108
97
  requirements:
109
98
  - - ~>
@@ -111,10 +100,10 @@ dependencies:
111
100
  version: 2.9.0
112
101
  type: :development
113
102
  prerelease: false
114
- version_requirements: *id009
103
+ version_requirements: *id008
115
104
  - !ruby/object:Gem::Dependency
116
105
  name: capybara-mechanize
117
- requirement: &id010 !ruby/object:Gem::Requirement
106
+ requirement: &id009 !ruby/object:Gem::Requirement
118
107
  none: false
119
108
  requirements:
120
109
  - - ~>
@@ -122,10 +111,10 @@ dependencies:
122
111
  version: 0.3.0
123
112
  type: :development
124
113
  prerelease: false
125
- version_requirements: *id010
114
+ version_requirements: *id009
126
115
  - !ruby/object:Gem::Dependency
127
116
  name: combustion
128
- requirement: &id011 !ruby/object:Gem::Requirement
117
+ requirement: &id010 !ruby/object:Gem::Requirement
129
118
  none: false
130
119
  requirements:
131
120
  - - ~>
@@ -133,10 +122,10 @@ dependencies:
133
122
  version: 0.3.2
134
123
  type: :development
135
124
  prerelease: false
136
- version_requirements: *id011
125
+ version_requirements: *id010
137
126
  - !ruby/object:Gem::Dependency
138
127
  name: gem_publisher
139
- requirement: &id012 !ruby/object:Gem::Requirement
128
+ requirement: &id011 !ruby/object:Gem::Requirement
140
129
  none: false
141
130
  requirements:
142
131
  - - ~>
@@ -144,10 +133,10 @@ dependencies:
144
133
  version: 1.0.0
145
134
  type: :development
146
135
  prerelease: false
147
- version_requirements: *id012
136
+ version_requirements: *id011
148
137
  - !ruby/object:Gem::Dependency
149
138
  name: thor
150
- requirement: &id013 !ruby/object:Gem::Requirement
139
+ requirement: &id012 !ruby/object:Gem::Requirement
151
140
  none: false
152
141
  requirements:
153
142
  - - "="
@@ -155,7 +144,7 @@ dependencies:
155
144
  version: 0.14.6
156
145
  type: :development
157
146
  prerelease: false
158
- version_requirements: *id013
147
+ version_requirements: *id012
159
148
  description: Client for GDS' OAuth 2-based SSO
160
149
  email:
161
150
  - matt@constituentparts.com
@@ -168,7 +157,9 @@ extra_rdoc_files: []
168
157
 
169
158
  files:
170
159
  - app/views/authentications/failure.html.erb
160
+ - app/views/authorisations/cant_signin.html.erb
171
161
  - app/controllers/authentications_controller.rb
162
+ - app/controllers/authorisations_controller.rb
172
163
  - config/routes.rb
173
164
  - lib/gds-sso.rb
174
165
  - lib/gds-sso/controller_methods.rb
@@ -196,8 +187,6 @@ files:
196
187
  - spec/internal/config/database.yml
197
188
  - spec/internal/db/schema.rb
198
189
  - spec/support/signonotron2_integration_helpers.rb
199
- - spec/fixtures/integration/sign-on-o-tron_database.yml
200
- - spec/fixtures/integration/sign-on-o-tron.sql
201
190
  - spec/fixtures/integration/signonotron2.sql
202
191
  - spec/fixtures/integration/signonotron2_database.yml
203
192
  - spec/tasks/signonotron_tasks.rake
@@ -215,7 +204,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
204
  requirements:
216
205
  - - ">="
217
206
  - !ruby/object:Gem::Version
218
- hash: -3744157965083249395
207
+ hash: -1060521028235960891
219
208
  segments:
220
209
  - 0
221
210
  version: "0"
@@ -224,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
213
  requirements:
225
214
  - - ">="
226
215
  - !ruby/object:Gem::Version
227
- hash: -3744157965083249395
216
+ hash: -1060521028235960891
228
217
  segments:
229
218
  - 0
230
219
  version: "0"
@@ -251,8 +240,6 @@ test_files:
251
240
  - spec/internal/config/database.yml
252
241
  - spec/internal/db/schema.rb
253
242
  - spec/support/signonotron2_integration_helpers.rb
254
- - spec/fixtures/integration/sign-on-o-tron_database.yml
255
- - spec/fixtures/integration/sign-on-o-tron.sql
256
243
  - spec/fixtures/integration/signonotron2.sql
257
244
  - spec/fixtures/integration/signonotron2_database.yml
258
245
  - spec/tasks/signonotron_tasks.rake
@@ -1,10 +0,0 @@
1
- -- Clean data from database
2
- DELETE FROM `oauth_access_tokens`;
3
- DELETE FROM `oauth_authorization_codes`;
4
- DELETE FROM `oauth_authorizations`;
5
- DELETE FROM `oauth_clients`;
6
- DELETE FROM `users`;
7
-
8
- -- Setup fixture data
9
- INSERT INTO `oauth_clients` VALUES (1,'GDS_SSO integration test','gds-sso-test','secret','http://www.example-client.com/auth/gds/callback');
10
- INSERT INTO `users` (id,name,email,encrypted_password,uid) VALUES (1,'Test User','test@example-client.com','$2a$04$MdMkVFwTq5GLJJkHS8GLIe6dK1.C4ozzba5ZS5Ks2b/NenVsMGGRW','integration-uid');
@@ -1,5 +0,0 @@
1
- test: &test
2
- adapter: sqlite3
3
- database: db/test.sqlite3
4
- pool: 5
5
- timeout: 5000