YABin icon indicating copy to clipboard operation
YABin copied to clipboard

Werid behavior of API

Open Ziqi-Yang opened this issue 1 year ago • 3 comments

  1. cannot create a new paste using the same initVector
    If you run the command below, you will encounter an error like {"message":"Internal Error"}. But if you change the initVector variable, a new paste can be created without problems.
curl -H "Content-Type: application/json" -X POST -d '{"content": "Ciallo~(∠・ω< )⌒★", "config": {"language": "plaintext", "encrypted": true, "expiresAfter": 3600, "burnAfterRead": false}, "passwordProtected": false, "initVector": "27DIWK00yDiGx003"}' https://bin.sohamsen.me/api/paste
  1. meaning of encrypted and passwordProtected It seems like on the API side, encrypted and passwordProtected have no effect on enhancing data security, cause it always return full information of a paste.
curl "https://bin.sohamsen.me/api/paste?key=121o2
# {"success":true,"data":{"key":"121o2","content":"Ciallo~(∠・ω< )⌒★","encrypted":true,"passwordProtected":true,"initVector":"27DIWK00yDiGx004","language":"plaintext"}}

Ziqi-Yang avatar Jun 16 '23 12:06 Ziqi-Yang