gds-sso 9.2.7 → 9.3.0

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.
data/Gemfile CHANGED
@@ -2,3 +2,10 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in gds-sso.gemspec
4
4
  gemspec
5
+
6
+ # The test suite currently assumes a Rails 3.2 client.
7
+ # TODO: Investigate a matrix build against multiple Rails versions.
8
+ gem 'rails', '~> 3.2.19'
9
+
10
+ ## Gems added to resolve dependency resolution
11
+ gem 'mechanize', '2.6.0'
data/lib/gds-sso.rb CHANGED
@@ -2,6 +2,7 @@ require 'rails'
2
2
 
3
3
  require 'gds-sso/config'
4
4
  require 'gds-sso/warden_config'
5
+ require 'omniauth'
5
6
  require 'omniauth-gds'
6
7
 
7
8
  module GDS
@@ -32,12 +33,8 @@ module GDS
32
33
  }
33
34
  end
34
35
 
35
- def self.use_mock_strategies?
36
- ['development', 'test'].include?(Rails.env) && ENV['GDS_SSO_STRATEGY'] != 'real'
37
- end
38
-
39
36
  def self.default_strategies
40
- use_mock_strategies? ? [:mock_gds_sso, :mock_gds_sso_api_access] : [:gds_sso, :gds_bearer_token]
37
+ Config.use_mock_strategies? ? [:mock_gds_sso, :gds_bearer_token] : [:gds_sso, :gds_bearer_token]
41
38
  end
42
39
 
43
40
  config.app_middleware.use Warden::Manager do |config|
@@ -0,0 +1,62 @@
1
+ require 'multi_json'
2
+ require 'oauth2'
3
+
4
+ module GDS
5
+ module SSO
6
+ module BearerToken
7
+ def self.locate(token_string)
8
+ access_token = OAuth2::AccessToken.new(oauth_client, token_string)
9
+ response_body = access_token.get("/user.json?client_id=#{CGI.escape(GDS::SSO::Config.oauth_id)}").body
10
+ user_details = omniauth_style_response(response_body)
11
+ GDS::SSO::Config.user_klass.find_for_gds_oauth(user_details)
12
+ rescue OAuth2::Error
13
+ nil
14
+ end
15
+
16
+ def self.oauth_client
17
+ @oauth_client ||= OAuth2::Client.new(
18
+ GDS::SSO::Config.oauth_id,
19
+ GDS::SSO::Config.oauth_secret,
20
+ :site => GDS::SSO::Config.oauth_root_url
21
+ )
22
+ end
23
+
24
+ # Our User code assumes we're getting our user data back
25
+ # via omniauth and so receiving it in omniauth's preferred
26
+ # structure. Here we're addressing signonotron directly so
27
+ # we need to transform the response ourselves.
28
+ def self.omniauth_style_response(response_body)
29
+ input = MultiJson.decode(response_body)['user']
30
+
31
+ {
32
+ 'uid' => input['uid'],
33
+ 'info' => {
34
+ 'email' => input['email'],
35
+ 'name' => input['name']
36
+ },
37
+ 'extra' => {
38
+ 'user' => {
39
+ 'permissions' => input['permissions'],
40
+ 'organisation_slug' => input['organisation_slug'],
41
+ }
42
+ }
43
+ }
44
+ end
45
+ end
46
+
47
+ module MockBearerToken
48
+ def self.locate(token_string)
49
+ dummy_api_user = GDS::SSO.test_user || GDS::SSO::Config.user_klass.where(email: "dummyapiuser@domain.com").first
50
+ if dummy_api_user.nil?
51
+ dummy_api_user = GDS::SSO::Config.user_klass.new
52
+ dummy_api_user.email = "dummyapiuser@domain.com"
53
+ dummy_api_user.uid = "#{rand(10000)}"
54
+ dummy_api_user.name = "Dummy API user created by gds-sso"
55
+ dummy_api_user.permissions = ["signin"]
56
+ dummy_api_user.save!
57
+ end
58
+ dummy_api_user
59
+ end
60
+ end
61
+ end
62
+ end
@@ -21,6 +21,10 @@ module GDS
21
21
  def self.user_klass
22
22
  user_model.to_s.constantize
23
23
  end
24
+
25
+ def self.use_mock_strategies?
26
+ ['development', 'test'].include?(Rails.env) && ENV['GDS_SSO_STRATEGY'] != 'real'
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -12,7 +12,9 @@ module GDS
12
12
  include Rails.application.routes.url_helpers
13
13
 
14
14
  def self.call(env)
15
- if ! ::GDS::SSO::ApiAccess.api_call?(env)
15
+ if ::GDS::SSO::ApiAccess.api_call?(env)
16
+ [ 401, {'WWW-Authenticate' => %(Bearer error="invalid_token") }, [] ]
17
+ else
16
18
  action(:redirect).call(env)
17
19
  end
18
20
  end
@@ -1,5 +1,5 @@
1
1
  module GDS
2
2
  module SSO
3
- VERSION = "9.2.7"
3
+ VERSION = "9.3.0"
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  require 'warden'
2
- require 'gds-sso/user'
2
+ require 'warden-oauth2'
3
+ require 'gds-sso/bearer_token'
3
4
 
4
5
  def logger
5
6
  if Rails.logger # if we are actually running in a rails app
@@ -65,82 +66,10 @@ Warden::Strategies.add(:gds_sso) do
65
66
  end
66
67
  end
67
68
 
68
- Warden::Strategies.add(:gds_bearer_token) do
69
- def valid?
70
- ::GDS::SSO::ApiAccess.api_call?(env) &&
71
- ::GDS::SSO::ApiAccess.oauth_api_call?(env)
72
- end
73
-
74
- def authenticate!
75
- logger.debug("Authenticating with gds_bearer_token strategy")
76
-
77
- begin
78
- access_token = OAuth2::AccessToken.new(oauth_client, token_from_authorization_header)
79
- response_body = access_token.get('/user.json').body
80
- user_details = omniauth_style_response(response_body)
81
- user = prep_user(user_details)
82
- success!(user)
83
- rescue OAuth2::Error
84
- custom!(unauthorized)
85
- end
86
- end
87
-
88
- def oauth_client
89
- @oauth_client ||= OAuth2::Client.new(
90
- GDS::SSO::Config.oauth_id,
91
- GDS::SSO::Config.oauth_secret,
92
- :site => GDS::SSO::Config.oauth_root_url
93
- )
94
- end
95
-
96
- def token_from_authorization_header
97
- env['HTTP_AUTHORIZATION'].gsub(/Bearer /, '')
98
- end
99
-
100
- # Our User code assumes we're getting our user data back
101
- # via omniauth and so receiving it in omniauth's preferred
102
- # structure. Here we're addressing signonotron directly so
103
- # we need to transform the response ourselves.
104
- #
105
- # There may be a way to simplify matters by having this
106
- # strategy work via omniauth too but I've not worked out how
107
- # to wire that up yet.
108
- def omniauth_style_response(response_body)
109
- input = MultiJson.decode(response_body)['user']
110
-
111
- {
112
- 'uid' => input['uid'],
113
- 'info' => {
114
- 'email' => input['email'],
115
- 'name' => input['name']
116
- },
117
- 'extra' => {
118
- 'user' => {
119
- 'permissions' => input['permissions'],
120
- 'organisation_slug' => input['organisation_slug'],
121
- }
122
- }
123
- }
124
- end
125
-
126
- def prep_user(auth_hash)
127
- user = GDS::SSO::Config.user_klass.find_for_gds_oauth(auth_hash)
128
- custom!(unauthorized) unless user
129
- user
130
- end
131
-
132
- def unauthorized
133
- [
134
- 401,
135
- {
136
- 'Content-Type' => 'text/plain',
137
- 'Content-Length' => '0',
138
- 'WWW-Authenticate' => %(Bearer error="invalid_token")
139
- },
140
- []
141
- ]
142
- end
69
+ Warden::OAuth2.configure do |config|
70
+ config.token_model = GDS::SSO::Config.use_mock_strategies? ? GDS::SSO::MockBearerToken : GDS::SSO::BearerToken
143
71
  end
72
+ Warden::Strategies.add(:gds_bearer_token, Warden::OAuth2::Strategies::Bearer)
144
73
 
145
74
  Warden::Strategies.add(:mock_gds_sso) do
146
75
  def valid?
@@ -168,27 +97,3 @@ Warden::Strategies.add(:mock_gds_sso) do
168
97
  end
169
98
  end
170
99
  end
171
-
172
- Warden::Strategies.add(:mock_gds_sso_api_access) do
173
- def valid?
174
- ::GDS::SSO::ApiAccess.api_call?(env)
175
- end
176
-
177
- def authenticate!
178
- logger.debug("Authenticating with mock_gds_sso_api_access strategy")
179
- dummy_api_user = GDS::SSO.test_user || GDS::SSO::Config.user_klass.where(email: "dummyapiuser@domain.com").first
180
- if dummy_api_user.nil?
181
- dummy_api_user = GDS::SSO::Config.user_klass.new(
182
- {
183
- email: "dummyapiuser@domain.com",
184
- uid: "#{rand(10000)}",
185
- name: "Dummy API user created by gds-sso"
186
- },
187
- {as: :oauth}
188
- )
189
- dummy_api_user.permissions = ["signin"]
190
- dummy_api_user.save!
191
- end
192
- success!(dummy_api_user)
193
- end
194
- end
@@ -1,4 +1,7 @@
1
1
  DELETE FROM `oauth_access_tokens`;
2
2
 
3
- INSERT INTO oauth_access_tokens VALUES
4
- (NULL, 1, 1, 'caaeb53be5c7277fb0ef158181bfd1537b57f9e3b83eb795be3cd0af6e118b28', '1bc343797483954d7306d67e96687feccdfdaa8b23ed662ae23e2b03e6661d16', 307584000, NULL, '2012-06-27 13:57:47', NULL);
3
+ INSERT INTO oauth_access_tokens (resource_owner_id, application_id, token, refresh_token, expires_in, created_at)
4
+ VALUES (1, 1, 'caaeb53be5c7277fb0ef158181bfd1537b57f9e3b83eb795be3cd0af6e118b28', '1bc343797483954d7306d67e96687feccdfdaa8b23ed662ae23e2b03e6661d16', 307584000, '2012-06-27 13:57:47');
5
+
6
+ INSERT INTO oauth_access_tokens (resource_owner_id, application_id, token, refresh_token, expires_in, created_at)
7
+ VALUES (1, 2, '98c72f4da02fdc43398e029d05567542944d2a9b0df3c20b0accd8bd6c5dc728', 'e2da0489a58219fd4f542139909737627874ceacd2af23f5c268ccecb36e85af', 307584000, '2014-07-14 09:06:14');
@@ -8,10 +8,16 @@ DELETE FROM `users`;
8
8
  -- Setup fixture data
9
9
  INSERT INTO `oauth_applications` (id, name, uid, secret, redirect_uri, created_at, updated_at, home_uri, description)
10
10
  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', 'http://home.com', 'GDS_SSO integration test');
11
+ INSERT INTO `oauth_applications` (id, name, uid, secret, redirect_uri, created_at, updated_at, home_uri, description)
12
+ VALUES (2,'A different appilcation','application-2','different secret','http://www.example-client2.com/auth/gds/callback','2014-07-14-09:07:32','2014-07-14-09:07:32', 'http://www.example-client2.com', '');
13
+
11
14
  INSERT INTO `users` (id, email, encrypted_password, password_salt, created_at, updated_at, confirmed_at, name, uid, role)
12
15
  VALUES (1,'test@example-client.com','bb8e19edbaa1e7721abe0faa5c1663a7685950093b8c7eceb0f2e3889bdea4c5f17ca97820b2c663edf46ea532d1a9baa04b680fc537b4de8a3f376dd28e3ffd','MpLsZ8q1UaAojTa6bTC6','2012-04-19 13:26:54','2012-04-19 13:26:54','2012-04-19 13:26:54','Test User','integration-uid', "normal");
13
- INSERT INTO `permissions` (id, user_id, application_id, permissions) VALUES (1,1,1,"---
16
+
17
+ INSERT INTO `permissions` (user_id, application_id, permissions) VALUES (1,1,"---
18
+ - signin
19
+ ");
20
+ INSERT INTO `permissions` (user_id, application_id, permissions) VALUES (1,2,"---
14
21
  - signin
15
22
  ");
16
-
17
23
 
@@ -1,376 +1,412 @@
1
1
  Connecting to database specified by database.yml
2
-  (18.4ms) select sqlite_version(*)
3
-  (13.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "uid" varchar(255) NOT NULL, "email" varchar(255) NOT NULL, "remotely_signed_out" boolean, "permissions" text, "organisation_slug" varchar(255))
4
-  (8.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
5
-  (9.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2
+  (22.7ms) select sqlite_version(*)
3
+  (16.0ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "uid" varchar(255) NOT NULL, "email" varchar(255) NOT NULL, "remotely_signed_out" boolean, "permissions" text, "organisation_slug" varchar(255))
4
+  (8.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
5
+  (9.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6
6
   (0.1ms) begin transaction
7
- SQL (31.3ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d36908"]]
8
-  (34.3ms) commit transaction
7
+ SQL (4.0ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d36713"]]
8
+  (13.6ms) commit transaction
9
9
   (0.1ms) begin transaction
10
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d32371"]]
11
-  (24.5ms) commit transaction
10
+ SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d34124"]]
11
+  (9.8ms) commit transaction
12
12
  WARNING: Can't mass-assign protected attributes: uid, name, permissions
13
- Processing by Api::UserController#update as HTML
14
- Parameters: {"uid"=>"a1s2d36908"}
15
- Rendered /home/jenkins/workspace/govuk_gds_sso/app/views/authorisations/unauthorised.html.erb within layouts/unauthorised (0.3ms)
16
- Completed 403 Forbidden in 39.8ms (Views: 13.5ms | ActiveRecord: 0.0ms)
13
+ Processing by Api::UserController#reauth as HTML
14
+ Parameters: {"uid"=>"a1s2d36713"}
15
+ Rendered /home/jenkins/workspace/govuk_gds_sso/app/views/authorisations/unauthorised.html.erb within layouts/unauthorised (0.2ms)
16
+ Completed 403 Forbidden in 40.0ms (Views: 39.2ms | ActiveRecord: 0.0ms)
17
17
   (0.1ms) begin transaction
18
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d38535"]]
19
-  (12.5ms) commit transaction
18
+ SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d36796"]]
19
+  (10.5ms) commit transaction
20
20
   (0.1ms) begin transaction
21
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d37781"]]
22
-  (10.3ms) commit transaction
21
+ SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d33045"]]
22
+  (11.3ms) commit transaction
23
+ Processing by Api::UserController#reauth as HTML
24
+ Parameters: {"uid"=>"nonexistent-user"}
25
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'nonexistent-user' LIMIT 1
26
+ Completed 200 OK in 6.1ms (ActiveRecord: 0.3ms)
27
+  (0.1ms) begin transaction
28
+ SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d34574"]]
29
+  (10.8ms) commit transaction
30
+  (0.1ms) begin transaction
31
+ SQL (0.1ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d32625"]]
32
+  (11.6ms) commit transaction
33
+ Processing by Api::UserController#reauth as HTML
34
+ Parameters: {"uid"=>"a1s2d34574"}
35
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'a1s2d34574' LIMIT 1
36
+  (0.0ms) begin transaction
37
+  (0.2ms) UPDATE "users" SET "remotely_signed_out" = 't', "permissions" = '---
38
+ - signin
39
+ ' WHERE "users"."id" = 5
40
+  (13.8ms) commit transaction
41
+ Completed 200 OK in 17.9ms (ActiveRecord: 14.2ms)
42
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 5]]
43
+  (0.1ms) begin transaction
44
+ SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d34826"]]
45
+  (12.4ms) commit transaction
46
+  (0.0ms) begin transaction
47
+ SQL (0.1ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d35052"]]
48
+  (23.7ms) commit transaction
23
49
  Processing by Api::UserController#update as HTML
24
- Parameters: {"uid"=>"a1s2d38535"}
25
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'a1s2d38535' LIMIT 1
50
+ Parameters: {"uid"=>"a1s2d34826"}
51
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'a1s2d34826' LIMIT 1
26
52
   (0.0ms) begin transaction
27
53
   (0.2ms) UPDATE "users" SET "email" = 'user@domain.com', "name" = 'Joshua Marshall', "permissions" = '---
28
54
  - signin
29
55
  - new permission
30
- ', "organisation_slug" = 'justice-league' WHERE "users"."id" = 3
31
-  (13.6ms) commit transaction
32
- Completed 200 OK in 21.3ms (ActiveRecord: 14.0ms)
33
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 3]]
56
+ ', "organisation_slug" = 'justice-league' WHERE "users"."id" = 7
57
+  (11.1ms) commit transaction
58
+ Completed 200 OK in 14.9ms (ActiveRecord: 11.5ms)
59
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 7]]
34
60
   (0.1ms) begin transaction
35
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d37830"]]
36
-  (12.2ms) commit transaction
61
+ SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d31326"]]
62
+  (12.4ms) commit transaction
37
63
   (0.1ms) begin transaction
38
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d32204"]]
39
-  (10.5ms) commit transaction
64
+ SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d35875"]]
65
+  (11.9ms) commit transaction
40
66
  WARNING: Can't mass-assign protected attributes: uid, name, permissions
41
- Processing by Api::UserController#reauth as HTML
42
- Parameters: {"uid"=>"a1s2d37830"}
43
- Completed 403 Forbidden in 1.5ms (Views: 0.9ms | ActiveRecord: 0.0ms)
67
+ Processing by Api::UserController#update as HTML
68
+ Parameters: {"uid"=>"a1s2d31326"}
69
+ Completed 403 Forbidden in 1.4ms (Views: 0.9ms | ActiveRecord: 0.0ms)
70
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:52 +0000
71
+ Processing by ExampleController#restricted as JSON
72
+ Completed in 231.0ms
73
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:52 +0000
74
+ Processing by ExampleController#restricted as JSON
75
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
76
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'test@example-client.com' LIMIT 1
44
77
   (0.1ms) begin transaction
45
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d31716"]]
46
-  (14.8ms) commit transaction
78
+ SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "test@example-client.com"], ["name", "Test User"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "integration-uid"]]
79
+  (13.4ms) commit transaction
80
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
81
+  (0.0ms) begin transaction
82
+  (0.2ms) UPDATE "users" SET "permissions" = '---
83
+ - signin
84
+ ' WHERE "users"."id" = 11
85
+  (10.9ms) commit transaction
86
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
87
+  (0.0ms) begin transaction
88
+  (0.2ms) UPDATE "users" SET "permissions" = '---
89
+ - signin
90
+ ' WHERE "users"."id" = 11
91
+  (10.5ms) commit transaction
92
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
93
+  (0.0ms) begin transaction
94
+  (0.2ms) UPDATE "users" SET "permissions" = '---
95
+ - signin
96
+ ' WHERE "users"."id" = 11
97
+  (11.9ms) commit transaction
98
+  (0.0ms) begin transaction
99
+  (0.1ms) UPDATE "users" SET "remotely_signed_out" = 'f', "permissions" = '---
100
+ - signin
101
+ ' WHERE "users"."id" = 11
102
+  (8.2ms) commit transaction
103
+ Completed 200 OK in 583.8ms (Views: 3.0ms | ActiveRecord: 56.9ms)
104
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-07-18 13:10:53 +0000
105
+ Processing by ExampleController#this_requires_signin_permission as JSON
106
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
47
107
   (0.1ms) begin transaction
48
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d31621"]]
49
-  (12.3ms) commit transaction
50
- Processing by Api::UserController#reauth as HTML
51
- Parameters: {"uid"=>"nonexistent-user"}
52
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'nonexistent-user' LIMIT 1
53
- Completed 200 OK in 1.1ms (ActiveRecord: 0.2ms)
108
+  (0.2ms) UPDATE "users" SET "permissions" = '---
109
+ - signin
110
+ ' WHERE "users"."id" = 11
111
+  (10.0ms) commit transaction
112
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
54
113
   (0.0ms) begin transaction
55
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d3573"]]
56
-  (15.8ms) commit transaction
57
-  (0.1ms) begin transaction
58
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "ssopushuser@legit.com"], ["name", "SSO Push user"], ["organisation_slug", nil], ["permissions", "---\n- signin\n- user_update_permission\n"], ["remotely_signed_out", nil], ["uid", "a1s2d35885"]]
59
-  (13.5ms) commit transaction
60
- Processing by Api::UserController#reauth as HTML
61
- Parameters: {"uid"=>"a1s2d3573"}
62
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'a1s2d3573' LIMIT 1
114
+  (0.1ms) UPDATE "users" SET "permissions" = '---
115
+ - signin
116
+ ' WHERE "users"."id" = 11
117
+  (10.6ms) commit transaction
118
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
119
+  (0.0ms) begin transaction
120
+  (0.1ms) UPDATE "users" SET "permissions" = '---
121
+ - signin
122
+ ' WHERE "users"."id" = 11
123
+  (9.4ms) commit transaction
124
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
125
+  (0.1ms) begin transaction
126
+  (0.1ms) UPDATE "users" SET "permissions" = '---
127
+ - signin
128
+ ' WHERE "users"."id" = 11
129
+  (9.4ms) commit transaction
63
130
   (0.0ms) begin transaction
64
-  (0.2ms) UPDATE "users" SET "remotely_signed_out" = 't', "permissions" = '---
131
+  (0.1ms) UPDATE "users" SET "permissions" = '---
65
132
  - signin
66
- ' WHERE "users"."id" = 9
67
-  (13.3ms) commit transaction
68
- Completed 200 OK in 16.6ms (ActiveRecord: 13.7ms)
69
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 9]]
70
- Started GET "/" for 127.0.0.1 at 2014-05-28 10:01:15 +0000
133
+ ' WHERE "users"."id" = 11
134
+  (8.9ms) commit transaction
135
+ Completed 200 OK in 209.9ms (Views: 0.5ms | ActiveRecord: 49.9ms)
136
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:53 +0000
137
+ Processing by ExampleController#restricted as JSON
138
+ Completed in 22.9ms
139
+ Started GET "/" for 127.0.0.1 at 2014-07-18 13:10:54 +0000
71
140
  Processing by ExampleController#index as HTML
72
- Completed 200 OK in 3.4ms (Views: 2.9ms | ActiveRecord: 0.0ms)
73
- Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-05-28 10:01:16 +0000
74
- Processing by ExampleController#this_requires_signin_permission as HTML
141
+ Completed 200 OK in 0.8ms (Views: 0.4ms | ActiveRecord: 0.0ms)
142
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:54 +0000
143
+ Processing by ExampleController#restricted as HTML
75
144
  Authenticating with gds_sso strategy
76
- Completed in 38.9ms
77
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:16 +0000
78
- Started GET "/auth/gds/callback?code=faf6aab82246cb23fef1879ead32e8505144ef734fb2432626a0667d3af46c76&state=0d6136bf4b8f56ea9bca777052b46067399c6d0703a7d78a" for 127.0.0.1 at 2014-05-28 10:01:17 +0000
145
+ Completed in 0.3ms
146
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:54 +0000
147
+ Started GET "/auth/gds/callback?code=5975db777d300dea19d732e349a1e11f7a32642833159c9df9906db5ffb9baa2&state=f0484e1e5be76776d650d5e35cf7a598239a5b50461aa916" for 127.0.0.1 at 2014-07-18 13:10:55 +0000
79
148
  Processing by AuthenticationsController#callback as HTML
80
- Parameters: {"code"=>"faf6aab82246cb23fef1879ead32e8505144ef734fb2432626a0667d3af46c76", "state"=>"0d6136bf4b8f56ea9bca777052b46067399c6d0703a7d78a"}
149
+ Parameters: {"code"=>"5975db777d300dea19d732e349a1e11f7a32642833159c9df9906db5ffb9baa2", "state"=>"f0484e1e5be76776d650d5e35cf7a598239a5b50461aa916"}
81
150
  Authenticating with gds_sso strategy
82
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
83
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'test@example-client.com' LIMIT 1
151
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
84
152
   (0.1ms) begin transaction
85
- SQL (0.2ms) INSERT INTO "users" ("email", "name", "organisation_slug", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?, ?) [["email", "test@example-client.com"], ["name", "Test User"], ["organisation_slug", nil], ["permissions", "---\n- signin\n"], ["remotely_signed_out", nil], ["uid", "integration-uid"]]
86
-  (21.7ms) commit transaction
87
-  (0.1ms) begin transaction
88
-  (0.2ms) UPDATE "users" SET "remotely_signed_out" = 'f', "permissions" = '---
153
+  (0.2ms) UPDATE "users" SET "permissions" = '---
154
+ - signin
155
+ ' WHERE "users"."id" = 11
156
+  (9.1ms) commit transaction
157
+  (0.0ms) begin transaction
158
+  (0.1ms) UPDATE "users" SET "permissions" = '---
89
159
  - signin
90
160
  ' WHERE "users"."id" = 11
91
-  (13.8ms) commit transaction
92
- Redirected to http://www.example-client.com/this_requires_signin_permission
93
- Completed 302 Found in 42.2ms (ActiveRecord: 36.3ms)
94
- Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-05-28 10:01:17 +0000
95
- Processing by ExampleController#this_requires_signin_permission as HTML
161
+  (10.0ms) commit transaction
162
+ Redirected to http://www.example-client.com/restricted
163
+ Completed 302 Found in 24.6ms (ActiveRecord: 19.7ms)
164
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:55 +0000
165
+ Processing by ExampleController#restricted as HTML
96
166
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
97
- Completed 200 OK in 1.8ms (Views: 0.4ms | ActiveRecord: 0.2ms)
98
- Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-05-28 10:01:17 +0000
99
- Processing by ExampleController#this_requires_signin_permission as HTML
167
+ Completed 200 OK in 1.4ms (Views: 0.4ms | ActiveRecord: 0.2ms)
168
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:55 +0000
169
+ Processing by ExampleController#restricted as HTML
100
170
  Authenticating with gds_sso strategy
101
- Completed in 0.2ms
102
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:17 +0000
103
- Started GET "/auth/gds/callback?code=29b5e159e6fb693ebc12b812a4565419724e8690ba041aedf91176d321b70320&state=6ced3aac4b4c56591263d743d0998eae8fb01fbcdd1473c4" for 127.0.0.1 at 2014-05-28 10:01:18 +0000
171
+ Completed in 0.3ms
172
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:55 +0000
173
+ Started GET "/auth/gds/callback?code=5afbdc652a40e339df83fd3b72dd1e08ac20c9e65887be4a919fb40b4b7658b4&state=f850257ee9f2c743b5ea0ee0f0360b96158b629566127ccc" for 127.0.0.1 at 2014-07-18 13:10:55 +0000
104
174
  Processing by AuthenticationsController#callback as HTML
105
- Parameters: {"code"=>"29b5e159e6fb693ebc12b812a4565419724e8690ba041aedf91176d321b70320", "state"=>"6ced3aac4b4c56591263d743d0998eae8fb01fbcdd1473c4"}
175
+ Parameters: {"code"=>"5afbdc652a40e339df83fd3b72dd1e08ac20c9e65887be4a919fb40b4b7658b4", "state"=>"f850257ee9f2c743b5ea0ee0f0360b96158b629566127ccc"}
106
176
  Authenticating with gds_sso strategy
107
177
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
108
-  (0.0ms) begin transaction
178
+  (0.1ms) begin transaction
109
179
   (0.2ms) UPDATE "users" SET "permissions" = '---
110
180
  - signin
111
181
  ' WHERE "users"."id" = 11
112
-  (15.1ms) commit transaction
182
+  (11.7ms) commit transaction
113
183
   (0.1ms) begin transaction
114
184
   (0.2ms) UPDATE "users" SET "permissions" = '---
115
185
  - signin
116
186
  ' WHERE "users"."id" = 11
117
-  (9.8ms) commit transaction
118
- Redirected to http://www.example-client.com/this_requires_signin_permission
119
- Completed 302 Found in 29.9ms (ActiveRecord: 25.5ms)
120
- Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-05-28 10:01:18 +0000
121
- Processing by ExampleController#this_requires_signin_permission as HTML
187
+  (8.0ms) commit transaction
188
+ Redirected to http://www.example-client.com/restricted
189
+ Completed 302 Found in 25.3ms (ActiveRecord: 20.4ms)
190
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:55 +0000
191
+ Processing by ExampleController#restricted as HTML
122
192
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
123
- Completed 200 OK in 1.5ms (Views: 0.3ms | ActiveRecord: 0.2ms)
124
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:18 +0000
193
+ Completed 200 OK in 1.3ms (Views: 0.4ms | ActiveRecord: 0.2ms)
194
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:55 +0000
125
195
  Processing by ExampleController#restricted as HTML
126
196
  Authenticating with gds_sso strategy
127
- Completed in 0.6ms
128
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:18 +0000
129
- Started GET "/auth/gds/callback?code=395fdc86b83c4935e168b413a3f2f4f56214dc097f7cd0e2dd20d4b87ad57316&state=05f426033c7da87aac3fd1d66714bd72bb90a0f541feedab" for 127.0.0.1 at 2014-05-28 10:01:18 +0000
197
+ Completed in 0.2ms
198
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:55 +0000
199
+ Started GET "/auth/gds/callback?code=e41b27b6bcd8d06e7f62f794a6254edcefe1463a770a5b048a3399da9b3d2456&state=f3c6d7b10c576e26ffcac9aa2e24a60fc0764fe6b5843d3f" for 127.0.0.1 at 2014-07-18 13:10:56 +0000
130
200
  Processing by AuthenticationsController#callback as HTML
131
- Parameters: {"code"=>"395fdc86b83c4935e168b413a3f2f4f56214dc097f7cd0e2dd20d4b87ad57316", "state"=>"05f426033c7da87aac3fd1d66714bd72bb90a0f541feedab"}
201
+ Parameters: {"code"=>"e41b27b6bcd8d06e7f62f794a6254edcefe1463a770a5b048a3399da9b3d2456", "state"=>"f3c6d7b10c576e26ffcac9aa2e24a60fc0764fe6b5843d3f"}
132
202
  Authenticating with gds_sso strategy
133
203
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
134
-  (0.1ms) begin transaction
135
-  (0.2ms) UPDATE "users" SET "permissions" = '---
204
+  (0.0ms) begin transaction
205
+  (0.3ms) UPDATE "users" SET "permissions" = '---
136
206
  - signin
137
207
  ' WHERE "users"."id" = 11
138
-  (13.2ms) commit transaction
208
+  (21.5ms) commit transaction
139
209
   (0.1ms) begin transaction
140
210
   (0.2ms) UPDATE "users" SET "permissions" = '---
141
211
  - signin
142
212
  ' WHERE "users"."id" = 11
143
-  (12.7ms) commit transaction
213
+  (14.7ms) commit transaction
144
214
  Redirected to http://www.example-client.com/restricted
145
- Completed 302 Found in 32.2ms (ActiveRecord: 26.6ms)
146
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:18 +0000
215
+ Completed 302 Found in 68.1ms (ActiveRecord: 36.9ms)
216
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:56 +0000
147
217
  Processing by ExampleController#restricted as HTML
148
218
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
149
- Completed 200 OK in 1.7ms (Views: 0.4ms | ActiveRecord: 0.2ms)
150
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:18 +0000
151
- Processing by ExampleController#restricted as HTML
219
+ Completed 200 OK in 1.7ms (Views: 0.3ms | ActiveRecord: 0.2ms)
220
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-07-18 13:10:56 +0000
221
+ Processing by ExampleController#this_requires_signin_permission as HTML
152
222
  Authenticating with gds_sso strategy
153
223
  Completed in 0.3ms
154
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:18 +0000
155
- Started GET "/auth/gds/callback?code=287809a753f9fab30b73667a774f37a2cf7262312f41aecb9467052f2808769d&state=65566e10cd35a26c965c9b3260d3b111c952d6beea198613" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
224
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:56 +0000
225
+ Started GET "/auth/gds/callback?code=210b5d58b9ffe1bea1b9de5e2d153fd780f008363d642524024c378b62238e07&state=26b44a48b59d4ec1f55b4d079dcd744ffe007801fb59c273" for 127.0.0.1 at 2014-07-18 13:10:56 +0000
156
226
  Processing by AuthenticationsController#callback as HTML
157
- Parameters: {"code"=>"287809a753f9fab30b73667a774f37a2cf7262312f41aecb9467052f2808769d", "state"=>"65566e10cd35a26c965c9b3260d3b111c952d6beea198613"}
227
+ Parameters: {"code"=>"210b5d58b9ffe1bea1b9de5e2d153fd780f008363d642524024c378b62238e07", "state"=>"26b44a48b59d4ec1f55b4d079dcd744ffe007801fb59c273"}
158
228
  Authenticating with gds_sso strategy
159
229
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
160
230
   (0.1ms) begin transaction
161
231
   (0.2ms) UPDATE "users" SET "permissions" = '---
162
232
  - signin
163
233
  ' WHERE "users"."id" = 11
164
-  (11.0ms) commit transaction
234
+  (10.3ms) commit transaction
165
235
   (0.1ms) begin transaction
166
236
   (0.2ms) UPDATE "users" SET "permissions" = '---
167
237
  - signin
168
238
  ' WHERE "users"."id" = 11
169
-  (9.0ms) commit transaction
170
- Redirected to http://www.example-client.com/restricted
171
- Completed 302 Found in 26.5ms (ActiveRecord: 20.8ms)
172
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
173
- Processing by ExampleController#restricted as HTML
239
+  (8.9ms) commit transaction
240
+ Redirected to http://www.example-client.com/this_requires_signin_permission
241
+ Completed 302 Found in 24.5ms (ActiveRecord: 19.8ms)
242
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-07-18 13:10:56 +0000
243
+ Processing by ExampleController#this_requires_signin_permission as HTML
174
244
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
175
- Completed 200 OK in 1.7ms (Views: 0.5ms | ActiveRecord: 0.2ms)
176
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
177
- Processing by ExampleController#restricted as HTML
245
+ Completed 200 OK in 1.7ms (Views: 0.4ms | ActiveRecord: 0.2ms)
246
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-07-18 13:10:56 +0000
247
+ Processing by ExampleController#this_requires_signin_permission as HTML
178
248
  Authenticating with gds_sso strategy
179
249
  Completed in 0.2ms
180
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
181
- Started GET "/auth/gds/callback?code=07998a069ae35cedf19d2ae351243b8852a5c1be8d02659290c0b411f9abd216&state=b7048d5a343fc6946e7fd6419d0b458e53890e0e1ed0fe3b" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
250
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:56 +0000
251
+ Started GET "/auth/gds/callback?code=a3b9018ca8bd15809018c13c3647e342178769d152181e7577286d8c69ccb98e&state=a53779c75892eac4775139c3bad3dc74c7df9965c47b22ee" for 127.0.0.1 at 2014-07-18 13:10:57 +0000
182
252
  Processing by AuthenticationsController#callback as HTML
183
- Parameters: {"code"=>"07998a069ae35cedf19d2ae351243b8852a5c1be8d02659290c0b411f9abd216", "state"=>"b7048d5a343fc6946e7fd6419d0b458e53890e0e1ed0fe3b"}
253
+ Parameters: {"code"=>"a3b9018ca8bd15809018c13c3647e342178769d152181e7577286d8c69ccb98e", "state"=>"a53779c75892eac4775139c3bad3dc74c7df9965c47b22ee"}
184
254
  Authenticating with gds_sso strategy
185
255
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
186
256
   (0.0ms) begin transaction
187
257
   (0.2ms) UPDATE "users" SET "permissions" = '---
188
258
  - signin
189
259
  ' WHERE "users"."id" = 11
190
-  (15.0ms) commit transaction
260
+  (11.4ms) commit transaction
191
261
   (0.1ms) begin transaction
192
262
   (0.2ms) UPDATE "users" SET "permissions" = '---
193
263
  - signin
194
264
  ' WHERE "users"."id" = 11
195
-  (12.2ms) commit transaction
196
- Redirected to http://www.example-client.com/restricted
197
- Completed 302 Found in 32.3ms (ActiveRecord: 27.8ms)
198
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
199
- Processing by ExampleController#restricted as HTML
200
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
201
- Completed 200 OK in 1.5ms (Views: 0.3ms | ActiveRecord: 0.2ms)
202
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
265
+  (6.4ms) commit transaction
266
+ Redirected to http://www.example-client.com/this_requires_signin_permission
267
+ Completed 302 Found in 22.8ms (ActiveRecord: 18.5ms)
268
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-07-18 13:10:57 +0000
269
+ Processing by ExampleController#this_requires_signin_permission as HTML
270
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
271
+ Completed 200 OK in 1.5ms (Views: 0.3ms | ActiveRecord: 0.1ms)
272
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:57 +0000
203
273
  Processing by ExampleController#restricted as HTML
204
274
  Authenticating with gds_sso strategy
205
- Completed in 0.4ms
206
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
207
- Started GET "/auth/gds/callback?code=3b6e908312a657f10f1707f88805d4b7f3ca33eed1692822ab5537384849292e&state=22c2ad34c40644a633fe408a01f949947306e62bfd39938c" for 127.0.0.1 at 2014-05-28 10:01:19 +0000
275
+ Completed in 0.3ms
276
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:57 +0000
277
+ Started GET "/auth/gds/callback?code=f43f0a109a92ca6da4462731e056222aeb34085532afdc2dbbdeee8765b3bb1b&state=2b9882146c18215fb72946ccba69fbfec2f5c728e691eefa" for 127.0.0.1 at 2014-07-18 13:10:57 +0000
208
278
  Processing by AuthenticationsController#callback as HTML
209
- Parameters: {"code"=>"3b6e908312a657f10f1707f88805d4b7f3ca33eed1692822ab5537384849292e", "state"=>"22c2ad34c40644a633fe408a01f949947306e62bfd39938c"}
279
+ Parameters: {"code"=>"f43f0a109a92ca6da4462731e056222aeb34085532afdc2dbbdeee8765b3bb1b", "state"=>"2b9882146c18215fb72946ccba69fbfec2f5c728e691eefa"}
210
280
  Authenticating with gds_sso strategy
211
281
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
212
282
   (0.1ms) begin transaction
213
283
   (0.2ms) UPDATE "users" SET "permissions" = '---
214
284
  - signin
215
285
  ' WHERE "users"."id" = 11
216
-  (11.4ms) commit transaction
286
+  (17.2ms) commit transaction
217
287
   (0.1ms) begin transaction
218
288
   (0.2ms) UPDATE "users" SET "permissions" = '---
219
289
  - signin
220
290
  ' WHERE "users"."id" = 11
221
-  (13.6ms) commit transaction
291
+  (7.8ms) commit transaction
222
292
  Redirected to http://www.example-client.com/restricted
223
- Completed 302 Found in 31.1ms (ActiveRecord: 25.6ms)
224
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
293
+ Completed 302 Found in 30.9ms (ActiveRecord: 25.6ms)
294
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:57 +0000
225
295
  Processing by ExampleController#restricted as HTML
226
296
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
227
- Completed 200 OK in 1.6ms (Views: 0.4ms | ActiveRecord: 0.2ms)
228
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'test@example-client.com' LIMIT 1
229
-  (0.1ms) begin transaction
230
-  (0.2ms) UPDATE "users" SET "remotely_signed_out" = 't', "permissions" = '---
231
- - signin
232
- ' WHERE "users"."id" = 11
233
-  (16.4ms) commit transaction
234
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
297
+ Completed 200 OK in 1.7ms (Views: 0.4ms | ActiveRecord: 0.2ms)
298
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-19 09:05:57 +0000
235
299
  Processing by ExampleController#restricted as HTML
236
300
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
301
+ Completed 200 OK in 2.0ms (Views: 0.4ms | ActiveRecord: 0.2ms)
302
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:58 +0000
303
+ Processing by ExampleController#restricted as HTML
237
304
  Authenticating with gds_sso strategy
238
- Completed in 1.2ms
239
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
240
- Started GET "/auth/gds/callback?code=59f3ff77264922e41505a1d74edf5086fb9c0ab0ce7eaeda35e3eb9c5e1d73f5&state=50445985dfd8188201ecf12097a6d45fd8b2fb4a1567d8a5" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
305
+ Completed in 0.4ms
306
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:58 +0000
307
+ Started GET "/auth/gds/callback?code=6e86a5ac211079540a91bd24d9e2d288bf63eca3eae8d673175e32e32e7f7130&state=9d588c1b54ad3155f986f4faaed309143cc4ccb34810385e" for 127.0.0.1 at 2014-07-18 13:10:58 +0000
241
308
  Processing by AuthenticationsController#callback as HTML
242
- Parameters: {"code"=>"59f3ff77264922e41505a1d74edf5086fb9c0ab0ce7eaeda35e3eb9c5e1d73f5", "state"=>"50445985dfd8188201ecf12097a6d45fd8b2fb4a1567d8a5"}
309
+ Parameters: {"code"=>"6e86a5ac211079540a91bd24d9e2d288bf63eca3eae8d673175e32e32e7f7130", "state"=>"9d588c1b54ad3155f986f4faaed309143cc4ccb34810385e"}
243
310
  Authenticating with gds_sso strategy
244
311
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
245
-  (0.0ms) begin transaction
312
+  (0.1ms) begin transaction
246
313
   (0.2ms) UPDATE "users" SET "permissions" = '---
247
314
  - signin
248
315
  ' WHERE "users"."id" = 11
249
-  (17.5ms) commit transaction
250
-  (0.1ms) begin transaction
251
-  (0.2ms) UPDATE "users" SET "remotely_signed_out" = 'f', "permissions" = '---
316
+  (11.8ms) commit transaction
317
+  (0.0ms) begin transaction
318
+  (0.1ms) UPDATE "users" SET "permissions" = '---
252
319
  - signin
253
320
  ' WHERE "users"."id" = 11
254
-  (15.5ms) commit transaction
321
+  (12.0ms) commit transaction
255
322
  Redirected to http://www.example-client.com/restricted
256
- Completed 302 Found in 39.0ms (ActiveRecord: 33.7ms)
257
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
323
+ Completed 302 Found in 28.9ms (ActiveRecord: 24.4ms)
324
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:58 +0000
258
325
  Processing by ExampleController#restricted as HTML
259
326
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
260
- Completed 200 OK in 1.4ms (Views: 0.3ms | ActiveRecord: 0.2ms)
261
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
327
+ Completed 200 OK in 1.4ms (Views: 0.4ms | ActiveRecord: 0.2ms)
328
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-19 09:15:58 +0000
262
329
  Processing by ExampleController#restricted as HTML
263
330
  Authenticating with gds_sso strategy
264
331
  Completed in 0.3ms
265
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
266
- Started GET "/auth/gds/callback?code=15a391624cbed2a7b33d9678b6534883c9fa02949bb1c08fde5cbccbc4eacee5&state=9d596518fffb5957e71141544b4f3252a3bc869f5e279de7" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
332
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-19 09:15:58 +0000
333
+ Started GET "/auth/gds/callback?code=1a3140979bcf7b3277dcf0246e252c3b07673b16c0960dc9fd11d5338079cd09&state=8abd43f4c4bf907ae34f3f3fc4b6e88f0dddc47b7304c202" for 127.0.0.1 at 2014-07-19 09:15:58 +0000
267
334
  Processing by AuthenticationsController#callback as HTML
268
- Parameters: {"code"=>"15a391624cbed2a7b33d9678b6534883c9fa02949bb1c08fde5cbccbc4eacee5", "state"=>"9d596518fffb5957e71141544b4f3252a3bc869f5e279de7"}
335
+ Parameters: {"code"=>"1a3140979bcf7b3277dcf0246e252c3b07673b16c0960dc9fd11d5338079cd09", "state"=>"8abd43f4c4bf907ae34f3f3fc4b6e88f0dddc47b7304c202"}
269
336
  Authenticating with gds_sso strategy
270
337
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
271
338
   (0.1ms) begin transaction
272
339
   (0.2ms) UPDATE "users" SET "permissions" = '---
273
340
  - signin
274
341
  ' WHERE "users"."id" = 11
275
-  (13.4ms) commit transaction
342
+  (15.0ms) commit transaction
276
343
   (0.1ms) begin transaction
277
344
   (0.2ms) UPDATE "users" SET "permissions" = '---
278
345
  - signin
279
346
  ' WHERE "users"."id" = 11
280
-  (16.3ms) commit transaction
347
+  (11.3ms) commit transaction
281
348
  Redirected to http://www.example-client.com/restricted
282
- Completed 302 Found in 35.5ms (ActiveRecord: 30.3ms)
283
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:20 +0000
349
+ Completed 302 Found in 31.0ms (ActiveRecord: 26.9ms)
350
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-19 09:15:58 +0000
284
351
  Processing by ExampleController#restricted as HTML
285
352
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
286
- Completed 200 OK in 1.6ms (Views: 0.4ms | ActiveRecord: 0.2ms)
287
- Started GET "/restricted" for 127.0.0.1 at 2014-05-29 06:06:20 +0000
353
+ Completed 200 OK in 1.2ms (Views: 0.2ms | ActiveRecord: 0.2ms)
354
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:58 +0000
288
355
  Processing by ExampleController#restricted as HTML
289
356
  Authenticating with gds_sso strategy
290
- Completed in 0.4ms
291
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-29 06:06:20 +0000
292
- Started GET "/auth/gds/callback?code=d6c80119d54145028f227274fa51d0be7788905b5790e0e026c6d302cb055057&state=cfcca15c646ccb5a2b880827fde549c146abf61232b26b77" for 127.0.0.1 at 2014-05-29 06:06:20 +0000
357
+ Completed in 0.3ms
358
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:58 +0000
359
+ Started GET "/auth/gds/callback?code=03ef9abbd28b603a14ae6a14831ed972f90eee81c8b20b544aede2bd0aadb37c&state=61f2c111d40be99abb1c0fb13cf6da10cdeff618b7847110" for 127.0.0.1 at 2014-07-18 13:10:59 +0000
293
360
  Processing by AuthenticationsController#callback as HTML
294
- Parameters: {"code"=>"d6c80119d54145028f227274fa51d0be7788905b5790e0e026c6d302cb055057", "state"=>"cfcca15c646ccb5a2b880827fde549c146abf61232b26b77"}
361
+ Parameters: {"code"=>"03ef9abbd28b603a14ae6a14831ed972f90eee81c8b20b544aede2bd0aadb37c", "state"=>"61f2c111d40be99abb1c0fb13cf6da10cdeff618b7847110"}
295
362
  Authenticating with gds_sso strategy
296
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
363
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
297
364
   (0.1ms) begin transaction
298
365
   (0.2ms) UPDATE "users" SET "permissions" = '---
299
366
  - signin
300
367
  ' WHERE "users"."id" = 11
301
-  (10.3ms) commit transaction
368
+  (15.6ms) commit transaction
302
369
   (0.1ms) begin transaction
303
-  (0.1ms) UPDATE "users" SET "permissions" = '---
370
+  (0.3ms) UPDATE "users" SET "permissions" = '---
304
371
  - signin
305
372
  ' WHERE "users"."id" = 11
306
-  (12.6ms) commit transaction
373
+  (11.1ms) commit transaction
307
374
  Redirected to http://www.example-client.com/restricted
308
- Completed 302 Found in 27.3ms (ActiveRecord: 23.5ms)
309
- Started GET "/restricted" for 127.0.0.1 at 2014-05-29 06:06:21 +0000
375
+ Completed 302 Found in 59.3ms (ActiveRecord: 27.6ms)
376
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:59 +0000
310
377
  Processing by ExampleController#restricted as HTML
311
378
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
312
- Completed 200 OK in 1.3ms (Views: 0.2ms | ActiveRecord: 0.2ms)
313
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:21 +0000
314
- Processing by ExampleController#restricted as HTML
315
- Authenticating with gds_sso strategy
316
- Completed in 0.4ms
317
- Started GET "/auth/gds" for 127.0.0.1 at 2014-05-28 10:01:21 +0000
318
- Started GET "/auth/gds/callback?code=bab47efe786ae1e03f7b8d1d151976af33314e80eb553d5fbd313d66f6d55406&state=88b33e9f9c7d2f5a6259251aea3570197a7dc407d8421f02" for 127.0.0.1 at 2014-05-28 10:01:21 +0000
319
- Processing by AuthenticationsController#callback as HTML
320
- Parameters: {"code"=>"bab47efe786ae1e03f7b8d1d151976af33314e80eb553d5fbd313d66f6d55406", "state"=>"88b33e9f9c7d2f5a6259251aea3570197a7dc407d8421f02"}
321
- Authenticating with gds_sso strategy
322
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
379
+ Completed 200 OK in 1.9ms (Views: 0.4ms | ActiveRecord: 0.2ms)
380
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'test@example-client.com' LIMIT 1
323
381
   (0.1ms) begin transaction
324
-  (0.2ms) UPDATE "users" SET "permissions" = '---
382
+  (0.2ms) UPDATE "users" SET "remotely_signed_out" = 't', "permissions" = '---
325
383
  - signin
326
384
  ' WHERE "users"."id" = 11
327
-  (12.9ms) commit transaction
328
-  (0.0ms) begin transaction
329
-  (0.1ms) UPDATE "users" SET "permissions" = '---
330
- - signin
331
- ' WHERE "users"."id" = 11
332
-  (11.6ms) commit transaction
333
- Redirected to http://www.example-client.com/restricted
334
- Completed 302 Found in 30.4ms (ActiveRecord: 25.2ms)
335
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:21 +0000
336
- Processing by ExampleController#restricted as HTML
337
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
338
- Completed 200 OK in 1.9ms (Views: 0.5ms | ActiveRecord: 0.2ms)
339
- Started GET "/restricted" for 127.0.0.1 at 2014-05-29 05:56:21 +0000
385
+  (8.8ms) commit transaction
386
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:59 +0000
340
387
  Processing by ExampleController#restricted as HTML
341
388
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
342
- Completed 200 OK in 1.1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
343
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:21 +0000
344
- Processing by ExampleController#restricted as JSON
345
- Authenticating with gds_bearer_token strategy
346
- Completed in 8.6ms
347
- Started GET "/restricted" for 127.0.0.1 at 2014-05-28 10:01:21 +0000
348
- Processing by ExampleController#restricted as JSON
349
- Authenticating with gds_bearer_token strategy
350
- User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
389
+ Authenticating with gds_sso strategy
390
+ Completed in 1.1ms
391
+ Started GET "/auth/gds" for 127.0.0.1 at 2014-07-18 13:10:59 +0000
392
+ Started GET "/auth/gds/callback?code=979607bcfbbc1794b923fa73d6fe319dd1be0bfc02086a961188b1de669bb8ff&state=ba10cbc1d53771830df04cb8d9cd264be7a05c80d204777c" for 127.0.0.1 at 2014-07-18 13:10:59 +0000
393
+ Processing by AuthenticationsController#callback as HTML
394
+ Parameters: {"code"=>"979607bcfbbc1794b923fa73d6fe319dd1be0bfc02086a961188b1de669bb8ff", "state"=>"ba10cbc1d53771830df04cb8d9cd264be7a05c80d204777c"}
395
+ Authenticating with gds_sso strategy
396
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
351
397
   (0.1ms) begin transaction
352
398
   (0.2ms) UPDATE "users" SET "permissions" = '---
353
399
  - signin
354
400
  ' WHERE "users"."id" = 11
355
-  (25.0ms) commit transaction
356
-  (0.1ms) begin transaction
357
-  (0.3ms) UPDATE "users" SET "permissions" = '---
358
- - signin
359
- ' WHERE "users"."id" = 11
360
-  (32.0ms) commit transaction
361
- Completed 200 OK in 215.4ms (Views: 0.6ms | ActiveRecord: 58.0ms)
362
- Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2014-05-28 10:01:22 +0000
363
- Processing by ExampleController#this_requires_signin_permission as JSON
364
- Authenticating with gds_bearer_token strategy
365
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
366
-  (0.1ms) begin transaction
367
-  (0.2ms) UPDATE "users" SET "permissions" = '---
401
+  (13.3ms) commit transaction
402
+  (0.0ms) begin transaction
403
+  (0.2ms) UPDATE "users" SET "remotely_signed_out" = 'f', "permissions" = '---
368
404
  - signin
369
405
  ' WHERE "users"."id" = 11
370
-  (20.9ms) commit transaction
371
-  (0.1ms) begin transaction
372
-  (0.2ms) UPDATE "users" SET "permissions" = '---
373
- - signin
374
- ' WHERE "users"."id" = 11
375
-  (11.1ms) commit transaction
376
- Completed 200 OK in 91.1ms (Views: 0.5ms | ActiveRecord: 32.6ms)
406
+  (15.2ms) commit transaction
407
+ Redirected to http://www.example-client.com/restricted
408
+ Completed 302 Found in 34.0ms (ActiveRecord: 29.2ms)
409
+ Started GET "/restricted" for 127.0.0.1 at 2014-07-18 13:10:59 +0000
410
+ Processing by ExampleController#restricted as HTML
411
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' AND "users"."remotely_signed_out" = 'f' LIMIT 1
412
+ Completed 200 OK in 1.5ms (Views: 0.3ms | ActiveRecord: 0.2ms)