Skip to content

James main dev 01#328

Merged
lstruman merged 7 commits into
mainfrom
james-main-dev-01
Jul 14, 2026
Merged

James main dev 01#328
lstruman merged 7 commits into
mainfrom
james-main-dev-01

Conversation

@lstruman

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 14, 2026 08:03
Comment thread http/webconfig_server.go Dismissed
Comment thread http/webconfig_server.go Dismissed
Comment thread http/webconfig_server.go Dismissed
Comment thread http/webconfig_server.go Dismissed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts request/header logging and Kafka producer logging behavior, and adds a unit test for a header edge case.

Changes:

  • Removed redaction/sanitization logic from util.HeaderToMap and common.FilterLogFields, resulting in more raw data being preserved in log fields.
  • Expanded Kafka producer logging in ForwardSuccessKafkaMessages to include the derived MAC key and full message body, and included the invalid device_id value in the warning message.
  • Added a unit test to ensure HeaderToMap handles headers with an empty value slice without panicking.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
util/dict.go Removes header key allowlist redaction in HeaderToMap while keeping empty-slice handling.
util/dict_test.go Adds coverage for HeaderToMap when a header key has an empty value slice.
http/webconfig_server.go Logs more Kafka message details and changes token/header logging behavior.
common/log_fields.go Removes sensitive-field sanitization from FilterLogFields and switches to shallow cloning for maps.
Comments suppressed due to low confidence (2)

util/dict.go:221

  • HeaderToMap now returns raw values for all headers. When used for request logging (e.g., webconfig_server.logRequestStarts), this can leak sensitive headers like Cookie/Set-Cookie if they are not in the ignored header list. Consider redacting sensitive header keys here while keeping the empty-slice guard.
func HeaderToMap(header http.Header) map[string]string {
	m := make(map[string]string)
	for k, v := range header {
		if len(v) == 0 {
			m[k] = ""
			continue
		}
		m[k] = v[0]
	}

http/webconfig_server.go:1100

  • LogToken now keeps the request header map in tfields. With HeaderToMap/FilterLogFields no longer redacting by default, this can expose sensitive headers (notably Cookie/Set-Cookie). Consider explicitly redacting these here in addition to obfuscating Authorization.
	tfields := common.FilterLogFields(fields)
	var headerMap map[string]string
	var isObfuscated bool
	if itf, ok := tfields["header"]; ok {
		headerMap = itf.(map[string]string)
		if len(headerMap) > 0 {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread common/log_fields.go
Comment thread http/webconfig_server.go
Comment thread http/webconfig_server.go
@lstruman lstruman merged commit e671106 into main Jul 14, 2026
14 of 15 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants