From 1a5e86865b9e0fd98ae0ed99ca5d925f3ddbf89b Mon Sep 17 00:00:00 2001 From: Philip Lambok Date: Tue, 6 May 2025 09:55:15 +0700 Subject: [PATCH 1/3] KRED-2061 handle logs in query params --- lib/xendit_api/client.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/xendit_api/client.rb b/lib/xendit_api/client.rb index 82f3c5d..271582a 100644 --- a/lib/xendit_api/client.rb +++ b/lib/xendit_api/client.rb @@ -33,17 +33,11 @@ def initialize(authorization = nil, options = {}) filtered_logs = options[:filtered_logs] if filtered_logs.respond_to?(:each) filtered_logs.each do |filter| - # Fix URL parameter style filtering log.filter(%r{(#{filter}=)([\w+-.?@:/]+)}, '\1[FILTERED]') - - # Fix JSON double-quoted style with proper spacing log.filter(/(#{filter}":\s*")(.*?)(")/i, '\1[FILTERED]\3') - - # Fix JSON numeric/boolean values (no quotes) log.filter(/(#{filter}":\s*)(\d+(?:\.\d+)?|true|false)/i, '\1[FILTERED]') - - # Fix array values in JSON log.filter(/(#{filter}":\s*)(\[.*?\])/i, '\1[FILTERED]') + log.filter(%r{(#{filter}=)([\w+-.?@:/]+)}, '\1[FILTERED]') end end end From 08e78972dba150ec63f43936489e27c93e771454 Mon Sep 17 00:00:00 2001 From: Philip Lambok Date: Tue, 6 May 2025 09:57:57 +0700 Subject: [PATCH 2/3] KRED-2061 fixes lint --- lib/xendit_api/client.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/xendit_api/client.rb b/lib/xendit_api/client.rb index 271582a..0384712 100644 --- a/lib/xendit_api/client.rb +++ b/lib/xendit_api/client.rb @@ -16,6 +16,7 @@ require 'logger' module XenditApi + # rubocop:disable Metrics/ClassLength class Client BASE_URL = 'https://api.xendit.co'.freeze @@ -142,4 +143,5 @@ def find_logger(logger_option) logger_option || XenditApi.configuration&.logger end end + # rubocop:enable Metrics/ClassLength end From 4f96f177d46a0f70ab89d33847f8814217afded1 Mon Sep 17 00:00:00 2001 From: Philip Lambok Date: Tue, 6 May 2025 10:38:54 +0700 Subject: [PATCH 3/3] KRED-2061 remvoe dup --- lib/xendit_api/client.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/xendit_api/client.rb b/lib/xendit_api/client.rb index 0384712..b33b789 100644 --- a/lib/xendit_api/client.rb +++ b/lib/xendit_api/client.rb @@ -38,7 +38,6 @@ def initialize(authorization = nil, options = {}) log.filter(/(#{filter}":\s*")(.*?)(")/i, '\1[FILTERED]\3') log.filter(/(#{filter}":\s*)(\d+(?:\.\d+)?|true|false)/i, '\1[FILTERED]') log.filter(/(#{filter}":\s*)(\[.*?\])/i, '\1[FILTERED]') - log.filter(%r{(#{filter}=)([\w+-.?@:/]+)}, '\1[FILTERED]') end end end