Class: TLSmap::CLI

Inherits:
App
  • Object
show all
Defined in:
lib/tls_map/cli/cli.rb

Overview

Offline version of App

Defined Under Namespace

Classes: Extended

Constant Summary collapse

INTEGRITY =

sha2-256

'a04956498a5838c5f55cc58f255bd143a646826c8e709048d17e7d09adae0b4e'

Constants inherited from App

App::GNUTLS_URL, App::IANA_URL, App::NSS_URL, App::OPENSSL_URL, App::OPENSSL_URL2

Instance Attribute Summary

Attributes inherited from App

#tls_map

Instance Method Summary collapse

Methods inherited from App

#bulk_search, #export, #search, search

Constructor Details

#initialize(force = false) ⇒ CLI

Load and parse data from marshalized hash (data/mapping.marshal). It must match the integrity check for security purpose.

Parameters:

  • force (Boolean) (defaults to: false)

    Force parsing even if integrity check failed (DANGEROUS, may result in command execution vulnerability)



16
17
18
19
20
21
22
# File 'lib/tls_map/cli/cli.rb', line 16

def initialize(force = false)
  @storage_location = 'data/'
  @database_path = absolute_db_path('mapping.marshal')
  database_exists?
  @tls_map = []
  parse(force)
end

Instance Method Details

#updateObject



50
51
52
53
# File 'lib/tls_map/cli/cli.rb', line 50

def update
  tm = TLSmap::App.new
  tm.export(@database_path, :marshal)
end