Filter EPP login password

This commit is contained in:
Martin Lensment 2015-05-19 13:13:06 +03:00
parent dd3145b292
commit 254849494f

View file

@ -239,8 +239,15 @@ class EppController < ApplicationController
def write_to_epp_log
# return nil if EPP_LOG_ENABLED
request_command = params[:command] || params[:action] # error receives :command, other methods receive :action
frame = params[:raw_frame] || params[:frame]
# filter pw
if request_command == 'login' && frame.present?
frame.gsub!(/<pw>.+<\/pw>/, '<pw>[FILTERED]</pw>')
end
ApiLog::EppLog.create({
request: params[:raw_frame] || params[:frame],
request: frame,
request_command: request_command,
request_successful: epp_errors.empty?,
request_object: params[:epp_object_type],