• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

decentraland / comms-gatekeeper / 28303785699

27 Jun 2026 10:30PM UTC coverage: 85.347% (+0.09%) from 85.255%
28303785699

push

github

web-flow
feat: record player IP/device on token requests and support device bans (#274)

* feat: record player IP/device on token requests and support device/IP bans

Capture each player's latest IP (Cloudflare cf-connecting-ip header) and
device id (deviceIdentifier from the signed-fetch auth metadata) into a new
player_connection_info table whenever a LiveKit token is requested on
/get-scene-adapter or /private-messages/token. Capture is best-effort and
never blocks token issuance.

Use that data for moderation: banning a player now always snapshots their
recorded device id, and optionally (banIp flag) their IP, onto the user_bans
record. Token endpoints reject (403) when the request's address, device id, or
IP matches an active ban, so a banned player is caught even under a different
wallet. The existing GET /bans listing now surfaces the banned device id/IP.

Empty IP/device values are normalized to null so they cannot become
unmatchable dead data. cf-connecting-ip is trusted because the service runs
strictly behind Cloudflare.

* test: cover banIp/device capture via ban endpoint and scene-adapter capture

Add end-to-end coverage for the headline ban behavior through POST
/users/:address/bans: seed player_connection_info, then assert a permanent ban
snapshots the recorded device id (IP left null), and that banIp:true also
snapshots the IP — and that a different wallet connecting from the banned
device/IP is reported as banned.

Also assert /get-scene-adapter records the player's IP and device id.

* test: cover address-only match and expired-ban cases for getActiveBanForConnection

Directly assert the two remaining branches: an address-only query (no device/IP)
matches an active ban, and an expired ban matches neither by address nor by the
recorded device id.

* refactor: drop IP banning, keep IP logging

Removes IP banning (the banIp opt-in flag, the user_bans.banned_ip column, and
IP matching in getActiveBanForConnection). Device-id banning is unchanged,... (continued)

1105 of 1419 branches covered (77.87%)

Branch coverage included in aggregate %.

65 of 73 new or added lines in 9 files covered. (89.04%)

29 existing lines in 6 files now uncovered.

3042 of 3440 relevant lines covered (88.43%)

75.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.8
/src/logic/utils.ts


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc