Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-redfish for openSUSE:Factory 
checked in at 2022-12-08 16:52:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-redfish (Old)
 and      /work/SRC/openSUSE:Factory/.python-redfish.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-redfish"

Thu Dec  8 16:52:17 2022 rev:12 rq:1041345 version:3.1.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-redfish/python-redfish.changes    
2022-10-29 20:18:38.434700993 +0200
+++ /work/SRC/openSUSE:Factory/.python-redfish.new.1835/python-redfish.changes  
2022-12-08 16:52:26.683870105 +0100
@@ -1,0 +2,7 @@
+Wed Dec  7 22:16:56 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to 3.1.8 
+  * Added request headers to debug log output
+  * Added redacting of 'Password' properties from request bodies from debug 
logs
+
+-------------------------------------------------------------------

Old:
----
  redfish-3.1.7.tar.gz

New:
----
  redfish-3.1.8.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-redfish.spec ++++++
--- /var/tmp/diff_new_pack.DPZqla/_old  2022-12-08 16:52:28.059877163 +0100
+++ /var/tmp/diff_new_pack.DPZqla/_new  2022-12-08 16:52:28.059877163 +0100
@@ -19,7 +19,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-redfish
-Version:        3.1.7
+Version:        3.1.8
 Release:        0
 Summary:        Redfish Python Library
 License:        BSD-3-Clause

++++++ redfish-3.1.7.tar.gz -> redfish-3.1.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-redfish-library-3.1.7/CHANGELOG.md 
new/python-redfish-library-3.1.8/CHANGELOG.md
--- old/python-redfish-library-3.1.7/CHANGELOG.md       2022-09-09 
21:28:55.000000000 +0200
+++ new/python-redfish-library-3.1.8/CHANGELOG.md       2022-12-02 
21:21:09.000000000 +0100
@@ -1,5 +1,9 @@
 # Change Log
 
+## [3.1.8] - 2022-12-02
+- Added request headers to debug log output
+- Added redacting of 'Password' properties from request bodies from debug logs
+
 ## [3.1.7] - 2022-09-09
 - Added handling for extracting error information when a session could not be 
created
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-redfish-library-3.1.7/setup.py 
new/python-redfish-library-3.1.8/setup.py
--- old/python-redfish-library-3.1.7/setup.py   2022-09-09 21:28:55.000000000 
+0200
+++ new/python-redfish-library-3.1.8/setup.py   2022-12-02 21:21:09.000000000 
+0100
@@ -12,7 +12,7 @@
     long_description = f.read()
 
 setup(name='redfish',
-      version='3.1.7',
+      version='3.1.8',
       description='Redfish Python Library',
       long_description=long_description,
       long_description_content_type='text/x-rst',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-redfish-library-3.1.7/src/redfish/__init__.py 
new/python-redfish-library-3.1.8/src/redfish/__init__.py
--- old/python-redfish-library-3.1.7/src/redfish/__init__.py    2022-09-09 
21:28:55.000000000 +0200
+++ new/python-redfish-library-3.1.8/src/redfish/__init__.py    2022-12-02 
21:21:09.000000000 +0100
@@ -6,7 +6,7 @@
 """ Redfish restful library """
 
 __all__ = ['rest', 'ris', 'discovery']
-__version__ = "3.1.7"
+__version__ = "3.1.8"
 
 from redfish.rest.v1 import redfish_client
 from redfish.rest.v1 import AuthMethod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-redfish-library-3.1.7/src/redfish/rest/v1.py 
new/python-redfish-library-3.1.8/src/redfish/rest/v1.py
--- old/python-redfish-library-3.1.7/src/redfish/rest/v1.py     2022-09-09 
21:28:55.000000000 +0200
+++ new/python-redfish-library-3.1.8/src/redfish/rest/v1.py     2022-12-02 
21:21:09.000000000 +0100
@@ -15,6 +15,7 @@
 import base64
 import logging
 import warnings
+import re
 import requests
 import requests_unixsocket
 
@@ -835,18 +836,27 @@
         cause_exception = None
         while attempts <= self._max_retry:
             if LOGGER.isEnabledFor(logging.DEBUG):
+                headerstr = ''
+                if headers is not None:
+                    for header in headers:
+                        if header.lower() == "authorization":
+                            headerstr += '\t{}: <REDACTED>\n'.format(header)
+                        else:
+                            headerstr += '\t{}: {}\n'.format(header, 
headers[header])
                 try:
-                    logbody = None
+                    logbody = 'No request body'
                     if restreq.body:
                         if restreq.body[0] == '{':
-                            logbody = restreq.body
+                            # Mask password properties
+                            # NOTE: If the password itself contains a double 
quote, it will not redact the entire password
+                            logbody = re.sub('"Password"\s*:\s*".*?"', 
'"Password": "<REDACTED>"', restreq.body)
                         else:
                             raise ValueError('Body of message is binary')
-                    LOGGER.debug('HTTP REQUEST: %s\n\tPATH: %s\n\tBODY: %s'% \
-                                    (restreq.method, restreq.path, logbody))
+                    LOGGER.debug('HTTP REQUEST (%s) for 
%s:\nHeaders:\n%s\nBody: %s\n'% \
+                                 (restreq.method, restreq.path, headerstr, 
logbody))
                 except:
-                    LOGGER.debug('HTTP REQUEST: %s\n\tPATH: %s\n\tBODY: %s'% \
-                                (restreq.method, restreq.path, 'binary body'))
+                    LOGGER.debug('HTTP REQUEST (%s) for 
%s:\nHeaders:\n%s\nBody: %s\n'% \
+                                 (restreq.method, restreq.path, headerstr, 
'binary body'))
             attempts = attempts + 1
             LOGGER.info('Attempt %s of %s', attempts, path)
 
@@ -891,8 +901,8 @@
                         headerstr += '\t' + header[0] + ': ' + header[1] + '\n'
 
                     try:
-                        LOGGER.debug('HTTP RESPONSE for %s:\nCode: 
%s\nHeaders:\n' \
-                                 '%s\nBody Response of %s: %s'%\
+                        LOGGER.debug('HTTP RESPONSE for %s:\nCode: 
%s\n\nHeaders:\n' \
+                                 '%s\nBody Response of %s: %s\n'%\
                                  (restresp.request.path,
                                 str(restresp._http_response.status_code)+ ' ' 
+ \
                                 restresp._http_response.reason,

Reply via email to