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

minor refactoring #973

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 0 additions & 14 deletions core/audit/journal/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"net/http"

"github.com/vmware-tanzu/secrets-manager/core/audit/state"
"github.com/vmware-tanzu/secrets-manager/core/log/std"
)

type Entry struct {
Expand All @@ -26,19 +25,6 @@ type Entry struct {
Event state.Event
}

func printAudit(correlationId string, e state.Event,
method, url, spiffeid, payload string) {
std.AuditLn(
&correlationId,
string(e),
"{{"+
"method:[["+method+"]],"+
"url:[["+url+"]],"+
"spiffeid:[["+spiffeid+"]],"+
"payload:[["+payload+"]]}}",
)
}

// Log prints an audit log entry to the standard output. The log entry includes
// the correlation ID, event type, request method, request URI, SPIFFE ID, and
// payload. The function is intended for use in logging and auditing
Expand Down
29 changes: 29 additions & 0 deletions core/audit/journal/print.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
| Protect your secrets, protect your sensitive data.
: Explore VMware Secrets Manager docs at https://vsecm.com/
</
<>/ keep your secrets... secret
>/
<>/' Copyright 2023-present VMware Secrets Manager contributors.
>/' SPDX-License-Identifier: BSD-2-Clause
*/

package journal

import (
"github.com/vmware-tanzu/secrets-manager/core/audit/state"
"github.com/vmware-tanzu/secrets-manager/core/log/std"
)

func printAudit(correlationId string, e state.Event,
method, url, spiffeid, payload string) {
std.AuditLn(
&correlationId,
string(e),
"{{"+
"method:[["+method+"]],"+
"url:[["+url+"]],"+
"spiffeid:[["+spiffeid+"]],"+
"payload:[["+payload+"]]}}",
)
}