Class: Saml::Kit::Cli::Commands::Decode

Inherits:
Thor
  • Object
show all
Defined in:
lib/saml/kit/cli/commands/decode.rb

Instance Method Summary collapse

Instance Method Details

#post(saml) ⇒ Object



21
22
23
24
25
# File 'lib/saml/kit/cli/commands/decode.rb', line 21

def post(saml)
  print_report_for(post_binding.deserialize('SAMLRequest' => saml))
rescue StandardError => error
  say error.message, :red
end

#raw(file) ⇒ Object



28
29
30
31
32
33
# File 'lib/saml/kit/cli/commands/decode.rb', line 28

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

#redirect(uri) ⇒ Object



10
11
12
13
14
# File 'lib/saml/kit/cli/commands/decode.rb', line 10

def redirect(uri)
  print_report_for(redirect_binding.deserialize(uri))
rescue StandardError => error
  say error.message, :red
end