You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2020/05/28 16:21:04 UTC
[trafficcontrol] branch 4.1.x updated: Improve content invalidation
audit logging (#4689) (#4728)
This is an automated email from the ASF dual-hosted git repository.
rawlin pushed a commit to branch 4.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/4.1.x by this push:
new cace930 Improve content invalidation audit logging (#4689) (#4728)
cace930 is described below
commit cace9307e65d90924bc944be8d7b26ed81e43c2c
Author: Rawlin Peters <ra...@apache.org>
AuthorDate: Thu May 28 10:20:55 2020 -0600
Improve content invalidation audit logging (#4689) (#4728)
* Improve content invalidation audit logging
When this API was rewritten to Go, the audit logging was made too terse.
Improve it to provide as much information as TO-Perl provided.
* Add changelog entry
(cherry picked from commit 436b0468d23f731a2f39622f804a13bcd389fedb)
---
CHANGELOG.md | 1 +
traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2549765..12a73bf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -61,6 +61,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed ORT config generation not using the coalesce_number_v6 Parameter.
- Removed audit logging from the `POST /api/x/serverchecks` Traffic Ops API endpoint in order to reduce audit log spam
- Fixed the `GET /api/x/jobs` and `GET /api/x/jobs/:id` Traffic Ops API routes to allow falling back to Perl via the routing blacklist
+- Fixed audit logging from the `/jobs` APIs to bring them back to the same level of information provided by TO-Perl
### Deprecated/Removed
- The Traffic Ops `db/admin.pl` script has now been removed. Please use the `db/admin` binary instead.
diff --git a/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go b/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go
index c2ae40c..2029aad 100644
--- a/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go
+++ b/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go
@@ -367,7 +367,7 @@ func Create(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write(append(resp, '\n'))
- api.CreateChangeLogRawTx(api.ApiChange, api.Created+"content invalidation job: #"+strconv.FormatUint(*result.ID, 10), inf.User, inf.Tx.Tx)
+ api.CreateChangeLogRawTx(api.ApiChange, api.Created+" content invalidation job - ID: "+strconv.FormatUint(*result.ID, 10)+" DS: "+*result.DeliveryService+" URL: '"+*result.AssetURL+"' Params: '"+*result.Parameters+"'", inf.User, inf.Tx.Tx)
}
// Used by PUT requests to `/jobs`, replaces an existing content invalidation job
@@ -526,7 +526,7 @@ func Update(w http.ResponseWriter, r *http.Request) {
w.Header().Set(http.CanonicalHeaderKey("content-type"), rfc.ApplicationJSON)
w.Write(append(resp, '\n'))
- api.CreateChangeLogRawTx(api.ApiChange, api.Updated+"content invalidation job: #"+strconv.FormatUint(*job.ID, 10), inf.User, inf.Tx.Tx)
+ api.CreateChangeLogRawTx(api.ApiChange, api.Updated+" content invalidation job - ID: "+strconv.FormatUint(*job.ID, 10)+" DS: "+*job.DeliveryService+" URL: '"+*job.AssetURL+"' Params: '"+*job.Parameters+"'", inf.User, inf.Tx.Tx)
}
// Used by DELETE requests to `/jobs`, deletes an existing content invalidation job
@@ -612,7 +612,7 @@ func Delete(w http.ResponseWriter, r *http.Request) {
w.Header().Set(http.CanonicalHeaderKey("content-type"), rfc.ApplicationJSON)
w.Write(append(resp, '\n'))
- api.CreateChangeLogRawTx(api.ApiChange, api.Deleted+"content invalidation job: #"+strconv.FormatUint(*result.ID, 10), inf.User, inf.Tx.Tx)
+ api.CreateChangeLogRawTx(api.ApiChange, api.Deleted+" content invalidation job - ID: "+strconv.FormatUint(*result.ID, 10)+" DS: "+*result.DeliveryService+" URL: '"+*result.AssetURL+"' Params: '"+*result.Parameters+"'", inf.User, inf.Tx.Tx)
}
func setRevalFlags(d interface{}, tx *sql.Tx) error {