Commit 34c8745
Changed files (8)
lib/saml/kit/authentication_request.rb
@@ -18,6 +18,8 @@ module Saml
def response_for(user)
Saml::Kit::Builders::Response.new(user, self)
end
+
+ Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::AuthenticationRequest::Builder', 'Saml::Kit::Builders::AuthenticationRequest')
end
end
end
lib/saml/kit/identity_provider_metadata.rb
@@ -32,6 +32,8 @@ module Saml
def self.builder_class
Saml::Kit::Builders::IdentityProviderMetadata
end
+
+ Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::IdentityProviderMetadata::Builder', 'Saml::Kit::Builders::IdentityProviderMetadata')
end
end
end
lib/saml/kit/logout_request.rb
@@ -21,6 +21,8 @@ module Saml
def response_for(user)
Saml::Kit::Builders::LogoutResponse.new(user, self)
end
+
+ Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::LogoutRequest::Builder', 'Saml::Kit::Builders::LogoutRequest')
end
end
end
lib/saml/kit/logout_response.rb
@@ -7,6 +7,8 @@ module Saml
@request_id = request_id
super(xml, name: "LogoutResponse")
end
+
+ Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::LogoutResponse::Builder', 'Saml::Kit::Builders::LogoutResponse')
end
end
end
lib/saml/kit/response.rb
@@ -98,6 +98,8 @@ module Saml
Saml::Kit.logger.error(error)
Time.at(0).to_datetime
end
+
+ Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::Response::Builder', 'Saml::Kit::Builders::Response')
end
end
end
lib/saml/kit/service_provider_metadata.rb
@@ -21,6 +21,8 @@ module Saml
def self.builder_class
Saml::Kit::Builders::ServiceProviderMetadata
end
+
+ Builder = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('Saml::Kit::ServiceProviderMetadata::Builder', 'Saml::Kit::Builders::ServiceProviderMetadata')
end
end
end
lib/saml/kit.rb
@@ -5,6 +5,7 @@ require "active_support/core_ext/date/calculations"
require "active_support/core_ext/hash/conversions"
require "active_support/core_ext/hash/indifferent_access"
require "active_support/core_ext/numeric/time"
+require "active_support/deprecation"
require "active_support/duration"
require "builder"
require "logger"
@@ -14,6 +15,7 @@ require "securerandom"
require "xmldsig"
require "saml/kit/buildable"
+require "saml/kit/builders"
require "saml/kit/namespaces"
require "saml/kit/serializable"
require "saml/kit/xsd_validatable"
@@ -41,8 +43,6 @@ require "saml/kit/service_provider_metadata"
require "saml/kit/signature"
require "saml/kit/xml"
-require "saml/kit/builders"
-
I18n.load_path += Dir[File.expand_path("kit/locales/*.yml", File.dirname(__FILE__))]
module Saml
spec/saml/service_provider_metadata_spec.rb
@@ -142,4 +142,11 @@ RSpec.describe Saml::Kit::ServiceProviderMetadata do
expect(result.assertion_consumer_service_for(binding: :http_post).location).to eql(acs_url)
end
end
+
+ describe "deprecations" do
+ it 'resolves the old builder constant' do
+ subject = Saml::Kit::ServiceProviderMetadata::Builder.new
+ expect(subject).to be_present
+ end
+ end
end