Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

[pull] develop from alphagov:master #83

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source "https://rubygems.org/"
gem "activerecord", "~> 6.0.3" # Ideally version should be synced with Transition
gem "erubis", "2.7.0"
gem "govuk_app_config"
gem "nokogiri", "1.10.10"
gem "nokogiri", "1.11.0"
gem "optic14n", "2.1.0" # Ideally version should be synced with Transition
gem "pg", "1.2.3"
gem "rack", "~> 2.2.3"
Expand All @@ -22,5 +22,5 @@ end

group :development, :test do
gem "rspec"
gem "rubocop-govuk"
gem "rubocop-govuk", "4.0.0.pre.1", require: false # Trialling pre-release
end
77 changes: 40 additions & 37 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
GEM
remote: https://rubygems.org/
specs:
activemodel (6.0.3.2)
activesupport (= 6.0.3.2)
activerecord (6.0.3.2)
activemodel (= 6.0.3.2)
activesupport (= 6.0.3.2)
activesupport (6.0.3.2)
activemodel (6.0.3.5)
activesupport (= 6.0.3.5)
activerecord (6.0.3.5)
activemodel (= 6.0.3.5)
activesupport (= 6.0.3.5)
activesupport (6.0.3.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.1)
ast (2.4.2)
coderay (1.1.2)
concurrent-ruby (1.1.7)
concurrent-ruby (1.1.8)
database_cleaner (1.8.5)
diff-lcs (1.4.4)
docile (1.3.2)
Expand All @@ -27,12 +27,12 @@ GEM
ruby2_keywords
faraday-net_http (1.0.1)
ffi (1.9.25)
govuk_app_config (2.8.3)
govuk_app_config (2.9.1)
logstasher (>= 1.2.2, < 2.2.0)
sentry-raven (~> 3.1.1)
statsd-ruby (~> 1.5.0)
unicorn (>= 5.4, < 5.9)
i18n (1.8.7)
i18n (1.8.9)
concurrent-ruby (~> 1.0)
kgio (2.11.3)
listen (1.3.1)
Expand All @@ -43,26 +43,28 @@ GEM
activesupport (>= 5.2)
request_store
method_source (1.0.0)
mini_portile2 (2.4.0)
minitest (5.14.3)
mini_portile2 (2.5.0)
minitest (5.14.4)
mr-sparkle (0.3.0)
listen (~> 1.0)
rb-fsevent (>= 0.9)
rb-inotify (>= 0.8)
unicorn (>= 4.5)
multipart-post (2.1.1)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogiri (1.11.0)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
optic14n (2.1.0)
addressable (~> 2.7)
parallel (1.19.2)
parser (2.7.2.0)
parallel (1.20.1)
parser (3.0.0.0)
ast (~> 2.4.1)
pg (1.2.3)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
racc (1.5.2)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
Expand All @@ -74,7 +76,7 @@ GEM
ffi (>= 0.5.0, < 2)
rb-kqueue (0.2.5)
ffi (>= 0.5.0)
regexp_parser (1.8.2)
regexp_parser (2.1.1)
request_store (1.5.0)
rack (>= 1.4)
rexml (3.2.4)
Expand All @@ -91,33 +93,34 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.0)
rubocop (0.87.1)
rubocop (1.10.0)
parallel (~> 1.10)
parser (>= 2.7.1.1)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.7)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 0.1.0, < 1.0)
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.8.0)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-govuk (3.17.2)
rubocop (= 0.87.1)
rubocop-ast (= 0.8.0)
rubocop-rails (= 2.8.1)
rubocop-govuk (4.0.0.pre.1)
rubocop (~> 1.10.0)
rubocop-ast (~> 1.4.0)
rubocop-rails (~> 2.9.1)
rubocop-rake (= 0.5.1)
rubocop-rspec (= 1.42.0)
rubocop-rails (2.8.1)
rubocop-rspec (~> 2.2.0)
rubocop-rails (2.9.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.87.0)
rubocop (>= 0.90.0, < 2.0)
rubocop-rake (0.5.1)
rubocop
rubocop-rspec (1.42.0)
rubocop (>= 0.87.0)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
rubocop-rspec (2.2.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.4)
sentry-raven (3.1.1)
faraday (>= 1.0)
simplecov (0.19.0)
Expand All @@ -128,7 +131,7 @@ GEM
thread_safe (0.3.6)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
unicode-display_width (2.0.0)
unicorn (5.8.0)
kgio (~> 2.6)
raindrops (~> 0.7)
Expand All @@ -143,15 +146,15 @@ DEPENDENCIES
erubis (= 2.7.0)
govuk_app_config
mr-sparkle (= 0.3.0)
nokogiri (= 1.10.10)
nokogiri (= 1.11.0)
optic14n (= 2.1.0)
pg (= 1.2.3)
pry
rack (~> 2.2.3)
rack-test (= 1.1.0)
rake (= 13.0.1)
rspec
rubocop-govuk
rubocop-govuk (= 4.0.0.pre.1)
simplecov

BUNDLED WITH
Expand Down
1 change: 1 addition & 0 deletions lib/benchmark/all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class All
DEFAULT_NUMBER_OF_RUNS = 1000

attr_accessor :number_of_runs

def initialize(number_of_runs)
self.number_of_runs = (number_of_runs || DEFAULT_NUMBER_OF_RUNS).to_i
end
Expand Down
6 changes: 3 additions & 3 deletions lib/bouncer/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ def initialize
def call(env)
context = RequestContext.new(CanonicalizedRequest.new(env))

outcome = if context.request.path == "/healthcheck"
outcome = if !context.valid?
Outcome::BadRequest
elsif context.request.path == "/healthcheck"
Outcome::Healthcheck
elsif context.host.nil?
Outcome::UnrecognisedHost
elsif !context.valid?
Outcome::BadRequest
elsif ["/404", "/410"].include?(context.request.path)
Outcome::TestThe4xxPages
elsif context.host.hostname == "www.direct.gov.uk" && context.request.path == "/__canary__"
Expand Down
2 changes: 1 addition & 1 deletion lib/bouncer/outcome/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Outcome

def_delegators :context, :request

private
private

def guarded_redirect(url)
if legal_redirect?(url)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/http_request_handling_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ def app
describe "#body" do
subject { super().body }

it { is_expected.to match %r{non\-whitelisted} }
it { is_expected.to match %r{non-whitelisted} }
it { is_expected.to match %r{spam.net} }
end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

Dir[File.dirname(__FILE__) + "/support/*.rb"].sort.each { |file| require file }
Dir["#{File.dirname(__FILE__)}/support/*.rb"].sort.each { |file| require file }

RACK_ENV = "test".freeze
require "rack/test"
Expand Down