Module: RestFtpDaemon::ApiHelpers

Defined in:
lib/rest-ftp-daemon/helpers/api.rb

Instance Method Summary collapse

Instance Method Details

#get_censored_configObject



16
17
18
19
20
21
22
# File 'lib/rest-ftp-daemon/helpers/api.rb', line 16

def get_censored_config
  config              = Conf.to_hash
  config[:users]      = Conf[:users].keys if Conf[:users]
  config[:endpoints]  = Conf[:endpoints].keys if Conf[:endpoints]
  config[:credentials]  = Conf[:credentials].keys if Conf[:credentials]
  config
end

#log_requestObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/rest-ftp-daemon/helpers/api.rb', line 4

def log_request
  if env.nil?
    puts "HTTP_ENV_IS_NIL: #{env.inspect}"
    return
  end

  request_method = env['REQUEST_METHOD']
  request_path   = env['REQUEST_PATH']
  request_uri    = env['REQUEST_URI']
  log_info       "HTTP #{request_method} #{request_uri}", params
end