Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change logging to zap and change how change logs applied #9

Merged
merged 7 commits into from
May 29, 2024

Conversation

bubbajoe
Copy link
Contributor

…also added more tests for admin routes

Copy link

codecov bot commented May 25, 2024

Codecov Report

Attention: Patch coverage is 18.98734% with 576 lines in your changes are missing coverage. Please review.

Project coverage is 37.48%. Comparing base (413ecc3) to head (3a2e551).

Files Patch % Lines
internal/proxy/dynamic_proxy.go 0.00% 66 Missing ⚠️
pkg/util/logadapter/zap2hc.go 11.11% 64 Missing ⚠️
internal/proxy/proxy_handler.go 19.44% 58 Missing ⚠️
internal/proxy/proxy_state.go 26.76% 51 Missing and 1 partial ⚠️
internal/admin/admin_raft.go 0.00% 38 Missing ⚠️
internal/admin/admin_fsm.go 0.00% 37 Missing ⚠️
internal/admin/admin_api.go 0.00% 30 Missing ⚠️
internal/admin/routes/collection_routes.go 0.00% 28 Missing ⚠️
...nternal/admin/changestate/testutil/change_state.go 26.47% 25 Missing ⚠️
internal/config/config.go 0.00% 25 Missing ⚠️
... and 26 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   35.79%   37.48%   +1.68%     
==========================================
  Files         113      116       +3     
  Lines        9372     9457      +85     
==========================================
+ Hits         3355     3545     +190     
+ Misses       5656     5512     -144     
- Partials      361      400      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

internal/admin/admin_routes.go Fixed Show fixed Hide fixed
proxyState.Logger().Error().Err(err).Msgf("error checking x-forwarded-for ip: %s", xForwardedForIps[i])
logger.Error("error checking x-forwarded-for ip",
zap.String("x-forwarded-for_ip", xForwardedForIps[i]),
zap.Error(err),

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by HTTP request headers
flows to a logging call.
uncommend collectiontype
add lock to reconfigure state
remove ip from logs
@bubbajoe bubbajoe changed the title feat: change logging to slog and change how change logs are applied, … feat: change logging to zap and change how change logs applied May 26, 2024
@bubbajoe bubbajoe merged commit 53ceb64 into main May 29, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant