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 lib/saml_idp/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Request
IAL_PREFIX = %r{^http://idmanagement.gov/ns/assurance/ial}.freeze
LOA_PREFIX = %r{^http://idmanagement.gov/ns/assurance/loa}.freeze
AAL_PREFIX = %r{^http://idmanagement.gov/ns/assurance/aal|urn:gov:gsa:ac:classes:sp:PasswordProtectedTransport:duo}.freeze
VTR_REGEXP = %r{[A-Z][a-z0-9](\.[A-Z][a-z0-9])*}.freeze
VTR_REGEXP = %r{\A[A-Z][a-z0-9](\.[A-Z][a-z0-9])*\z}.freeze

def self.from_deflated_request(raw, options = {})
if raw
Expand Down
2 changes: 1 addition & 1 deletion lib/saml_idp/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# encoding: utf-8
module SamlIdp
VERSION = '0.19.0-18f'.freeze
VERSION = '0.19.1-18f'.freeze
end
20 changes: 20 additions & 0 deletions spec/lib/saml_idp/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,26 @@ module SamlIdp
expect(subject.requested_vtr_authn_context).to eq(vtr)
end
end

context 'context that contains a VTR substring but is not a VTR' do
let(:authn_context_classref) do
fake_vtr = 'Not a VTR but does contain LetT3.Rs and Nu.Mb.Ers'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a beautiful fake vtr

build_authn_context_classref(fake_vtr)
end

it 'does not match on the context' do
expect(subject.requested_vtr_authn_context).to be_nil
end
end

context 'with the default MFA context' do
let(:aal) { 'urn:gov:gsa:ac:classes:sp:PasswordProtectedTransport:duo' }
let(:authn_context_classref) { build_authn_context_classref(aal) }

it 'does not match on the context' do
expect(subject.requested_vtr_authn_context).to be_nil
end
end
end

describe '#valid?' do
Expand Down