 
   robot.respond /sensu info/i, (msg) ->
     validateVars
-    robot.http(config.sensu_api + '/info')
+    credential = createCredential
+    req = robot.http(config.sensu_api + '/info')
+    if credential
+      req = req.headers(Authorization: credential)
+    req
       .get() (err, res, body) ->
         if err
           msg.send "Sensu says: #{err}"

    data['expire'] = expiration
    data['path'] = 'silence/' + path

    robot.http(config.sensu_api + '/stashes')
      .post(JSON.stringify(data)) (err, res, body) ->
        if res.statusCode is 201
          msg.send path + ' silenced for ' + human_d

#   "moment": ">=1.6.0"
#
# Configuration:
#   HUBOT_SENSU_API_URL - URL for the sensu api service.  http://sensu.yourdomain.com:4567
#   HUBOT_SENSU_DOMAIN - Domain to force on all clients.  Not used if blank/unset
#   HUBOT_SENSU_API_USERNAME - Username for the sensu api basic auth. Not used if blank/unset
#   HUBOT_SENSU_API_PASSWORD - Password for the sensu api basic auth. Not used if blank/unset
#
# Commands:
#   hubot sensu info - show sensu api info
