Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ gem 'rqrcode'
gem 'ruby-progressbar'
gem 'ruby-saml'
gem 'safe_target_blank', '>= 1.0.2'
gem 'saml_idp', github: '18F/saml_idp', tag: '0.18.0-18f'
gem 'saml_idp', github: '18F/saml_idp', tag: '0.18.1-18f'
gem 'scrypt'
gem 'simple_form', '>= 5.0.2'
gem 'sprockets-rails'
Expand Down
10 changes: 2 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ GIT

GIT
remote: https://github.com/18F/saml_idp.git
revision: 7f516c9e2c608ac92ee0c41daecfdb9208c7ec5a
tag: 0.18.0-18f
revision: d8e7deb7da3aa43bae0e5b0891c8de123d492484
tag: 0.18.1-18f
specs:
saml_idp (0.18.0.pre.18f)
activesupport
builder
faraday
nokogiri (>= 1.10.2)
pkcs11
uuid

GIT
remote: https://github.com/hashrocket/capybara-webmock.git
Expand Down Expand Up @@ -380,8 +379,6 @@ GEM
zeitwerk (~> 2.5)
lru_redux (1.1.0)
lumberjack (1.2.8)
macaddr (1.7.2)
systemu (~> 2.6.5)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
Expand Down Expand Up @@ -645,7 +642,6 @@ GEM
activerecord (>= 5.2)
strscan (3.0.5)
subprocess (1.5.5)
systemu (2.6.5)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.1)
Expand All @@ -663,8 +659,6 @@ GEM
unf_ext (0.0.8)
unicode-display_width (2.4.0)
uniform_notifier (1.16.0)
uuid (2.3.9)
macaddr (~> 1.0)
valid_email (0.1.4)
activemodel
mail (>= 2.6.1)
Expand Down
1 change: 0 additions & 1 deletion app/controllers/saml_idp_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'saml_idp_constants'
require 'saml_idp'
require 'uuid'

class SamlIdpController < ApplicationController
include SamlIdp::Controller
Expand Down
8 changes: 1 addition & 7 deletions config/initializers/ahoy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,8 @@ def event_logger
end

def invalid_uuid?(token)
# The match? method does not exist for the Regexp class in Ruby < 2.4
# Here, it comes from Active Support. Once we upgrade to Ruby 2.5,
# we probably want to ignore the Rails definition and use Ruby's.
# To do that, we'll need to set `config.active_support.bare = true`,
# and then only require the extensions we use.
token = Utf8Cleaner.new(token).remove_invalid_utf8_bytes
uuid_regex = /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/
!uuid_regex.match?(token)
!Idp::Constants::UUID_REGEX.match?(token)
end
end
end
1 change: 1 addition & 0 deletions lib/idp/constants.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Idp
module Constants
UUID_REGEX = /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/
module Vendors
ACUANT = 'acuant'
LEXIS_NEXIS = 'lexis_nexis'
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/saml_idp_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ def name_id_version(format_urn)
end

it 'includes an ID attribute with a valid UUID' do
expect(UUID.validate(assertion['ID'][1..-1])).to eq(true)
expect(Idp::Constants::UUID_REGEX.match?(assertion['ID'][1..-1])).to eq(true)
expect(assertion['ID']).to eq "_#{user.last_identity.session_uuid}"
end

Expand Down Expand Up @@ -1705,7 +1705,7 @@ def name_id_version(format_urn)
end

it 'includes a URI attribute' do
expect(UUID.validate(reference['URI'][2..-1])).to eq(true)
expect(Idp::Constants::UUID_REGEX.match?(reference['URI'][2..-1])).to eq(true)
end
end
end
Expand Down