mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Filter EPP login password
This commit is contained in:
parent
dd3145b292
commit
254849494f
1 changed files with 9 additions and 2 deletions
|
@ -62,7 +62,7 @@ class EppController < ApplicationController
|
||||||
@errors << {
|
@errors << {
|
||||||
code: '1',
|
code: '1',
|
||||||
msg: 'handle_errors was executed when there were actually no errors'
|
msg: 'handle_errors was executed when there were actually no errors'
|
||||||
}
|
}
|
||||||
# rubocop:disable Rails/Output
|
# rubocop:disable Rails/Output
|
||||||
puts obj.errors.full_messages if Rails.env.test?
|
puts obj.errors.full_messages if Rails.env.test?
|
||||||
# rubocop: enable Rails/Output
|
# rubocop: enable Rails/Output
|
||||||
|
@ -239,8 +239,15 @@ class EppController < ApplicationController
|
||||||
def write_to_epp_log
|
def write_to_epp_log
|
||||||
# return nil if EPP_LOG_ENABLED
|
# return nil if EPP_LOG_ENABLED
|
||||||
request_command = params[:command] || params[:action] # error receives :command, other methods receive :action
|
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({
|
ApiLog::EppLog.create({
|
||||||
request: params[:raw_frame] || params[:frame],
|
request: frame,
|
||||||
request_command: request_command,
|
request_command: request_command,
|
||||||
request_successful: epp_errors.empty?,
|
request_successful: epp_errors.empty?,
|
||||||
request_object: params[:epp_object_type],
|
request_object: params[:epp_object_type],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue