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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ef88fa993a4960f8bad06af2fb7aecc46fb00748a6443bdad18f85cab2a0cb3
4
- data.tar.gz: f9cf7c5c2ae3166c328fcadc8a7c58b4a41d6f39eb9c181043e8720e3050b342
3
+ metadata.gz: cd3179167342c31903cd9e1b100071f4452832f9c2b537c6fe81d466a97b5f5f
4
+ data.tar.gz: ac8e6f7dce3f0c1c340e5e3c21213fd23c98624e253fcaca7e875a9bbf190938
5
5
  SHA512:
6
- metadata.gz: 729fc3f950dddf6e778d21d8b028920e3cb99b642222cf777858e93616a8cdfdf6e454f9dff3fb29d7f655afdaa461558f3459d542e7e26c1c7e3b9d4be4a47c
7
- data.tar.gz: c2e82c231509878a9b31976d3b80f9029b23a0867428c504f11a1f6f5d395bd20dbed2175230626932906a0b5bdf7df2be77e8e814d73f96fd39cf6ddd727d96
6
+ metadata.gz: 6ce70fd22d11ce198e924d7d3ae332f87f8b1f1270e3d51c584652ade92cbf7c1aeba912cb51d15f8b16e59818d9a5a967731e4778b172810904b39092b962aa
7
+ data.tar.gz: 656c84e5f659e257bf707e09f4c88ae09b47da92456be53eabaf25f422be33d17abc293858e79fa87264ab3d02390cedc77a533e24941bc5422510342a69c5e0
@@ -1,7 +1,7 @@
1
1
  module Saml
2
2
  module Kit
3
3
  module Cli
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
6
6
  end
7
7
  end
@@ -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
- path = File.expand_path(file)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saml-kit-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan