Commit 86655b6

mo <mo.khan@gmail.com>
2017-12-28 19:04:37
drop Xml prefix.
1 parent 66fe4a7
lib/saml/kit/assertion.rb
@@ -75,7 +75,7 @@ module Saml
         @assertion ||=
           if encrypted?
             private_keys = configuration.private_keys(use: :encryption)
-            decryptor = ::Xml::Kit::XmlDecryption.new(private_keys: private_keys)
+            decryptor = ::Xml::Kit::Decryption.new(private_keys: private_keys)
             decrypted = decryptor.decrypt(@xml_hash['Response']['EncryptedAssertion'])
             Saml::Kit.logger.debug(decrypted)
             Hash.from_xml(decrypted)['Assertion']
spec/saml/builders/response_spec.rb
@@ -93,7 +93,7 @@ RSpec.describe Saml::Kit::Builders::Response do
       result = Hash.from_xml(subject.to_xml)
       expect(result['Response']['EncryptedAssertion']).to be_present
       encrypted_assertion = result['Response']['EncryptedAssertion']
-      decrypted_assertion = Xml::Kit::XmlDecryption.new(private_keys: configuration.private_keys(use: :encryption)).decrypt(encrypted_assertion)
+      decrypted_assertion = Xml::Kit::Decryption.new(private_keys: configuration.private_keys(use: :encryption)).decrypt(encrypted_assertion)
       decrypted_hash = Hash.from_xml(decrypted_assertion)
       expect(decrypted_hash['Assertion']).to be_present
       expect(decrypted_hash['Assertion']['Issuer']).to be_present
xml-kit/lib/xml/kit/builders/templates/xml_encryption.builder → xml-kit/lib/xml/kit/builders/templates/encryption.builder
File renamed without changes
xml-kit/lib/xml/kit/builders/templates/xml_signature.builder → xml-kit/lib/xml/kit/builders/templates/signature.builder
File renamed without changes
xml-kit/lib/xml/kit/builders/xml_encryption.rb → xml-kit/lib/xml/kit/builders/encryption.rb
@@ -1,7 +1,7 @@
 module Xml
   module Kit
     module Builders
-      class XmlEncryption
+      class Encryption
         attr_reader :public_key
         attr_reader :key, :iv, :encrypted
 
xml-kit/lib/xml/kit/builders/xml_signature.rb → xml-kit/lib/xml/kit/builders/signature.rb
@@ -1,7 +1,7 @@
 module Xml
   module Kit
     module Builders
-      class XmlSignature
+      class Signature
         SIGNATURE_METHODS = {
           SHA1: "http://www.w3.org/2000/09/xmldsig#rsa-sha1",
           SHA224: "http://www.w3.org/2001/04/xmldsig-more#rsa-sha224",
xml-kit/lib/xml/kit/xml_decryption.rb → xml-kit/lib/xml/kit/decryption.rb
@@ -1,7 +1,7 @@
 module Xml
   module Kit
     # {include:file:spec/saml/xml_decryption_spec.rb}
-    class XmlDecryption
+    class Decryption
       # The list of private keys to use to attempt to decrypt the document.
       attr_reader :private_keys
 
xml-kit/lib/xml/kit/signatures.rb
@@ -20,7 +20,7 @@ module Xml
       def build(reference_id)
         return nil if key_pair.nil?
 
-        ::Xml::Kit::Builders::XmlSignature.new(
+        ::Xml::Kit::Builders::Signature.new(
           reference_id,
           certificate: key_pair.certificate,
           signature_method: signature_method,
xml-kit/lib/xml/kit/templatable.rb
@@ -25,7 +25,7 @@ module Xml
           temp = ::Builder::XmlMarkup.new
           yield temp
           signed_xml = signatures.complete(temp.target!)
-          xml_encryption = ::Xml::Kit::Builders::XmlEncryption.new(
+          xml_encryption = ::Xml::Kit::Builders::Encryption.new(
             signed_xml,
             encryption_certificate.public_key
           )
xml-kit/lib/xml/kit.rb
@@ -10,10 +10,11 @@ require "xmldsig"
 
 require "xml/kit/namespaces"
 
-require "xml/kit/builders/xml_encryption"
-require "xml/kit/builders/xml_signature"
+require "xml/kit/builders/encryption"
+require "xml/kit/builders/signature"
 require "xml/kit/certificate"
 require "xml/kit/crypto"
+require "xml/kit/decryption"
 require "xml/kit/document"
 require "xml/kit/fingerprint"
 require "xml/kit/id"
@@ -23,7 +24,6 @@ require "xml/kit/signatures"
 require "xml/kit/templatable"
 require "xml/kit/template"
 require "xml/kit/version"
-require "xml/kit/xml_decryption"
 
 module Xml
   module Kit
xml-kit/spec/xml/xml_decryption_spec.rb → xml-kit/spec/xml/decryption_spec.rb
@@ -1,4 +1,4 @@
-RSpec.describe Xml::Kit::XmlDecryption do
+RSpec.describe Xml::Kit::Decryption do
   describe "#decrypt" do
     let(:secret) { FFaker::Movie.title }
     let(:password) { FFaker::Movie.title }