Browse Source

v0.3.0-unstable12

Yann Stepienik 2 years ago
parent
commit
06aac804a7
2 changed files with 4 additions and 1 deletions
  1. 1 1
      package.json
  2. 3 0
      src/proxy/shield.go

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "cosmos-server",
-  "version": "0.3.0-unstable11",
+  "version": "0.3.0-unstable12",
   "description": "",
   "main": "test-server.js",
   "bugs": {

+ 3 - 0
src/proxy/shield.go

@@ -132,6 +132,7 @@ func (shield *smartShieldState) isAllowedToReqest(policy utils.SmartShieldPolicy
 			banType: PERM,
 			time: time.Now(),
 		})
+		Utils.Warn("User " + ClientID + " has been banned permanently: "+ fmt.Sprintf("%+v", userConsumed))
 		return false
 	} else if nbStrikes >= 3 {
 		// temp ban
@@ -140,6 +141,7 @@ func (shield *smartShieldState) isAllowedToReqest(policy utils.SmartShieldPolicy
 			banType: TEMP,
 			time: time.Now(),
 		})
+		Utils.Warn("User " + ClientID + " has been banned temporarily: "+ fmt.Sprintf("%+v", userConsumed))
 		return false
 	}
 
@@ -153,6 +155,7 @@ func (shield *smartShieldState) isAllowedToReqest(policy utils.SmartShieldPolicy
 			banType: STRIKE,
 			time: time.Now(),
 		})
+		Utils.Warn("User " + ClientID + " has received a strike: "+ fmt.Sprintf("%+v", userConsumed))
 		return false
 	}