saml-kit-cli 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saml/kit/cli/version.rb +1 -1
- data/lib/saml/kit/cli/xml_digital_signature.rb +13 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd3179167342c31903cd9e1b100071f4452832f9c2b537c6fe81d466a97b5f5f
|
4
|
+
data.tar.gz: ac8e6f7dce3f0c1c340e5e3c21213fd23c98624e253fcaca7e875a9bbf190938
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ce70fd22d11ce198e924d7d3ae332f87f8b1f1270e3d51c584652ade92cbf7c1aeba912cb51d15f8b16e59818d9a5a967731e4778b172810904b39092b962aa
|
7
|
+
data.tar.gz: 656c84e5f659e257bf707e09f4c88ae09b47da92456be53eabaf25f422be33d17abc293858e79fa87264ab3d02390cedc77a533e24941bc5422510342a69c5e0
|
data/lib/saml/kit/cli/version.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
1
3
|
module Saml
|
2
4
|
module Kit
|
3
5
|
module Cli
|
@@ -6,11 +8,18 @@ module Saml
|
|
6
8
|
method_option :format, default: "short", required: false, enum: ["short", "full"]
|
7
9
|
def verify(file)
|
8
10
|
format = options[:format]
|
9
|
-
|
10
|
-
say_status :status, "Attempting to read #{path}...", :yellow
|
11
|
-
content = IO.read(path)
|
12
|
-
document = ::Xml::Kit::Document.new(content)
|
11
|
+
uri = URI.parse(file) rescue nil
|
13
12
|
|
13
|
+
if uri.nil?
|
14
|
+
path = File.expand_path(file)
|
15
|
+
say_status :status, "Attempting to read #{path}...", :yellow
|
16
|
+
content = IO.read(path)
|
17
|
+
else
|
18
|
+
say_status :status, "Downloading from #{uri}...", :yellow
|
19
|
+
content = Net::HTTP.get_response(uri).body.chomp
|
20
|
+
end
|
21
|
+
document = ::Xml::Kit::Document.new(content)
|
22
|
+
say document.to_xml(pretty: true)
|
14
23
|
if document.valid?
|
15
24
|
say_status :success, "#{file} is valid", :green
|
16
25
|
else
|