From a76cd4c58d5c4e6713a8dbfa1bb97c4cac9bfa4b Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Mon, 27 Apr 2015 14:24:11 -0700 Subject: [PATCH] audit: Document that arguments must not be modified --- audit/audit.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/audit/audit.go b/audit/audit.go index 3054846c2b..6043613879 100644 --- a/audit/audit.go +++ b/audit/audit.go @@ -8,11 +8,15 @@ import "github.com/hashicorp/vault/logical" // or other external services. type Backend interface { // LogRequest is used to syncronously log a request. This is done after the - // request is authorized but before the request is executed. + // request is authorized but before the request is executed. The arguments + // MUST not be modified in anyway. They should be deep copied if this is + // a possibility. LogRequest(*logical.Auth, *logical.Request) error // LogResponse is used to syncronously log a response. This is done after - // the request is processed but before the response is sent. + // the request is processed but before the response is sent. The arguments + // MUST not be modified in anyway. They should be deep copied if this is + // a possibility. LogResponse(*logical.Auth, *logical.Request, *logical.Response, error) error }