Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'require_signin_permission'

Conflicts:
	Gemfile.lock
  • Loading branch information...
commit be36645a47037bc559621dff475f378e81149723 2 parents c7e7a40 + 469f98c
@jamiecobbett jamiecobbett authored
View
2  Gemfile
@@ -42,7 +42,7 @@ end
if ENV['BUNDLE_DEV']
gem 'gds-sso', path: '../gds-sso'
else
- gem 'gds-sso', '0.7.0'
+ gem 'gds-sso', '0.7.9'
end
group :assets do
View
17 Gemfile.lock
@@ -100,7 +100,6 @@ GEM
factory_girl_rails (3.3.0)
factory_girl (~> 3.3.0)
railties (>= 3.0.0)
- fakeweb (1.3.0)
faraday (0.8.1)
multipart-post (~> 1.1)
ffi (1.0.11)
@@ -108,7 +107,7 @@ GEM
lrucache (~> 0.1.1)
null_logger
plek
- gds-sso (0.7.0)
+ gds-sso (0.7.9)
omniauth-gds (= 0.0.3)
rack-accept (~> 0.4.4)
rails (>= 3.0.0)
@@ -133,6 +132,8 @@ GEM
httpauth (0.1)
i18n (0.6.0)
json (1.7.3)
+ jwt (0.1.4)
+ json (>= 1.2.4)
launchy (2.0.5)
addressable (~> 2.2.6)
libv8 (3.3.10.4)
@@ -164,17 +165,19 @@ GEM
net-http-persistent (1.9)
nokogiri (1.5.0)
null_logger (0.0.1)
- oauth2 (0.6.0)
- faraday (~> 0.7)
+ oauth2 (0.8.0)
+ faraday (~> 0.8)
httpauth (~> 0.1)
+ jwt (~> 0.1.4)
multi_json (~> 1.0)
+ rack (~> 1.2)
omniauth (1.1.0)
hashie (~> 1.2)
rack
omniauth-gds (0.0.3)
omniauth-oauth2 (~> 1.0)
- omniauth-oauth2 (1.0.2)
- oauth2 (~> 0.6.0)
+ omniauth-oauth2 (1.1.0)
+ oauth2 (~> 0.8.0)
omniauth (~> 1.0)
plek (0.1.24)
builder
@@ -284,7 +287,7 @@ DEPENDENCIES
formtastic!
formtastic-bootstrap!
gds-api-adapters
- gds-sso (= 0.7.0)
+ gds-sso (= 0.7.9)
gds-warmup-controller (= 0.1.0)
gelf
govuk_content_models (= 0.1.6)
View
1  app/controllers/application_controller.rb
@@ -2,6 +2,7 @@ class ApplicationController < ActionController::Base
include GDS::SSO::ControllerMethods
before_filter :authenticate_user!
+ before_filter :require_signin_permission!
rescue_from Mongoid::Errors::DocumentNotFound, with: :record_not_found
View
1  config/initializers/gds-sso.rb
@@ -2,6 +2,7 @@
config.user_model = "User"
config.oauth_id = 'abcdefgh12345678pan'
config.oauth_secret = 'secret'
+ config.default_scope = "Panopticon"
config.oauth_root_url = Plek.current.find("authentication")
config.basic_auth_user = 'api'
config.basic_auth_password = 'defined_on_rollout_not'
View
2  config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Panopticon::Application.config.secret_token = '1c03c8a863ffef3dfd468a20bee651c98963b9d633a517ed73e46572e3ff0587fd968a74858327e17e529567be2ff2746a0ba571a1e6b54ce816afa70967427c'
+Panopticon::Application.config.secret_token = 'o1c03c8a863ffef3dfd468a20bee651c98963b9d633a517ed73e46572e3ff0587fd968a74858327e17e529567be2ff2746a0ba571a1e6b54ce816afa70967427c'
View
2  features/step_definitions/session_steps.rb
@@ -1,4 +1,4 @@
Given /^I am (?:a|an) (admin)$/ do |role|
- user = User.create(:name => "user")
+ user = FactoryGirl.create(:user, :name => "user")
login_as user
end
View
2  script/import.rb
@@ -18,7 +18,7 @@ def build_params(hash, keys)
params = build_params(u, [
:name, :uid, :version, :email, :created_at, :updated_at
])
- User.create!(params)
+ FactoryGirl.create(:user, params)
end
export["artefacts"].each do |a|
View
2  test/integration/api_test.rb
@@ -14,7 +14,7 @@ def startup_server
end
def create_test_user
- User.create!(name: "Test", email: "test@example.com", uid: 123)
+ FactoryGirl.create(:user, name: "Test", email: "test@example.com", uid: 123)
end
test "Can create an artefact via the api" do
View
2  test/test_helper.rb
@@ -37,7 +37,7 @@ def app
end
def login_as_stub_user
- temp_user = User.create!(:name => 'Stub User')
+ temp_user = FactoryGirl.create(:user, :name => 'Stub User')
request.env['warden'] = stub(:authenticate! => true, :authenticated? => true, :user => temp_user)
end
Please sign in to comment.
Something went wrong with that request. Please try again.