Class: Sambot::Domain::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/sambot/domain/session.rb

Class Method Summary collapse

Class Method Details

.start(username, password) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/sambot/domain/session.rb', line 5

def self.start(username, password)
  UI.debug("Opening a tunnel to the Rackspace DEV/QE environment...")
  bastion = BastionHost.new.connect(username, password)
  bastion.forwards.each do |forward|
    UI.debug(" -- #{forward} will be forwarded to #{forward}")
  end
  UI.debug("Authenticating with Hashicorp Vault in Rackspace DEV/QE...")
  token = Vault.authenticate(username, password)
  UI.debug("Saving your Vault authentication token to ~/.vault-token...")
  Vault.save_token(token)
  UI.info("Your session has now started. Run `sambot session stop` to close it.")
end

.stopObject



18
19
20
21
# File 'lib/sambot/domain/session.rb', line 18

def self.stop
  BastionHost.disconnect
  UI.info("Your session has been closed.")
end