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

Fix audit-log encoding issue (CC-7337) #20345

Merged
merged 30 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d62a35f
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Oct 19, 2023
d883550
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Oct 20, 2023
87b6971
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Oct 26, 2023
c418689
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Oct 30, 2023
9008b22
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Nov 6, 2023
07af66c
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Nov 15, 2023
6ff9fe9
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Nov 15, 2023
d98d6af
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Nov 15, 2023
5b1cc3c
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Nov 22, 2023
a64a031
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Dec 1, 2023
9377ca6
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Dec 1, 2023
e3f2751
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Dec 6, 2023
01ac423
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Dec 13, 2023
8fd5619
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Jan 12, 2024
54f5c2d
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Jan 17, 2024
0f247ba
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Jan 19, 2024
e6dbfb8
Merge branch 'main' of ssh://github.com/hashicorp/consul
absolutelightning Jan 25, 2024
c12c127
add changes
absolutelightning Jan 25, 2024
aace885
added changelog
absolutelightning Jan 25, 2024
35f4f20
change update
absolutelightning Jan 25, 2024
2b9199d
Merge branch 'main' into CC-7337
absolutelightning Jan 29, 2024
e0062ec
Merge branch 'main' into CC-7337
abhishek-hashicorp Jan 30, 2024
d652e21
Merge branch 'main' of ssh://github.com/hashicorp/consul into CC-7337
absolutelightning Feb 1, 2024
fc7bfda
CE chnages
absolutelightning Feb 1, 2024
da4b4fb
fixes
absolutelightning Feb 1, 2024
0f99aa6
Removed gzip size fix
absolutelightning Feb 1, 2024
28f6aa6
fix changelog
absolutelightning Feb 1, 2024
029632a
Update .changelog/20345.txt
absolutelightning Feb 1, 2024
7e41089
Adding comments
Feb 2, 2024
13d6350
Merge branch 'main' into CC-7337
absolutelightning Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/20345.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
audit-logs: **(Enterprise Only)** Fixes non ASCII characters in audit logs because of gzip.
```
5 changes: 3 additions & 2 deletions agent/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ func (s *HTTPHandlers) handler() http.Handler {
// Register the wrapper.
wrapper := func(resp http.ResponseWriter, req *http.Request) {
start := time.Now()
handler(resp, req)
Copy link
Member

Choose a reason for hiding this comment

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

You sure that this line can be safely removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


// this method is implemented by different flavours of consul e.g. oss, ce. ent.
s.enterpriseRequest(resp, req, handler)

labels := []metrics.Label{{Name: "method", Value: req.Method}, {Name: "path", Value: path_label}}
metrics.MeasureSinceWithLabels([]string{"api", "http"}, start, labels)
Expand Down Expand Up @@ -313,7 +315,6 @@ func (s *HTTPHandlers) handler() http.Handler {
h = mux
}

h = s.enterpriseHandler(h)
h = withRemoteAddrHandler(h)
s.h = &wrappedMux{
mux: mux,
Expand Down
6 changes: 3 additions & 3 deletions agent/http_ce.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ func parseACLAuthMethodEnterpriseMeta(req *http.Request, _ *structs.ACLAuthMetho
return nil
}

// enterpriseHandler is a noop for the enterprise implementation. we pass the original back
func (s *HTTPHandlers) enterpriseHandler(next http.Handler) http.Handler {
return next
func (s *HTTPHandlers) enterpriseRequest(w http.ResponseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) {
// no special handling for CE. Calling the default handler with default params.
handler(w, req)
}

// uiTemplateDataTransform returns an optional uiserver.UIDataTransform to allow
Expand Down
Loading