gds-sso 0.7.7 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ <h1><%= message %></h1>
2
+
3
+ <p>Please contact your Delivery Manager or main GDS contact if you think you should be able to do what you tried to do.</p>
4
+
5
+ <p>If you think something is wrong, try <%= link_to "signing out", gds_sign_out_path %> and then back in</p>
@@ -4,9 +4,18 @@ module GDS
4
4
  class PermissionDeniedException < StandardError
5
5
  end
6
6
 
7
+ def self.included(base)
8
+ base.rescue_from PermissionDeniedException do |e|
9
+ render "authorisations/unauthorised", layout: "unauthorised", status: :forbidden, locals: { message: e.message }
10
+ end
11
+ base.helper_method :user_signed_in?
12
+ base.helper_method :current_user
13
+ end
14
+
15
+
7
16
  def authorise_user!(scope, permission)
8
17
  if not current_user.has_permission?(scope, permission)
9
- raise PermissionDeniedException
18
+ raise PermissionDeniedException, "Sorry, you don't seem to have the #{permission} permission for #{scope}."
10
19
  end
11
20
  end
12
21
 
@@ -36,11 +45,6 @@ module GDS
36
45
  def warden
37
46
  request.env['warden']
38
47
  end
39
-
40
- def self.included(base)
41
- base.helper_method :user_signed_in?
42
- base.helper_method :current_user
43
- end
44
48
  end
45
49
  end
46
50
  end
@@ -1,5 +1,5 @@
1
1
  module GDS
2
2
  module SSO
3
- VERSION = "0.7.7"
3
+ VERSION = "0.7.8"
4
4
  end
5
5
  end
@@ -3637,3 +3637,271 @@ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-06-29 15:15
3637
3637
  Processing by ExampleController#this_requires_signin_permission as JSON
3638
3638
  Authenticating with gds_sso_api_access strategy
3639
3639
  Completed 200 OK in 1ms (Views: 0.6ms)
3640
+
3641
+
3642
+ Started GET "/" for 127.0.0.1 at 2012-07-05 09:53:38 +0000
3643
+ Processing by ExampleController#index as HTML
3644
+ Rendered text template (0.0ms)
3645
+ Completed 200 OK in 61ms (Views: 60.5ms)
3646
+
3647
+
3648
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-05 09:53:39 +0000
3649
+ Processing by ExampleController#restricted as HTML
3650
+ Authenticating with gds_sso strategy
3651
+ Completed in 59ms
3652
+
3653
+
3654
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-05 09:53:39 +0000
3655
+
3656
+
3657
+ Started GET "/auth/gds/callback?code=20e6ceb1882795bbe08e6c08449d259ae794876da286c3b5a87753b8c4210219" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3658
+ Processing by AuthenticationsController#callback as HTML
3659
+ Parameters: {"code"=>"20e6ceb1882795bbe08e6c08449d259ae794876da286c3b5a87753b8c4210219"}
3660
+ Authenticating with gds_sso strategy
3661
+ Redirected to http://www.example-client.com/restricted
3662
+ Completed 302 Found in 1ms
3663
+
3664
+
3665
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3666
+ Processing by ExampleController#restricted as HTML
3667
+ Completed 200 OK in 1ms (Views: 0.5ms)
3668
+
3669
+
3670
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3671
+ Processing by ExampleController#restricted as HTML
3672
+ Authenticating with gds_sso strategy
3673
+ Completed in 1ms
3674
+
3675
+
3676
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3677
+
3678
+
3679
+ Started GET "/auth/gds/callback?code=87dbc56e17acca533425d4a129c1613d4732ca43caad9217c47c458b56f13186" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3680
+ Processing by AuthenticationsController#callback as HTML
3681
+ Parameters: {"code"=>"87dbc56e17acca533425d4a129c1613d4732ca43caad9217c47c458b56f13186"}
3682
+ Authenticating with gds_sso strategy
3683
+ Redirected to http://www.example-client.com/restricted
3684
+ Completed 302 Found in 1ms
3685
+
3686
+
3687
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3688
+ Processing by ExampleController#restricted as HTML
3689
+ Completed 200 OK in 1ms (Views: 0.5ms)
3690
+
3691
+
3692
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3693
+ Processing by ExampleController#restricted as HTML
3694
+ Authenticating with gds_sso strategy
3695
+ Completed in 0ms
3696
+
3697
+
3698
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3699
+
3700
+
3701
+ Started GET "/auth/gds/callback?code=1933908f2f4bc31395d244ce85f683cb9b4e72448fee032f9be09799f312918f" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3702
+ Processing by AuthenticationsController#callback as HTML
3703
+ Parameters: {"code"=>"1933908f2f4bc31395d244ce85f683cb9b4e72448fee032f9be09799f312918f"}
3704
+ Authenticating with gds_sso strategy
3705
+ Redirected to http://www.example-client.com/restricted
3706
+ Completed 302 Found in 1ms
3707
+
3708
+
3709
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-05 09:53:40 +0000
3710
+ Processing by ExampleController#restricted as HTML
3711
+ Completed 200 OK in 1ms (Views: 0.3ms)
3712
+
3713
+
3714
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3715
+ Processing by ExampleController#this_requires_signin_permission as HTML
3716
+ Authenticating with gds_sso strategy
3717
+ Completed in 1ms
3718
+
3719
+
3720
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3721
+
3722
+
3723
+ Started GET "/auth/gds/callback?code=4cfd8778aa1427d2562f6e054e9ff8f553181176a948899497deb32257be50e2" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3724
+ Processing by AuthenticationsController#callback as HTML
3725
+ Parameters: {"code"=>"4cfd8778aa1427d2562f6e054e9ff8f553181176a948899497deb32257be50e2"}
3726
+ Authenticating with gds_sso strategy
3727
+ Redirected to http://www.example-client.com/this_requires_signin_permission
3728
+ Completed 302 Found in 1ms
3729
+
3730
+
3731
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3732
+ Processing by ExampleController#this_requires_signin_permission as HTML
3733
+ Completed 200 OK in 1ms (Views: 0.6ms)
3734
+
3735
+
3736
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3737
+ Processing by ExampleController#this_requires_signin_permission as HTML
3738
+ Authenticating with gds_sso strategy
3739
+ Completed in 0ms
3740
+
3741
+
3742
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3743
+
3744
+
3745
+ Started GET "/auth/gds/callback?code=ac200c24882d8ed4f9dab8b35890452378bf594aac2f01ef683f64af6571d9ea" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3746
+ Processing by AuthenticationsController#callback as HTML
3747
+ Parameters: {"code"=>"ac200c24882d8ed4f9dab8b35890452378bf594aac2f01ef683f64af6571d9ea"}
3748
+ Authenticating with gds_sso strategy
3749
+ Redirected to http://www.example-client.com/this_requires_signin_permission
3750
+ Completed 302 Found in 1ms
3751
+
3752
+
3753
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3754
+ Processing by ExampleController#this_requires_signin_permission as HTML
3755
+ Completed 200 OK in 1ms (Views: 0.3ms)
3756
+
3757
+
3758
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3759
+ Processing by ExampleController#restricted as JSON
3760
+ Authenticating with gds_sso_api_access strategy
3761
+ Completed in 33ms
3762
+
3763
+
3764
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3765
+ Processing by ExampleController#restricted as JSON
3766
+ Authenticating with gds_sso_api_access strategy
3767
+ Completed 200 OK in 1ms (Views: 0.6ms)
3768
+
3769
+
3770
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-05 09:53:41 +0000
3771
+ Processing by ExampleController#this_requires_signin_permission as JSON
3772
+ Authenticating with gds_sso_api_access strategy
3773
+ Completed 200 OK in 2ms (Views: 0.6ms)
3774
+
3775
+
3776
+ Started GET "/" for 127.0.0.1 at 2012-07-06 09:41:47 +0000
3777
+ Processing by ExampleController#index as HTML
3778
+ Rendered text template (0.0ms)
3779
+ Completed 200 OK in 49ms (Views: 48.3ms)
3780
+
3781
+
3782
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-06 09:41:48 +0000
3783
+ Processing by ExampleController#restricted as HTML
3784
+ Authenticating with gds_sso strategy
3785
+ Completed in 57ms
3786
+
3787
+
3788
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-06 09:41:48 +0000
3789
+
3790
+
3791
+ Started GET "/auth/gds/callback?code=71ec92eee5953ce38a526a43a8647d47fcaeb2f5d2b0d82fecab58a3e0100eb6" for 127.0.0.1 at 2012-07-06 09:41:49 +0000
3792
+ Processing by AuthenticationsController#callback as HTML
3793
+ Parameters: {"code"=>"71ec92eee5953ce38a526a43a8647d47fcaeb2f5d2b0d82fecab58a3e0100eb6"}
3794
+ Authenticating with gds_sso strategy
3795
+ Redirected to http://www.example-client.com/restricted
3796
+ Completed 302 Found in 1ms
3797
+
3798
+
3799
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-06 09:41:49 +0000
3800
+ Processing by ExampleController#restricted as HTML
3801
+ Completed 200 OK in 1ms (Views: 0.5ms)
3802
+
3803
+
3804
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-06 09:41:49 +0000
3805
+ Processing by ExampleController#restricted as HTML
3806
+ Authenticating with gds_sso strategy
3807
+ Completed in 0ms
3808
+
3809
+
3810
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-06 09:41:49 +0000
3811
+
3812
+
3813
+ Started GET "/auth/gds/callback?code=7bdf75481822f0a4d117ca60992afe3dc75b5d23cdf1e8cc9a00016d1de054b8" for 127.0.0.1 at 2012-07-06 09:41:49 +0000
3814
+ Processing by AuthenticationsController#callback as HTML
3815
+ Parameters: {"code"=>"7bdf75481822f0a4d117ca60992afe3dc75b5d23cdf1e8cc9a00016d1de054b8"}
3816
+ Authenticating with gds_sso strategy
3817
+ Redirected to http://www.example-client.com/restricted
3818
+ Completed 302 Found in 1ms
3819
+
3820
+
3821
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-06 09:41:49 +0000
3822
+ Processing by ExampleController#restricted as HTML
3823
+ Completed 200 OK in 1ms (Views: 0.5ms)
3824
+
3825
+
3826
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-06 09:41:49 +0000
3827
+ Processing by ExampleController#restricted as HTML
3828
+ Authenticating with gds_sso strategy
3829
+ Completed in 0ms
3830
+
3831
+
3832
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-06 09:41:49 +0000
3833
+
3834
+
3835
+ Started GET "/auth/gds/callback?code=b89bf9999a2c2321c95bb750021185a06c95b24ff907e9e79da916d4b09dde2f" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3836
+ Processing by AuthenticationsController#callback as HTML
3837
+ Parameters: {"code"=>"b89bf9999a2c2321c95bb750021185a06c95b24ff907e9e79da916d4b09dde2f"}
3838
+ Authenticating with gds_sso strategy
3839
+ Redirected to http://www.example-client.com/restricted
3840
+ Completed 302 Found in 1ms
3841
+
3842
+
3843
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3844
+ Processing by ExampleController#restricted as HTML
3845
+ Completed 200 OK in 1ms (Views: 0.4ms)
3846
+
3847
+
3848
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3849
+ Processing by ExampleController#this_requires_signin_permission as HTML
3850
+ Authenticating with gds_sso strategy
3851
+ Completed in 1ms
3852
+
3853
+
3854
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3855
+
3856
+
3857
+ Started GET "/auth/gds/callback?code=0032b4e775f3f4db74e631445714e8ed9824a92eab6f4386a37523344dcd4680" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3858
+ Processing by AuthenticationsController#callback as HTML
3859
+ Parameters: {"code"=>"0032b4e775f3f4db74e631445714e8ed9824a92eab6f4386a37523344dcd4680"}
3860
+ Authenticating with gds_sso strategy
3861
+ Redirected to http://www.example-client.com/this_requires_signin_permission
3862
+ Completed 302 Found in 1ms
3863
+
3864
+
3865
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3866
+ Processing by ExampleController#this_requires_signin_permission as HTML
3867
+ Completed 200 OK in 1ms (Views: 0.6ms)
3868
+
3869
+
3870
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3871
+ Processing by ExampleController#this_requires_signin_permission as HTML
3872
+ Authenticating with gds_sso strategy
3873
+ Completed in 0ms
3874
+
3875
+
3876
+ Started GET "/auth/gds" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3877
+
3878
+
3879
+ Started GET "/auth/gds/callback?code=8250970673248032ded4063ee0321b1e3c84173c7f17d9e19c193ded808962ff" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3880
+ Processing by AuthenticationsController#callback as HTML
3881
+ Parameters: {"code"=>"8250970673248032ded4063ee0321b1e3c84173c7f17d9e19c193ded808962ff"}
3882
+ Authenticating with gds_sso strategy
3883
+ Redirected to http://www.example-client.com/this_requires_signin_permission
3884
+ Completed 302 Found in 1ms
3885
+
3886
+
3887
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3888
+ Processing by ExampleController#this_requires_signin_permission as HTML
3889
+ Completed 200 OK in 1ms (Views: 0.4ms)
3890
+
3891
+
3892
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3893
+ Processing by ExampleController#restricted as JSON
3894
+ Authenticating with gds_sso_api_access strategy
3895
+ Completed in 34ms
3896
+
3897
+
3898
+ Started GET "/restricted" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3899
+ Processing by ExampleController#restricted as JSON
3900
+ Authenticating with gds_sso_api_access strategy
3901
+ Completed 200 OK in 2ms (Views: 0.9ms)
3902
+
3903
+
3904
+ Started GET "/this_requires_signin_permission" for 127.0.0.1 at 2012-07-06 09:41:50 +0000
3905
+ Processing by ExampleController#this_requires_signin_permission as JSON
3906
+ Authenticating with gds_sso_api_access strategy
3907
+ Completed 200 OK in 2ms (Views: 0.6ms)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gds-sso
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.7.7
5
+ version: 0.7.8
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-29 00:00:00 Z
14
+ date: 2012-07-06 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -158,6 +158,7 @@ extra_rdoc_files: []
158
158
  files:
159
159
  - app/views/layouts/unauthorised.html.erb
160
160
  - app/views/authentications/failure.html.erb
161
+ - app/views/authorisations/unauthorised.html.erb
161
162
  - app/views/authorisations/cant_signin.html.erb
162
163
  - app/controllers/authentications_controller.rb
163
164
  - config/routes.rb
@@ -204,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
205
  requirements:
205
206
  - - ">="
206
207
  - !ruby/object:Gem::Version
207
- hash: 414716890116187310
208
+ hash: 1809515685969194484
208
209
  segments:
209
210
  - 0
210
211
  version: "0"
@@ -213,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
214
  requirements:
214
215
  - - ">="
215
216
  - !ruby/object:Gem::Version
216
- hash: 414716890116187310
217
+ hash: 1809515685969194484
217
218
  segments:
218
219
  - 0
219
220
  version: "0"