Contains a number of cookie monitoring changes. Enhancements: - Add sampling capability for cookie logging on headers smaller than the threshold. For details, see COOKIE_SAMPLING_REQUEST_COUNT. - Add cookie header size to log message. - Sort logged cookies starting with largest cookie. - Move logging from Middleware request processing to response processing to ensure the user id is available for logging for authenticated calls. - Added cookies.header.size.computed to check if there are any large hidden duplicate cookies. Can be compared against the cookies.header.size custom attribute. - Add delimiters into logs to make it simpler to parse when the logging tools accidentally exports multiple log lines together. Removed: - Legacy cookie capture code. This code was dangerous to to enable and provided more limited insight than the newer logging, so this was removed to simplify the code. Other refactors: - Switched Middleware to use new Django format, rather than the Mixin. - Moved tests to its own test class. Note: this middleware is likely to move to a separate library. ARCHBOM-2055
91 KiB
91 KiB