mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 05:36:12 +00:00
update copyed doc for advanced audit
doc for WithAudit is copyed from WithLegacyAudit, it's out of date. This change update doc for these two functions.
This commit is contained in:
@@ -34,21 +34,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// WithAudit decorates a http.Handler with audit logging information for all the
|
// WithAudit decorates a http.Handler with audit logging information for all the
|
||||||
// requests coming to the server. If out is nil, no decoration takes place.
|
// requests coming to the server. Audit level is decided according to requests'
|
||||||
// Each audit log contains two entries:
|
// attributes and audit policy. Logs are emitted to the audit sink to
|
||||||
// 1. the request line containing:
|
// process events. If sink or audit policy is nil, no decoration takes place.
|
||||||
// - unique id allowing to match the response line (see 2)
|
|
||||||
// - source ip of the request
|
|
||||||
// - HTTP method being invoked
|
|
||||||
// - original user invoking the operation
|
|
||||||
// - original user's groups info
|
|
||||||
// - impersonated user for the operation
|
|
||||||
// - impersonated groups info
|
|
||||||
// - namespace of the request or <none>
|
|
||||||
// - uri is the full URI as requested
|
|
||||||
// 2. the response line containing:
|
|
||||||
// - the unique id from 1
|
|
||||||
// - response code
|
|
||||||
func WithAudit(handler http.Handler, requestContextMapper request.RequestContextMapper, sink audit.Sink, policy policy.Checker, longRunningCheck request.LongRunningRequestCheck) http.Handler {
|
func WithAudit(handler http.Handler, requestContextMapper request.RequestContextMapper, sink audit.Sink, policy policy.Checker, longRunningCheck request.LongRunningRequestCheck) http.Handler {
|
||||||
if sink == nil || policy == nil {
|
if sink == nil || policy == nil {
|
||||||
return handler
|
return handler
|
||||||
|
@@ -75,7 +75,7 @@ var _ http.CloseNotifier = &fancyLegacyResponseWriterDelegator{}
|
|||||||
var _ http.Flusher = &fancyLegacyResponseWriterDelegator{}
|
var _ http.Flusher = &fancyLegacyResponseWriterDelegator{}
|
||||||
var _ http.Hijacker = &fancyLegacyResponseWriterDelegator{}
|
var _ http.Hijacker = &fancyLegacyResponseWriterDelegator{}
|
||||||
|
|
||||||
// WithAudit decorates a http.Handler with audit logging information for all the
|
// WithLegacyAudit decorates a http.Handler with audit logging information for all the
|
||||||
// requests coming to the server. If out is nil, no decoration takes place.
|
// requests coming to the server. If out is nil, no decoration takes place.
|
||||||
// Each audit log contains two entries:
|
// Each audit log contains two entries:
|
||||||
// 1. the request line containing:
|
// 1. the request line containing:
|
||||||
|
Reference in New Issue
Block a user