Skip to content

Commit

Permalink
clear logging on BE, remove callerID and IP addr
Browse files Browse the repository at this point in the history
  • Loading branch information
krustowski committed Sep 12, 2024
1 parent a48cd6f commit c446e4b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
#

APP_NAME=littr
APP_VERSION=0.40.4
APP_VERSION=0.40.5
GOLANG_VERSION=1.23
2 changes: 1 addition & 1 deletion api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"name": "MIT",
"url": "https://github.com/krustowski/littr/blob/master/LICENSE"
},
"version": "0.40.4"
"version": "0.40.5"
},
"host": "www.littr.eu",
"basePath": "/api/v1",
Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/common/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (

type Logger struct {
// CallerID is a nickname of the user calling the API.
CallerID string `json:"caller_id" validation:"required"`
CallerID string `json:"-"`

// Code integer is a HTTP return code.
Code int `json:"code" validation:"required"`

// IPAddress string is basically an user's IPv4/IPv6 address (beware of proxies).
IPAddress string `json:"ip_address"`
IPAddress string `json:"-"`

// Message string holds a custom message returned by a various HTTP handler.
Message string `json:"message" validation:"required"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/router.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @title littr
// @version 0.40.4
// @version 0.40.5
// @description a simple nanoblogging platform as PWA built on go-app framework
// @termsOfService https://littr.eu/tos

Expand Down
1 change: 1 addition & 0 deletions pkg/backend/users/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func addNewUser(w http.ResponseWriter, r *http.Request) {

var user models.User

// decode raw bytes
if err := common.UnmarshalRequestData(r, &user); err != nil {
resp.Message = "input error, try again"
resp.Code = http.StatusBadRequest
Expand Down

0 comments on commit c446e4b

Please sign in to comment.