Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
audit-logging: Add core.auditlog package #8138
Conversation
| + | ||
| +// FacadeResponse captures any errors coming back from the API in | ||
| +// response to a request. | ||
| +type FacadeResponse struct { |
wallyworld
Nov 28, 2017
Owner
To make it clear this does not include any payload data (just errors), should it be called FacadeResponseErrors
| + | ||
| +// ResponseArgs is the information about an API response to record in | ||
| +// the audit log. | ||
| +type ResponseArgs struct { |
babbageclunk
Nov 28, 2017
Member
It's the args struct to make a Response - which will now be called a ResponseErrors, so this will be ResponseErrorsArgs.
| + | ||
| +// AuditLog represents something that can store calls, requests and | ||
| +// responses somewhere. | ||
| +type AuditLog interface { |
wallyworld
Nov 28, 2017
Owner
at this point I'm a little confused about the difference between a Call and a Request
| +} | ||
| + | ||
| +// Recorder records method calls for a specific API connection. | ||
| +type Recorder struct { |
babbageclunk
Nov 28, 2017
•
Member
Yes - this is what will be created by the API server when a new connection is made. It records the requests and responses for a specific (whatever we rename Call to).
| + return hex.EncodeToString(buf) | ||
| +} | ||
| + | ||
| +type AuditLogFile struct { |
babbageclunk
Nov 28, 2017
Member
No, you're right - it shouldn't be exported, NewLogFile should return an AuditLog which will get passed in to NewRecorder.
| + return &AuditLogFile{ | ||
| + fileLogger: &lumberjack.Logger{ | ||
| + Filename: logPath, | ||
| + MaxSize: 300, // MB |
babbageclunk
changed the base branch from
state-controller-refactor
to
develop
Nov 28, 2017
babbageclunk
added some commits
Nov 23, 2017
| +} | ||
| + | ||
| +// Request represents a call to an API facade made as part of | ||
| +// executing a specific high-level command. |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju |
babbageclunk commentedNov 27, 2017
Description of change
core.auditlog contains the
AuditLogFileandRecorder, which will be used in the apiserver (in a subsequent PR) to write audit log information as API methods are called.QA steps
No behaviour change - not integrated into apiserver yet.