Commit b227d25

mo <mo.khan@gmail.com>
2018-02-18 17:50:41
add command to read raw saml document.
1 parent 2426d77
Changed files (2)
lib
lib/saml/kit/cli/decode.rb
@@ -16,6 +16,14 @@ module Saml
           say error.message, :red
         end
 
+        desc "raw <file>", "Decode the contents of a decoded file"
+        def raw(file)
+          content = IO.read(File.expand_path(file))
+          print_report_for(Document.to_saml_document(content))
+        rescue StandardError => error
+          say error.message, :red
+        end
+
         private
 
         def print_report_for(document)
lib/saml/kit/cli/report.rb
@@ -54,7 +54,7 @@ module Saml
             table.push(['Assertion Present?', document.assertion.present?])
             table.push(['Issuer', document.assertion.issuer])
             table.push(['Name Id', document.assertion.name_id])
-            table.push(['Signed?', document.assertion.signed?])
+            table.push(['Signed?', !!document.assertion.signed?])
             table.push(['Attributes', document.assertion.attributes.inspect])
             table.push(['Not Before', document.assertion.started_at])
             table.push(['Not After', document.assertion.expired_at])