Class: CommandProcessor

Inherits:
Thor
  • Object
show all
Defined in:
lib/opensecret.rb

Overview

Note:

the Thor ruby gem is used for the heavy lifting

### This command line processor will

  • read the posted commands, options and switches

  • maps the incoming string data to objects

  • assert that the mandatory options exist

  • assert the type of each parameter

  • ensure that the parameter values are in range

  • delegate processing to the registered handlers

Examples:

opensecret initdomain create friends.joebloggs –secure

opensecret user create id=joe [email protected]

opensecret user create id=joe [email protected]

Instance Method Summary collapse

Instance Method Details

#init(domain, store_url) ⇒ Object

Initialize (configure) two fundamental crypt pointers

  • an opensecret domain like » **lecturers@harvard**

  • the url to a backend store like Git, S3 or an SSH accessible drive.

The domain will be extended to cover verified internet domains. They will also latch onto LDAP domains so when admins add, revoke or remove users, their opensecret access is adjusted accordingly.

Examples:

opensecret user create id=joe [email protected]

Parameters:

  • domain (String)

    the DOMAIN eg lecturers@harvard for your family or work group.

  • store_url (String)

    the STORE_URL for connecting to the backend storage service



41
42
43
44
45
46
47
48
49
50
# File 'lib/opensecret.rb', line 41

def init domain, store_url

  OpenSecret::Crypto.register_domain domain, store_url

  puts ""
  puts "New domain configured  => [ #{domain} ]"
  puts "Crypt store configured => [ #{store_url} ]"
  puts ""

end