|
| 1 | +// Copyright (c) 2015-2025 MinIO, Inc. |
| 2 | +// |
| 3 | +// This file is part of MinIO Object Storage stack |
| 4 | +// |
| 5 | +// This program is free software: you can redistribute it and/or modify |
| 6 | +// it under the terms of the GNU Affero General Public License as published by |
| 7 | +// the Free Software Foundation, either version 3 of the License, or |
| 8 | +// (at your option) any later version. |
| 9 | +// |
| 10 | +// This program is distributed in the hope that it will be useful |
| 11 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +// GNU Affero General Public License for more details. |
| 14 | +// |
| 15 | +// You should have received a copy of the GNU Affero General Public License |
| 16 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + |
| 18 | +package audit |
| 19 | + |
| 20 | +import "time" |
| 21 | + |
| 22 | +// ObjectVersion object version key/versionId |
| 23 | +type ObjectVersion struct { |
| 24 | + ObjectName string `json:"objectName"` |
| 25 | + VersionID string `json:"versionId,omitempty"` |
| 26 | +} |
| 27 | + |
| 28 | +// Entry - audit entry logs. |
| 29 | +type Entry struct { |
| 30 | + Version string `json:"version"` |
| 31 | + DeploymentID string `json:"deploymentid,omitempty"` |
| 32 | + Time time.Time `json:"time"` |
| 33 | + Event string `json:"event"` |
| 34 | + |
| 35 | + // Class of audit message - S3, admin ops, bucket management |
| 36 | + Type string `json:"type,omitempty"` |
| 37 | + |
| 38 | + // deprecated replaced by 'Event', kept here for some |
| 39 | + // time for backward compatibility with k8s Operator. |
| 40 | + Trigger string `json:"trigger"` |
| 41 | + API struct { |
| 42 | + Name string `json:"name,omitempty"` |
| 43 | + Bucket string `json:"bucket,omitempty"` |
| 44 | + Object string `json:"object,omitempty"` |
| 45 | + Objects []ObjectVersion `json:"objects,omitempty"` |
| 46 | + Status string `json:"status,omitempty"` |
| 47 | + StatusCode int `json:"statusCode,omitempty"` |
| 48 | + InputBytes int64 `json:"rx"` |
| 49 | + OutputBytes int64 `json:"tx"` |
| 50 | + HeaderBytes int64 `json:"txHeaders,omitempty"` |
| 51 | + TimeToFirstByte string `json:"timeToFirstByte,omitempty"` |
| 52 | + TimeToFirstByteInNS string `json:"timeToFirstByteInNS,omitempty"` |
| 53 | + TimeToResponse string `json:"timeToResponse,omitempty"` |
| 54 | + TimeToResponseInNS string `json:"timeToResponseInNS,omitempty"` |
| 55 | + } `json:"api"` |
| 56 | + RemoteHost string `json:"remotehost,omitempty"` |
| 57 | + RequestID string `json:"requestID,omitempty"` |
| 58 | + UserAgent string `json:"userAgent,omitempty"` |
| 59 | + ReqPath string `json:"requestPath,omitempty"` |
| 60 | + ReqHost string `json:"requestHost,omitempty"` |
| 61 | + ReqClaims map[string]interface{} `json:"requestClaims,omitempty"` |
| 62 | + ReqQuery map[string]string `json:"requestQuery,omitempty"` |
| 63 | + ReqHeader map[string]string `json:"requestHeader,omitempty"` |
| 64 | + RespHeader map[string]string `json:"responseHeader,omitempty"` |
| 65 | + Tags map[string]interface{} `json:"tags,omitempty"` |
| 66 | + |
| 67 | + AccessKey string `json:"accessKey,omitempty"` |
| 68 | + ParentUser string `json:"parentUser,omitempty"` |
| 69 | + |
| 70 | + Error string `json:"error,omitempty"` |
| 71 | +} |
0 commit comments