FokiDoki / WireRest

REST API for Wireguard
MIT License
18 stars 5 forks source link

Endpoint for peer update #50

Closed FokiDoki closed 1 year ago

FokiDoki commented 1 year ago

Added point to update peer. You can now update a peer without having to delete it. Example request (Fake data):

curl -X 'PATCH' \
  'http://localhost:8080/peer/update?publicKey=PubKey1&newPublicKey=newPubKey&presharedKey=NewPSK&endpoint=111.111.111.111%3A8011&allowedIps=10.0.5.55%2F30%2Cfd46%3A2d21%3A6f60%3A8e9f%3A%3A%2F64&persistentKeepalive=25' \
  -H 'accept: */*'

Responce:

{
  "publicKey": "newPubKey",
  "presharedKey": "NewPSK",
  "endpoint": "111.111.111.111:8011",
  "allowedSubnets": [
    "fd46:2d21:6f60:8e9f::/64",
    "10.0.5.55/30"
  ],
  "latestHandshake": 0,
  "transferRx": 0,
  "transferTx": 0,
  "persistentKeepalive": 25
}