Pārlūkot izejas kodu

rn: skip logging potentially sensitive data

master
Saúl Ibarra Corretgé 6 gadus atpakaļ
vecāks
revīzija
c2c323347a

+ 6
- 3
react/features/base/storage/PersistenceRegistry.js Parādīt failu

4
 
4
 
5
 import logger from './logger';
5
 import logger from './logger';
6
 
6
 
7
+declare var __DEV__;
8
+
7
 /**
9
 /**
8
  * The name of the {@code localStorage} store where the app persists its values.
10
  * The name of the {@code localStorage} store where the app persists its values.
9
  */
11
  */
87
         // Initialize the checksum.
89
         // Initialize the checksum.
88
         this._checksum = this._calculateChecksum(filteredPersistedState);
90
         this._checksum = this._calculateChecksum(filteredPersistedState);
89
 
91
 
90
-        logger.info('redux state rehydrated as', filteredPersistedState);
92
+        if (typeof __DEV__ !== 'undefined' && __DEV__) {
93
+            logger.info('redux state rehydrated as', filteredPersistedState);
94
+        }
91
 
95
 
92
         return filteredPersistedState;
96
         return filteredPersistedState;
93
     }
97
     }
113
                     logger.error(
117
                     logger.error(
114
                         'Error persisting redux subtree',
118
                         'Error persisting redux subtree',
115
                         subtreeName,
119
                         subtreeName,
116
-                        filteredState[subtreeName],
117
                         error);
120
                         error);
118
                 }
121
                 }
119
             }
122
             }
153
         try {
156
         try {
154
             return md5.hex(JSON.stringify(state) || '');
157
             return md5.hex(JSON.stringify(state) || '');
155
         } catch (error) {
158
         } catch (error) {
156
-            logger.error('Error calculating checksum for state', state, error);
159
+            logger.error('Error calculating checksum for state', error);
157
 
160
 
158
             return '';
161
             return '';
159
         }
162
         }

+ 17
- 7
react/features/mobile/external-api/middleware.js Parādīt failu

15
     CONNECTION_DISCONNECTED,
15
     CONNECTION_DISCONNECTED,
16
     CONNECTION_FAILED,
16
     CONNECTION_FAILED,
17
     JITSI_CONNECTION_CONFERENCE_KEY,
17
     JITSI_CONNECTION_CONFERENCE_KEY,
18
-    JITSI_CONNECTION_URL_KEY
18
+    JITSI_CONNECTION_URL_KEY,
19
+    getURLWithoutParams
19
 } from '../../base/connection';
20
 } from '../../base/connection';
20
 import { MiddlewareRegistry } from '../../base/redux';
21
 import { MiddlewareRegistry } from '../../base/redux';
21
-import { toURLString } from '../../base/util';
22
 import { ENTER_PICTURE_IN_PICTURE } from '../picture-in-picture';
22
 import { ENTER_PICTURE_IN_PICTURE } from '../picture-in-picture';
23
 
23
 
24
 import { sendEvent } from './functions';
24
 import { sendEvent } from './functions';
82
                 store,
82
                 store,
83
                 CONFERENCE_TERMINATED,
83
                 CONFERENCE_TERMINATED,
84
                 /* data */ {
84
                 /* data */ {
85
-                    url: toURLString(locationURL)
85
+                    url: _normalizeUrl(locationURL)
86
                 });
86
                 });
87
         }
87
         }
88
 
88
 
106
             CONFERENCE_TERMINATED,
106
             CONFERENCE_TERMINATED,
107
             /* data */ {
107
             /* data */ {
108
                 error: _toErrorString(error),
108
                 error: _toErrorString(error),
109
-                url: toURLString(locationURL)
109
+                url: _normalizeUrl(locationURL)
110
             });
110
             });
111
         break;
111
         break;
112
     }
112
     }
161
         store,
161
         store,
162
         CONFERENCE_WILL_JOIN,
162
         CONFERENCE_WILL_JOIN,
163
         /* data */ {
163
         /* data */ {
164
-            url: toURLString(locationURL)
164
+            url: _normalizeUrl(locationURL)
165
         });
165
         });
166
 }
166
 }
167
 
167
 
168
+/**
169
+ * Normalizes the given URL for presentation over the external API.
170
+ *
171
+ * @param {URL} url -The URL to normalize.
172
+ * @returns {string} - The normalized URL as a string.
173
+ */
174
+function _normalizeUrl(url: URL) {
175
+    return getURLWithoutParams(url).href;
176
+}
177
+
168
 /**
178
 /**
169
  * Sends an event to the native counterpart of the External API for a specific
179
  * Sends an event to the native counterpart of the External API for a specific
170
  * conference-related redux action.
180
  * conference-related redux action.
186
     // instance. The external API cannot transport such an object so we have to
196
     // instance. The external API cannot transport such an object so we have to
187
     // transport an "equivalent".
197
     // transport an "equivalent".
188
     if (conference) {
198
     if (conference) {
189
-        data.url = toURLString(conference[JITSI_CONFERENCE_URL_KEY]);
199
+        data.url = _normalizeUrl(conference[JITSI_CONFERENCE_URL_KEY]);
190
     }
200
     }
191
 
201
 
192
     if (_swallowEvent(store, action, data)) {
202
     if (_swallowEvent(store, action, data)) {
233
         store,
243
         store,
234
         CONFERENCE_TERMINATED,
244
         CONFERENCE_TERMINATED,
235
         /* data */ {
245
         /* data */ {
236
-            url: toURLString(locationURL),
246
+            url: _normalizeUrl(locationURL),
237
             error: action.error.name
247
             error: action.error.name
238
         });
248
         });
239
 }
249
 }

Notiek ielāde…
Atcelt
Saglabāt