Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ial/aal concerns #117

Merged
merged 1 commit into from
Sep 3, 2024
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.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
saml_idp (0.21.8.pre.18f)
saml_idp (0.22.0.pre.18f)
activesupport
builder
faraday
Expand Down
15 changes: 0 additions & 15 deletions lib/saml_idp/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
require 'saml_idp/service_provider'
module SamlIdp
class Request
IAL_PREFIX = %r{^http://idmanagement.gov/ns/assurance/ial}
LOA_PREFIX = %r{^http://idmanagement.gov/ns/assurance/loa}
AAL_PREFIX = %r{^http://idmanagement.gov/ns/assurance/aal|urn:gov:gsa:ac:classes:sp:PasswordProtectedTransport:duo}
VTR_REGEXP = /\A[A-Z][a-z0-9](\.[A-Z][a-z0-9])*\z/

def self.from_deflated_request(raw, options = {})
Expand Down Expand Up @@ -90,18 +87,6 @@ def requested_authn_contexts
end
end

def requested_ial_authn_context
requested_authn_contexts.select do |classref|
IAL_PREFIX.match?(classref) || LOA_PREFIX.match?(classref)
end.first
end

def requested_aal_authn_context
requested_authn_contexts.select do |classref|
AAL_PREFIX.match?(classref)
end.first
end

def requested_vtr_authn_contexts

Choose a reason for hiding this comment

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

question (): This can be removed too? It will require adjusting the vtr values handler in the idp code to not raise an error and simply remove any invalid/unknown values from the list of values.

Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about it, but decided against it as I felt that it should be dealt with when we remove all VOT code.

requested_authn_contexts.select do |classref|
VTR_REGEXP.match?(classref)
Expand Down
2 changes: 1 addition & 1 deletion lib/saml_idp/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SamlIdp
VERSION = '0.21.8-18f'.freeze
VERSION = '0.22.0-18f'.freeze
end
64 changes: 0 additions & 64 deletions spec/lib/saml_idp/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,70 +216,6 @@ module SamlIdp
end
end

describe '#requested_aal_authn_context' do
subject { described_class.new raw_authn_request }

context 'no aal context requested' do
let(:authn_context_classref) { '' }

it 'returns nil' do
expect(subject.requested_aal_authn_context).to be_nil
end
end

context 'context requested is default aal' do
let(:authn_context_classref) { build_authn_context_classref(default_aal) }

it 'returns the aal uri' do
expect(subject.requested_aal_authn_context).to eq(default_aal)
end
end

context 'only context requested is aal' do
let(:authn_context_classref) { build_authn_context_classref(aal) }

it 'returns the aal uri' do
expect(subject.requested_aal_authn_context).to eq(aal)
end
end

context 'multiple contexts requested including aal' do
let(:authn_context_classref) { build_authn_context_classref([ial, aal]) }

it 'returns the aal uri' do
expect(subject.requested_aal_authn_context).to eq(aal)
end
end
end

describe '#requested_ial_authn_context' do
subject { described_class.new raw_authn_request }

context 'no ial context requested' do
let(:authn_context_classref) { '' }

it 'returns nil' do
expect(subject.requested_ial_authn_context).to be_nil
end
end

context 'only context requested is ial' do
let(:authn_context_classref) { build_authn_context_classref(ial) }

it 'returns the ial uri' do
expect(subject.requested_ial_authn_context).to eq(ial)
end
end

context 'multiple contexts requested including ial' do
let(:authn_context_classref) { build_authn_context_classref([aal, ial]) }

it 'returns the ial uri' do
expect(subject.requested_ial_authn_context).to eq(ial)
end
end
end

describe '#requested_vtr_authn_contexts' do
subject { described_class.new raw_authn_request }

Expand Down