Commit 7fde965

mo <mo@mokhan.ca>
2017-11-15 23:02:01
remove build_request method.
1 parent fb32b86
lib/saml/kit/identity_provider_metadata.rb
@@ -39,12 +39,6 @@ module Saml
         end
       end
 
-      def build_request(type, user = nil)
-        builder = type::Builder.new(user, sign: want_authn_requests_signed)
-        yield builder if block_given?
-        builder.build
-      end
-
       class Builder
         attr_accessor :id, :organization_name, :organization_url, :contact_email, :entity_id, :attributes, :name_id_formats
         attr_accessor :want_authn_requests_signed, :sign
spec/saml/identity_provider_metadata_spec.rb
@@ -265,24 +265,6 @@ RSpec.describe Saml::Kit::IdentityProviderMetadata do
     end
   end
 
-  describe "#build_request" do
-    let(:builder) { described_class::Builder.new }
-
-    it 'it signs the authentication request when the idp metadata demands it' do
-      builder.want_authn_requests_signed = true
-      subject = builder.build
-
-      expect(subject.build_request(Saml::Kit::AuthenticationRequest)).to be_signed
-    end
-
-    it 'does not sign the authentication request when the idp does not require it' do
-      builder.want_authn_requests_signed = false
-      subject = builder.build
-
-      expect(subject.build_request(Saml::Kit::AuthenticationRequest)).to_not be_signed
-    end
-  end
-
   describe "#single_logout_service_for" do
     let(:builder) { described_class::Builder.new }
     let(:redirect_url) { FFaker::Internet.http_url }