Skip to content

Commit

Permalink
chore(http): remove logging of senstive data
Browse files Browse the repository at this point in the history
after discussion with team, dropping the request logging was decided on.
  • Loading branch information
jsteenb2 committed Sep 25, 2019
1 parent 38d2c11 commit fc955c5
Show file tree
Hide file tree
Showing 17 changed files with 0 additions and 145 deletions.
11 changes: 0 additions & 11 deletions http/auth_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ func newAuthsResponse(as []*authResponse) *authsResponse {
func (h *AuthorizationHandler) handlePostAuthorization(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

h.Logger.Debug("create auth request", zap.String("r", fmt.Sprint(r)))

req, err := decodePostAuthorizationRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -327,8 +325,6 @@ func decodePostAuthorizationRequest(ctx context.Context, r *http.Request) (*post
// handleGetAuthorizations is the HTTP handler for the GET /api/v2/authorizations route.
func (h *AuthorizationHandler) handleGetAuthorizations(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("get auths request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetAuthorizationsRequest(ctx, r)
if err != nil {
h.Logger.Info("failed to decode request", zap.String("handler", "getAuthorizations"), zap.Error(err))
Expand Down Expand Up @@ -426,8 +422,6 @@ func decodeGetAuthorizationsRequest(ctx context.Context, r *http.Request) (*getA
// handleGetAuthorization is the HTTP handler for the GET /api/v2/authorizations/:id route.
func (h *AuthorizationHandler) handleGetAuthorization(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

h.Logger.Debug("get auth request", zap.String("r", fmt.Sprint(r)))
req, err := decodeGetAuthorizationRequest(ctx, r)
if err != nil {
h.Logger.Info("failed to decode request", zap.String("handler", "getAuthorization"), zap.Error(err))
Expand Down Expand Up @@ -495,8 +489,6 @@ func decodeGetAuthorizationRequest(ctx context.Context, r *http.Request) (*getAu
// handleUpdateAuthorization is the HTTP handler for the PATCH /api/v2/authorizations/:id route that updates the authorization's status and desc.
func (h *AuthorizationHandler) handleUpdateAuthorization(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

h.Logger.Debug("update auth request", zap.String("r", fmt.Sprint(r)))
req, err := decodeUpdateAuthorizationRequest(ctx, r)
if err != nil {
h.Logger.Info("failed to decode request", zap.String("handler", "updateAuthorization"), zap.Error(err))
Expand Down Expand Up @@ -575,9 +567,6 @@ func decodeUpdateAuthorizationRequest(ctx context.Context, r *http.Request) (*up
// handleDeleteAuthorization is the HTTP handler for the DELETE /api/v2/authorizations/:id route.
func (h *AuthorizationHandler) handleDeleteAuthorization(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

h.Logger.Debug("delete auth request", zap.String("r", fmt.Sprint(r)))

req, err := decodeDeleteAuthorizationRequest(ctx, r)
if err != nil {
h.Logger.Info("failed to decode request", zap.String("handler", "deleteAuthorization"), zap.Error(err))
Expand Down
12 changes: 0 additions & 12 deletions http/bucket_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,6 @@ func newBucketsResponse(ctx context.Context, opts influxdb.FindOptions, f influx
// handlePostBucket is the HTTP handler for the POST /api/v2/buckets route.
func (h *BucketHandler) handlePostBucket(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

h.Logger.Debug("create bucket request", zap.String("r", fmt.Sprint(r)))
req, err := decodePostBucketRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -363,8 +361,6 @@ func decodePostBucketRequest(ctx context.Context, r *http.Request) (*postBucketR
func (h *BucketHandler) handleGetBucket(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

h.Logger.Debug("retrieve bucket request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetBucketRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -419,8 +415,6 @@ func decodeGetBucketRequest(ctx context.Context, r *http.Request) (*getBucketReq
// handleDeleteBucket is the HTTP handler for the DELETE /api/v2/buckets/:id route.
func (h *BucketHandler) handleDeleteBucket(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("delete bucket request", zap.String("r", fmt.Sprint(r)))

req, err := decodeDeleteBucketRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -468,8 +462,6 @@ func (h *BucketHandler) handleGetBuckets(w http.ResponseWriter, r *http.Request)
defer span.Finish()

ctx := r.Context()
h.Logger.Debug("retrieve buckets request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetBucketsRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -535,8 +527,6 @@ func decodeGetBucketsRequest(ctx context.Context, r *http.Request) (*getBucketsR
// handlePatchBucket is the HTTP handler for the PATCH /api/v2/buckets route.
func (h *BucketHandler) handlePatchBucket(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("update bucket request", zap.String("r", fmt.Sprint(r)))

req, err := decodePatchBucketRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -869,8 +859,6 @@ func bucketIDPath(id influxdb.ID) string {
// hanldeGetBucketLog retrieves a bucket log by the buckets ID.
func (h *BucketHandler) handleGetBucketLog(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("retrieve bucket log request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetBucketLogRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down
6 changes: 0 additions & 6 deletions http/check_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ func decodeGetCheckRequest(ctx context.Context, r *http.Request) (i influxdb.ID,

func (h *CheckHandler) handleGetChecks(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("checks retrieve request", zap.String("r", fmt.Sprint(r)))
filter, opts, err := decodeCheckFilter(ctx, r)
if err != nil {
h.Logger.Debug("failed to decode request", zap.Error(err))
Expand Down Expand Up @@ -290,7 +289,6 @@ func newFluxResponse(flux string) fluxResp {

func (h *CheckHandler) handleGetCheck(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("check retrieve request", zap.String("r", fmt.Sprint(r)))
id, err := decodeGetCheckRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -486,7 +484,6 @@ func decodePatchCheckRequest(ctx context.Context, r *http.Request) (*patchCheckR
// handlePostCheck is the HTTP handler for the POST /api/v2/checks route.
func (h *CheckHandler) handlePostCheck(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("check create request", zap.String("r", fmt.Sprint(r)))
chk, err := decodePostCheckRequest(ctx, r)
if err != nil {
h.Logger.Debug("failed to decode request", zap.Error(err))
Expand Down Expand Up @@ -520,7 +517,6 @@ func (h *CheckHandler) handlePostCheck(w http.ResponseWriter, r *http.Request) {
// handlePutCheck is the HTTP handler for the PUT /api/v2/checks route.
func (h *CheckHandler) handlePutCheck(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("check replace request", zap.String("r", fmt.Sprint(r)))
chk, err := decodePutCheckRequest(ctx, r)
if err != nil {
h.Logger.Debug("failed to decode request", zap.Error(err))
Expand Down Expand Up @@ -556,7 +552,6 @@ func (h *CheckHandler) handlePutCheck(w http.ResponseWriter, r *http.Request) {
// handlePatchCheck is the HTTP handler for the PATCH /api/v2/checks/:id route.
func (h *CheckHandler) handlePatchCheck(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("check patch request", zap.String("r", fmt.Sprint(r)))
req, err := decodePatchCheckRequest(ctx, r)
if err != nil {
h.Logger.Debug("failed to decode request", zap.Error(err))
Expand Down Expand Up @@ -591,7 +586,6 @@ func (h *CheckHandler) handlePatchCheck(w http.ResponseWriter, r *http.Request)

func (h *CheckHandler) handleDeleteCheck(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("check delete request", zap.String("r", fmt.Sprint(r)))
i, err := decodeGetCheckRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down
24 changes: 0 additions & 24 deletions http/dashboard_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ func newOperationLogEntryResponse(e *platform.OperationLogEntry) *operationLogEn
// handleGetDashboards returns all dashboards within the store.
func (h *DashboardHandler) handleGetDashboards(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("get dashboards request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetDashboardsRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -434,8 +432,6 @@ func newGetDashboardsResponse(ctx context.Context, dashboards []*platform.Dashbo
// handlePostDashboard creates a new dashboard.
func (h *DashboardHandler) handlePostDashboard(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("create dashboard request", zap.String("r", fmt.Sprint(r)))

req, err := decodePostDashboardRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -469,8 +465,6 @@ func decodePostDashboardRequest(ctx context.Context, r *http.Request) (*postDash
// hanldeGetDashboard retrieves a dashboard by ID.
func (h *DashboardHandler) handleGetDashboard(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("get dashboard request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetDashboardRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -524,8 +518,6 @@ func decodeGetDashboardRequest(ctx context.Context, r *http.Request) (*getDashbo
// hanldeGetDashboardLog retrieves a dashboard log by the dashboards ID.
func (h *DashboardHandler) handleGetDashboardLog(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("get dashboard log request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetDashboardLogRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -580,8 +572,6 @@ func decodeGetDashboardLogRequest(ctx context.Context, r *http.Request) (*getDas
// handleDeleteDashboard removes a dashboard by ID.
func (h *DashboardHandler) handleDeleteDashboard(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("delete dashboard request", zap.String("r", fmt.Sprint(r)))

req, err := decodeDeleteDashboardRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -625,8 +615,6 @@ func decodeDeleteDashboardRequest(ctx context.Context, r *http.Request) (*delete
// handlePatchDashboard updates a dashboard.
func (h *DashboardHandler) handlePatchDashboard(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("update dashboard request", zap.String("r", fmt.Sprint(r)))

req, err := decodePatchDashboardRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -744,8 +732,6 @@ func decodePostDashboardCellRequest(ctx context.Context, r *http.Request) (*post
// handlePostDashboardCell creates a dashboard cell.
func (h *DashboardHandler) handlePostDashboardCell(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("create dashboard cell request", zap.String("r", fmt.Sprint(r)))

req, err := decodePostDashboardCellRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -823,8 +809,6 @@ func decodePutDashboardCellRequest(ctx context.Context, r *http.Request) (*putDa
// handlePutDashboardCells replaces a dashboards cells.
func (h *DashboardHandler) handlePutDashboardCells(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("replace dashboard cell request", zap.String("r", fmt.Sprint(r)))

req, err := decodePutDashboardCellRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -908,8 +892,6 @@ func decodeGetDashboardCellViewRequest(ctx context.Context, r *http.Request) (*g

func (h *DashboardHandler) handleGetDashboardCellView(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("get dashboard cell view request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetDashboardCellViewRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -965,8 +947,6 @@ func decodePatchDashboardCellViewRequest(ctx context.Context, r *http.Request) (

func (h *DashboardHandler) handlePatchDashboardCellView(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("update dashboard cell view request", zap.String("r", fmt.Sprint(r)))

req, err := decodePatchDashboardCellViewRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand All @@ -989,8 +969,6 @@ func (h *DashboardHandler) handlePatchDashboardCellView(w http.ResponseWriter, r
// handleDeleteDashboardCell deletes a dashboard cell.
func (h *DashboardHandler) handleDeleteDashboardCell(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("delete dashboard cell request", zap.String("r", fmt.Sprint(r)))

req, err := decodeDeleteDashboardCellRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -1054,8 +1032,6 @@ func decodePatchDashboardCellRequest(ctx context.Context, r *http.Request) (*pat
// handlePatchDashboardCell updates a dashboard cell.
func (h *DashboardHandler) handlePatchDashboardCell(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("update dashboard cell request", zap.String("r", fmt.Sprint(r)))

req, err := decodePatchDashboardCellRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down
12 changes: 0 additions & 12 deletions http/document_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ func newDocumentsResponse(ns string, docs []*influxdb.Document) *documentsRespon
// handlePostDocument is the HTTP handler for the POST /api/v2/documents/:ns route.
func (h *DocumentHandler) handlePostDocument(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("document create request", zap.String("r", fmt.Sprint(r)))

req, err := decodePostDocumentRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -193,8 +191,6 @@ func decodePostDocumentRequest(ctx context.Context, r *http.Request) (*postDocum
// handleGetDocuments is the HTTP handler for the GET /api/v2/documents/:ns route.
func (h *DocumentHandler) handleGetDocuments(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("documents retrieve request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetDocumentsRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -279,7 +275,6 @@ func decodeGetDocumentsRequest(ctx context.Context, r *http.Request) (*getDocume

func (h *DocumentHandler) handlePostDocumentLabel(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("document label create request", zap.String("r", fmt.Sprint(r)))
_, _, err := h.getDocument(w, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -318,7 +313,6 @@ func (h *DocumentHandler) handlePostDocumentLabel(w http.ResponseWriter, r *http
// then remove that label.
func (h *DocumentHandler) handleDeleteDocumentLabel(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("document label delete request", zap.String("r", fmt.Sprint(r)))
req, err := decodeDeleteLabelMappingRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -354,7 +348,6 @@ func (h *DocumentHandler) handleDeleteDocumentLabel(w http.ResponseWriter, r *ht

func (h *DocumentHandler) handleGetDocumentLabel(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("document label retrieve request", zap.String("r", fmt.Sprint(r)))
d, _, err := h.getDocument(w, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -400,7 +393,6 @@ func (h *DocumentHandler) getDocument(w http.ResponseWriter, r *http.Request) (*
// handleGetDocument is the HTTP handler for the GET /api/v2/documents/:ns/:id route.
func (h *DocumentHandler) handleGetDocument(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("document retrieve request", zap.String("r", fmt.Sprint(r)))

d, namspace, err := h.getDocument(w, r)
if err != nil {
Expand Down Expand Up @@ -455,8 +447,6 @@ func decodeGetDocumentRequest(ctx context.Context, r *http.Request) (*getDocumen
// handleDeleteDocument is the HTTP handler for the DELETE /api/v2/documents/:ns/:id route.
func (h *DocumentHandler) handleDeleteDocument(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("document delete request", zap.String("r", fmt.Sprint(r)))

req, err := decodeDeleteDocumentRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -525,8 +515,6 @@ func decodeDeleteDocumentRequest(ctx context.Context, r *http.Request) (*deleteD
// handlePutDocument is the HTTP handler for the PUT /api/v2/documents/:ns/:id route.
func (h *DocumentHandler) handlePutDocument(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("document update request", zap.String("r", fmt.Sprint(r)))

req, err := decodePutDocumentRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down
10 changes: 0 additions & 10 deletions http/label_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ func NewLabelHandler(s influxdb.LabelService, he influxdb.HTTPErrorHandler) *Lab
// handlePostLabel is the HTTP handler for the POST /api/v2/labels route.
func (h *LabelHandler) handlePostLabel(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("label create request", zap.String("r", fmt.Sprint(r)))

req, err := decodePostLabelRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -110,8 +108,6 @@ func decodePostLabelRequest(ctx context.Context, r *http.Request) (*postLabelReq
// handleGetLabels is the HTTP handler for the GET /api/v2/labels route.
func (h *LabelHandler) handleGetLabels(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("labels retrieve request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetLabelsRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -153,8 +149,6 @@ func decodeGetLabelsRequest(ctx context.Context, r *http.Request) (*getLabelsReq
// handleGetLabel is the HTTP handler for the GET /api/v2/labels/id route.
func (h *LabelHandler) handleGetLabel(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("label retrieve request", zap.String("r", fmt.Sprint(r)))

req, err := decodeGetLabelRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -201,8 +195,6 @@ func decodeGetLabelRequest(ctx context.Context, r *http.Request) (*getLabelReque
// handleDeleteLabel is the HTTP handler for the DELETE /api/v2/labels/:id route.
func (h *LabelHandler) handleDeleteLabel(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("label delete request", zap.String("r", fmt.Sprint(r)))

req, err := decodeDeleteLabelRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down Expand Up @@ -245,8 +237,6 @@ func decodeDeleteLabelRequest(ctx context.Context, r *http.Request) (*deleteLabe
// handlePatchLabel is the HTTP handler for the PATCH /api/v2/labels route.
func (h *LabelHandler) handlePatchLabel(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
h.Logger.Debug("label update request", zap.String("r", fmt.Sprint(r)))

req, err := decodePatchLabelRequest(ctx, r)
if err != nil {
h.HandleHTTPError(ctx, err, w)
Expand Down
Loading

0 comments on commit fc955c5

Please sign in to comment.