gds-sso 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module GDS
2
2
  module SSO
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  end
5
5
  end
@@ -9,7 +9,11 @@ Warden::Manager.after_authentication do |user, auth, opts|
9
9
  end
10
10
 
11
11
  Warden::Manager.serialize_into_session do |user|
12
- user.respond_to?(:uid) ? [user.uid, Time.now.utc] : nil
12
+ if user.respond_to?(:uid) and user.uid
13
+ [user.uid, Time.now.utc]
14
+ else
15
+ nil
16
+ end
13
17
  end
14
18
 
15
19
  Warden::Manager.serialize_from_session do |tuple|
@@ -7518,3 +7518,457 @@ GDS_SSO integration test:
7518
7518
   (9.5ms) commit transaction
7519
7519
  Completed 200 OK in 17ms (ActiveRecord: 10.3ms)
7520
7520
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 5]]
7521
+ Connecting to database specified by database.yml
7522
+  (3.5ms) select sqlite_version(*)
7523
+  (62.8ms) DROP TABLE "users"
7524
+  (1.6ms) 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) 
7525
+
7526
+
7527
+ Started GET "/" for 127.0.0.1 at 2012-07-27 15:10:42 +0000
7528
+ Processing by ExampleController#index as HTML
7529
+ Rendered text template (0.0ms)
7530
+ Completed 200 OK in 136ms (Views: 135.4ms | ActiveRecord: 0.0ms)
7531
+
7532
+
7533
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:42 +0000
7534
+ Processing by ExampleController#restricted as HTML
7535
+ Authenticating with gds_sso strategy
7536
+ Completed in 75ms
7537
+
7538
+
7539
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:42 +0000
7540
+
7541
+
7542
+ Started GET "/auth/gds/callback?code=5fda799e1004a055583c4a7392d120610293e9f5fe569700b2d563b74b193041&state=552a88a68a8126086e2d6ce582e972f54dc687fa2957e42f" for 127.0.0.1 at 2012-07-27 15:10:44 +0000
7543
+ Processing by AuthenticationsController#callback as HTML
7544
+ Parameters: {"code"=>"5fda799e1004a055583c4a7392d120610293e9f5fe569700b2d563b74b193041", "state"=>"552a88a68a8126086e2d6ce582e972f54dc687fa2957e42f"}
7545
+ Authenticating with gds_sso strategy
7546
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7547
+  (0.1ms) begin transaction
7548
+ SQL (49.1ms) INSERT INTO "users" ("email", "name", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?) [["email", "test@example-client.com"], ["name", "Test User"], ["permissions", "--- \nGDS_SSO integration test: \n- signin\n"], ["remotely_signed_out", nil], ["uid", "integration-uid"]]
7549
+  (4.6ms) commit transaction
7550
+  (0.1ms) begin transaction
7551
+  (0.4ms) UPDATE "users" SET "remotely_signed_out" = 'f', "permissions" = '---
7552
+ GDS_SSO integration test:
7553
+ - signin
7554
+ ' WHERE "users"."id" = 1
7555
+  (1.5ms) commit transaction
7556
+ Redirected to http://www.example-client.com/restricted
7557
+ Completed 302 Found in 169ms (ActiveRecord: 56.5ms)
7558
+
7559
+
7560
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:44 +0000
7561
+ Processing by ExampleController#restricted as HTML
7562
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7563
+ Completed 200 OK in 2ms (Views: 0.6ms | ActiveRecord: 0.2ms)
7564
+
7565
+
7566
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:44 +0000
7567
+ Processing by ExampleController#restricted as HTML
7568
+ Authenticating with gds_sso strategy
7569
+ Completed in 1ms
7570
+
7571
+
7572
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:44 +0000
7573
+
7574
+
7575
+ Started GET "/auth/gds/callback?code=14237788eea7fe284033b3b2be1bde9204c0b149b575cbf6930a224f059d5cda&state=c6c7943a80419df08ba4498f68df075c53a42c61bbfd710a" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7576
+ Processing by AuthenticationsController#callback as HTML
7577
+ Parameters: {"code"=>"14237788eea7fe284033b3b2be1bde9204c0b149b575cbf6930a224f059d5cda", "state"=>"c6c7943a80419df08ba4498f68df075c53a42c61bbfd710a"}
7578
+ Authenticating with gds_sso strategy
7579
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7580
+  (0.1ms) begin transaction
7581
+  (0.2ms) UPDATE "users" SET "permissions" = '---
7582
+ GDS_SSO integration test:
7583
+ - signin
7584
+ ' WHERE "users"."id" = 1
7585
+  (9.8ms) commit transaction
7586
+  (0.0ms) begin transaction
7587
+  (0.2ms) UPDATE "users" SET "permissions" = '---
7588
+ GDS_SSO integration test:
7589
+ - signin
7590
+ ' WHERE "users"."id" = 1
7591
+  (1.3ms) commit transaction
7592
+ Redirected to http://www.example-client.com/restricted
7593
+ Completed 302 Found in 18ms (ActiveRecord: 12.0ms)
7594
+
7595
+
7596
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7597
+ Processing by ExampleController#restricted as HTML
7598
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7599
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.1ms)
7600
+
7601
+
7602
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7603
+ Processing by ExampleController#restricted as HTML
7604
+ Authenticating with gds_sso strategy
7605
+ Completed in 0ms
7606
+
7607
+
7608
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7609
+
7610
+
7611
+ Started GET "/auth/gds/callback?code=5e9c0bcca9a6fd35e8f6a1e8d8a220dafb2d7f1a15078060437a32424931a59d&state=4ca349ed23ec67fcbb0c9f4fbe4f3e75f97d0edeb8e2240b" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7612
+ Processing by AuthenticationsController#callback as HTML
7613
+ Parameters: {"code"=>"5e9c0bcca9a6fd35e8f6a1e8d8a220dafb2d7f1a15078060437a32424931a59d", "state"=>"4ca349ed23ec67fcbb0c9f4fbe4f3e75f97d0edeb8e2240b"}
7614
+ Authenticating with gds_sso strategy
7615
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7616
+  (0.1ms) begin transaction
7617
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7618
+ GDS_SSO integration test:
7619
+ - signin
7620
+ ' WHERE "users"."id" = 1
7621
+  (10.1ms) commit transaction
7622
+  (0.1ms) begin transaction
7623
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7624
+ GDS_SSO integration test:
7625
+ - signin
7626
+ ' WHERE "users"."id" = 1
7627
+  (1.5ms) commit transaction
7628
+ Redirected to http://www.example-client.com/restricted
7629
+ Completed 302 Found in 18ms (ActiveRecord: 12.5ms)
7630
+
7631
+
7632
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7633
+ Processing by ExampleController#restricted as HTML
7634
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7635
+ Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.2ms)
7636
+
7637
+
7638
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7639
+ Processing by ExampleController#this_requires_signin_permission as HTML
7640
+ Authenticating with gds_sso strategy
7641
+ Completed in 1ms
7642
+
7643
+
7644
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7645
+
7646
+
7647
+ Started GET "/auth/gds/callback?code=4de3a1871f3a078772191e3be0e57182a37dff5ae2199c60d9a8f2d588f457cc&state=2a1d2a0a626b4832323faf825e5a8aa3d842be57b226972c" for 127.0.0.1 at 2012-07-27 15:10:45 +0000
7648
+ Processing by AuthenticationsController#callback as HTML
7649
+ Parameters: {"code"=>"4de3a1871f3a078772191e3be0e57182a37dff5ae2199c60d9a8f2d588f457cc", "state"=>"2a1d2a0a626b4832323faf825e5a8aa3d842be57b226972c"}
7650
+ Authenticating with gds_sso strategy
7651
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7652
+  (0.1ms) begin transaction
7653
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7654
+ GDS_SSO integration test:
7655
+ - signin
7656
+ ' WHERE "users"."id" = 1
7657
+  (6.9ms) commit transaction
7658
+  (0.1ms) begin transaction
7659
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7660
+ GDS_SSO integration test:
7661
+ - signin
7662
+ ' WHERE "users"."id" = 1
7663
+  (1.7ms) commit transaction
7664
+ Redirected to http://www.example-client.com/this_requires_signin_permission
7665
+ Completed 302 Found in 18ms (ActiveRecord: 9.7ms)
7666
+
7667
+
7668
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7669
+ Processing by ExampleController#this_requires_signin_permission as HTML
7670
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7671
+ Completed 200 OK in 2ms (Views: 0.7ms | ActiveRecord: 0.2ms)
7672
+
7673
+
7674
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7675
+ Processing by ExampleController#this_requires_signin_permission as HTML
7676
+ Authenticating with gds_sso strategy
7677
+ Completed in 0ms
7678
+
7679
+
7680
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7681
+
7682
+
7683
+ Started GET "/auth/gds/callback?code=76c08ab7f4943fddd83141cb6bd2c134986d4fddc6fe6967740b25411d2d30ec&state=3dc8466d19ddfc1bee8eddc0c1292942f4600b98ad2fe320" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7684
+ Processing by AuthenticationsController#callback as HTML
7685
+ Parameters: {"code"=>"76c08ab7f4943fddd83141cb6bd2c134986d4fddc6fe6967740b25411d2d30ec", "state"=>"3dc8466d19ddfc1bee8eddc0c1292942f4600b98ad2fe320"}
7686
+ Authenticating with gds_sso strategy
7687
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7688
+  (0.1ms) begin transaction
7689
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7690
+ GDS_SSO integration test:
7691
+ - signin
7692
+ ' WHERE "users"."id" = 1
7693
+  (9.9ms) commit transaction
7694
+  (0.1ms) begin transaction
7695
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7696
+ GDS_SSO integration test:
7697
+ - signin
7698
+ ' WHERE "users"."id" = 1
7699
+  (1.6ms) commit transaction
7700
+ Redirected to http://www.example-client.com/this_requires_signin_permission
7701
+ Completed 302 Found in 19ms (ActiveRecord: 12.5ms)
7702
+
7703
+
7704
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7705
+ Processing by ExampleController#this_requires_signin_permission as HTML
7706
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7707
+ Completed 200 OK in 2ms (Views: 0.8ms | ActiveRecord: 0.2ms)
7708
+
7709
+
7710
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7711
+ Processing by ExampleController#restricted as HTML
7712
+ Authenticating with gds_sso strategy
7713
+ Completed in 0ms
7714
+
7715
+
7716
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7717
+
7718
+
7719
+ Started GET "/auth/gds/callback?code=9a6283af999199f4f11137b562f4f22c1cc3931dd1181c9095a137da921b65dd&state=12874f29b1a77b7a2c3c65b608d87a155255090a3e8f268c" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7720
+ Processing by AuthenticationsController#callback as HTML
7721
+ Parameters: {"code"=>"9a6283af999199f4f11137b562f4f22c1cc3931dd1181c9095a137da921b65dd", "state"=>"12874f29b1a77b7a2c3c65b608d87a155255090a3e8f268c"}
7722
+ Authenticating with gds_sso strategy
7723
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7724
+  (0.1ms) begin transaction
7725
+  (0.4ms) UPDATE "users" SET "permissions" = '---
7726
+ GDS_SSO integration test:
7727
+ - signin
7728
+ ' WHERE "users"."id" = 1
7729
+  (10.2ms) commit transaction
7730
+  (0.1ms) begin transaction
7731
+  (0.2ms) UPDATE "users" SET "permissions" = '---
7732
+ GDS_SSO integration test:
7733
+ - signin
7734
+ ' WHERE "users"."id" = 1
7735
+  (1.5ms) commit transaction
7736
+ Redirected to http://www.example-client.com/restricted
7737
+ Completed 302 Found in 18ms (ActiveRecord: 12.7ms)
7738
+
7739
+
7740
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7741
+ Processing by ExampleController#restricted as HTML
7742
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7743
+ Completed 200 OK in 2ms (Views: 0.5ms | ActiveRecord: 0.1ms)
7744
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7745
+  (0.0ms) begin transaction
7746
+  (0.2ms) UPDATE "users" SET "remotely_signed_out" = 't', "permissions" = '---
7747
+ GDS_SSO integration test:
7748
+ - signin
7749
+ ' WHERE "users"."id" = 1
7750
+  (1.4ms) commit transaction
7751
+
7752
+
7753
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7754
+ Processing by ExampleController#restricted as HTML
7755
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7756
+ Filter chain halted as :authenticate_user! rendered or redirected
7757
+ Completed 403 Forbidden in 49ms (Views: 47.6ms | ActiveRecord: 0.1ms)
7758
+
7759
+
7760
+ Started GET "/auth/gds/sign_out" for 127.0.0.1 at 2012-07-27 15:10:46 +0000
7761
+ Processing by AuthenticationsController#sign_out as HTML
7762
+ Redirected to http://localhost:4567/users/sign_out
7763
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
7764
+
7765
+
7766
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7767
+ Processing by ExampleController#restricted as HTML
7768
+ Authenticating with gds_sso strategy
7769
+ Completed in 0ms
7770
+
7771
+
7772
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7773
+
7774
+
7775
+ Started GET "/auth/gds/callback?code=851d5631bf3917c9bedfdfac5d3e7babf4e5c358030757d6022996e3d4dc139c&state=385cabbc959401723d836b3f36b1ccb7c3c28a3bae995104" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7776
+ Processing by AuthenticationsController#callback as HTML
7777
+ Parameters: {"code"=>"851d5631bf3917c9bedfdfac5d3e7babf4e5c358030757d6022996e3d4dc139c", "state"=>"385cabbc959401723d836b3f36b1ccb7c3c28a3bae995104"}
7778
+ Authenticating with gds_sso strategy
7779
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7780
+  (0.1ms) begin transaction
7781
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7782
+ GDS_SSO integration test:
7783
+ - signin
7784
+ ' WHERE "users"."id" = 1
7785
+  (7.8ms) commit transaction
7786
+  (0.1ms) begin transaction
7787
+  (0.3ms) UPDATE "users" SET "remotely_signed_out" = 'f', "permissions" = '---
7788
+ GDS_SSO integration test:
7789
+ - signin
7790
+ ' WHERE "users"."id" = 1
7791
+  (1.5ms) commit transaction
7792
+ Redirected to http://www.example-client.com/restricted
7793
+ Completed 302 Found in 16ms (ActiveRecord: 10.4ms)
7794
+
7795
+
7796
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7797
+ Processing by ExampleController#restricted as HTML
7798
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7799
+ Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.2ms)
7800
+
7801
+
7802
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7803
+ Processing by ExampleController#restricted as HTML
7804
+ Authenticating with gds_sso strategy
7805
+ Completed in 0ms
7806
+
7807
+
7808
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7809
+
7810
+
7811
+ Started GET "/auth/gds/callback?code=aefa94681e2a8ac3127a25e2f8adac256b9bf155fd8bd6386b81ac5dcf50fdb0&state=7cd9e702263b66e55b6837370f945c8d1acf782fc896ffc6" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7812
+ Processing by AuthenticationsController#callback as HTML
7813
+ Parameters: {"code"=>"aefa94681e2a8ac3127a25e2f8adac256b9bf155fd8bd6386b81ac5dcf50fdb0", "state"=>"7cd9e702263b66e55b6837370f945c8d1acf782fc896ffc6"}
7814
+ Authenticating with gds_sso strategy
7815
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7816
+  (0.1ms) begin transaction
7817
+  (0.4ms) UPDATE "users" SET "permissions" = '---
7818
+ GDS_SSO integration test:
7819
+ - signin
7820
+ ' WHERE "users"."id" = 1
7821
+  (95.0ms) commit transaction
7822
+  (0.1ms) begin transaction
7823
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7824
+ GDS_SSO integration test:
7825
+ - signin
7826
+ ' WHERE "users"."id" = 1
7827
+  (1.5ms) commit transaction
7828
+ Redirected to http://www.example-client.com/restricted
7829
+ Completed 302 Found in 105ms (ActiveRecord: 97.7ms)
7830
+
7831
+
7832
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7833
+ Processing by ExampleController#restricted as HTML
7834
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7835
+ Completed 200 OK in 2ms (Views: 0.6ms | ActiveRecord: 0.2ms)
7836
+
7837
+
7838
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-28 11:15:47 +0000
7839
+ Processing by ExampleController#restricted as HTML
7840
+ Authenticating with gds_sso strategy
7841
+ Completed in 0ms
7842
+
7843
+
7844
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-28 11:15:47 +0000
7845
+
7846
+
7847
+ Started GET "/auth/gds/callback?code=714af03ad561318a94e9165ddd2aaf1c73ddf04a7fcf7f4051af638346894041&state=2f1b0c94ac9b9a82b74bae766e68b19548ac3615183ad06a" for 127.0.0.1 at 2012-07-28 11:15:47 +0000
7848
+ Processing by AuthenticationsController#callback as HTML
7849
+ Parameters: {"code"=>"714af03ad561318a94e9165ddd2aaf1c73ddf04a7fcf7f4051af638346894041", "state"=>"2f1b0c94ac9b9a82b74bae766e68b19548ac3615183ad06a"}
7850
+ Authenticating with gds_sso strategy
7851
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7852
+  (0.1ms) begin transaction
7853
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7854
+ GDS_SSO integration test:
7855
+ - signin
7856
+ ' WHERE "users"."id" = 1
7857
+  (9.2ms) commit transaction
7858
+  (0.1ms) begin transaction
7859
+  (0.3ms) UPDATE "users" SET "permissions" = '---
7860
+ GDS_SSO integration test:
7861
+ - signin
7862
+ ' WHERE "users"."id" = 1
7863
+  (1.9ms) commit transaction
7864
+ Redirected to http://www.example-client.com/restricted
7865
+ Completed 302 Found in 18ms (ActiveRecord: 12.1ms)
7866
+
7867
+
7868
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-28 11:15:47 +0000
7869
+ Processing by ExampleController#restricted as HTML
7870
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7871
+ Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.2ms)
7872
+
7873
+
7874
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7875
+ Processing by ExampleController#restricted as HTML
7876
+ Authenticating with gds_sso strategy
7877
+ Completed in 0ms
7878
+
7879
+
7880
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-27 15:10:47 +0000
7881
+
7882
+
7883
+ Started GET "/auth/gds/callback?code=83f863ca19e212582240114f5d08935a8bd03b970183821f6c5923044304afc6&state=afaa30f46b9522b2f0b8dfe668f89ca7692bf54f732df9a8" for 127.0.0.1 at 2012-07-27 15:10:48 +0000
7884
+ Processing by AuthenticationsController#callback as HTML
7885
+ Parameters: {"code"=>"83f863ca19e212582240114f5d08935a8bd03b970183821f6c5923044304afc6", "state"=>"afaa30f46b9522b2f0b8dfe668f89ca7692bf54f732df9a8"}
7886
+ Authenticating with gds_sso strategy
7887
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7888
+  (0.1ms) begin transaction
7889
+  (0.2ms) UPDATE "users" SET "permissions" = '---
7890
+ GDS_SSO integration test:
7891
+ - signin
7892
+ ' WHERE "users"."id" = 1
7893
+  (9.8ms) commit transaction
7894
+  (0.0ms) begin transaction
7895
+  (0.2ms) UPDATE "users" SET "permissions" = '---
7896
+ GDS_SSO integration test:
7897
+ - signin
7898
+ ' WHERE "users"."id" = 1
7899
+  (1.6ms) commit transaction
7900
+ Redirected to http://www.example-client.com/restricted
7901
+ Completed 302 Found in 19ms (ActiveRecord: 12.2ms)
7902
+
7903
+
7904
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:48 +0000
7905
+ Processing by ExampleController#restricted as HTML
7906
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7907
+ Completed 200 OK in 2ms (Views: 0.6ms | ActiveRecord: 0.1ms)
7908
+
7909
+
7910
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-28 11:05:48 +0000
7911
+ Processing by ExampleController#restricted as HTML
7912
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'integration-uid' LIMIT 1
7913
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
7914
+
7915
+
7916
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:48 +0000
7917
+ Processing by ExampleController#restricted as JSON
7918
+ Authenticating with gds_sso_api_access strategy
7919
+ Completed in 169ms
7920
+
7921
+
7922
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-27 15:10:48 +0000
7923
+ Processing by ExampleController#restricted as JSON
7924
+ Authenticating with gds_sso_api_access strategy
7925
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
7926
+
7927
+
7928
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-27 15:10:48 +0000
7929
+ Processing by ExampleController#this_requires_signin_permission as JSON
7930
+ Authenticating with gds_sso_api_access strategy
7931
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
7932
+  (0.2ms) begin transaction
7933
+ SQL (0.4ms) INSERT INTO "users" ("email", "name", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["permissions", "--- \nGDS_SSO integration test: \n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d36815"]]
7934
+  (11.5ms) commit transaction
7935
+ WARNING: Can't mass-assign protected attributes: uid, name, permissions
7936
+ Processing by Api::UserController#update as HTML
7937
+ Parameters: {"uid"=>"a1s2d36815"}
7938
+ Completed 403 Forbidden in 4ms (Views: 2.5ms | ActiveRecord: 0.0ms)
7939
+  (0.1ms) begin transaction
7940
+ SQL (0.3ms) INSERT INTO "users" ("email", "name", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["permissions", "--- \nGDS_SSO integration test: \n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d38581"]]
7941
+  (1.7ms) commit transaction
7942
+ Processing by Api::UserController#update as HTML
7943
+ Parameters: {"uid"=>"a1s2d38581"}
7944
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'a1s2d38581' LIMIT 1
7945
+  (0.1ms) begin transaction
7946
+  (0.3ms) UPDATE "users" SET "email" = 'user@domain.com', "name" = 'Joshua Marshall', "permissions" = '---
7947
+ GDS_SSO integration test:
7948
+ - signin
7949
+ - new permission
7950
+ ' WHERE "users"."id" = 3
7951
+  (1.6ms) commit transaction
7952
+ Completed 200 OK in 7ms (ActiveRecord: 2.2ms)
7953
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 3]]
7954
+  (0.1ms) begin transaction
7955
+ SQL (0.3ms) INSERT INTO "users" ("email", "name", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["permissions", "--- \nGDS_SSO integration test: \n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d34625"]]
7956
+  (1.6ms) commit transaction
7957
+ WARNING: Can't mass-assign protected attributes: uid, name, permissions
7958
+ Processing by Api::UserController#reauth as HTML
7959
+ Parameters: {"uid"=>"a1s2d34625"}
7960
+ Completed 403 Forbidden in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
7961
+  (0.1ms) begin transaction
7962
+ SQL (0.3ms) INSERT INTO "users" ("email", "name", "permissions", "remotely_signed_out", "uid") VALUES (?, ?, ?, ?, ?) [["email", "old@domain.com"], ["name", "Moshua Jarshall"], ["permissions", "--- \nGDS_SSO integration test: \n- signin\n"], ["remotely_signed_out", nil], ["uid", "a1s2d36260"]]
7963
+  (1.9ms) commit transaction
7964
+ Processing by Api::UserController#reauth as HTML
7965
+ Parameters: {"uid"=>"a1s2d36260"}
7966
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."uid" = 'a1s2d36260' LIMIT 1
7967
+  (0.1ms) begin transaction
7968
+  (0.3ms) UPDATE "users" SET "remotely_signed_out" = 't', "permissions" = '---
7969
+ GDS_SSO integration test:
7970
+ - signin
7971
+ ' WHERE "users"."id" = 5
7972
+  (1.6ms) commit transaction
7973
+ Completed 200 OK in 6ms (ActiveRecord: 2.2ms)
7974
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 5]]
@@ -24,6 +24,13 @@ class SessionSerialisationTest < Test::Unit::TestCase
24
24
  assert_equal [1234, Time.now.utc], result
25
25
  end
26
26
 
27
+ def test_serializing_a_user_without_a_uid_returns_nil
28
+ @user.stubs(:uid).returns(nil)
29
+ result = @serializer.serialize(@user)
30
+
31
+ assert_equal nil, result
32
+ end
33
+
27
34
  def test_deserializing_a_user_and_in_date_timestamp_returns_the_user
28
35
  User.expects(:find_by_uid).with(1234).returns(:a_user)
29
36
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gds-sso
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.0
5
+ version: 1.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matt Patterson
@@ -231,7 +231,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - ">="
233
233
  - !ruby/object:Gem::Version
234
- hash: -481137832560706652
234
+ hash: -1714107405945012182
235
235
  segments:
236
236
  - 0
237
237
  version: "0"
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - ">="
242
242
  - !ruby/object:Gem::Version
243
- hash: -481137832560706652
243
+ hash: -1714107405945012182
244
244
  segments:
245
245
  - 0
246
246
  version: "0"