Commit c2af960

mo <mo@mokhan.ca>
2017-11-18 01:31:58
push up the ID
1 parent e28f80f
lib/saml/kit/authentication_request.rb
@@ -12,10 +12,6 @@ module Saml
         super(xml, name: "AuthnRequest", query_string_parameter: 'SAMLRequest')
       end
 
-      def id
-        to_h[name]['ID']
-      end
-
       def destination
         to_h[name]['Destination']
       end
lib/saml/kit/document.rb
@@ -15,6 +15,10 @@ module Saml
         @xml_hash = Hash.from_xml(xml) || {}
       end
 
+      def id
+        to_h.fetch(name, {}).fetch('ID', nil)
+      end
+
       def to_h
         @xml_hash
       end
lib/saml/kit/logout_request.rb
@@ -12,10 +12,6 @@ module Saml
         super(xml, name: "LogoutRequest", query_string_parameter: 'SAMLRequest')
       end
 
-      def id
-        to_h[name]['ID']
-      end
-
       def issuer
         to_h[name]['Issuer']
       end
lib/saml/kit/logout_response.rb
@@ -5,10 +5,6 @@ module Saml
         super(xml, name: "LogoutResponse", query_string_parameter: 'SAMLResponse')
       end
 
-      def id
-        to_h[name]['ID']
-      end
-
       def issue_instant
         to_h[name]['IssueInstant']
       end
lib/saml/kit/response.rb
@@ -20,10 +20,6 @@ module Saml
         super(xml, name: "Response", query_string_parameter: 'SAMLResponse')
       end
 
-      def id
-        to_h.fetch(name, {}).fetch('ID', nil)
-      end
-
       def in_response_to
         to_h.fetch(name, {}).fetch('InResponseTo', nil)
       end