A
A
Andrew2019-10-14 17:12:11
JavaScript
Andrew, 2019-10-14 17:12:11

How to hide the backend endpoint on the client?

I make the front on vue, I prefer to store all endpoints in one api.js file, where I initialize axios with the necessary parameters, and in the components I simply import the necessary methods and access them.
But if an attacker downloads the code, he can easily find all used endpoints, stupidly using the keywords "get", "post", etc.
Surely webpack chunks will help here (or not?). How to split this file and what to register in the config so that only public endpoints are loaded?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-10-14
@AndrewRusinas

The main bundle (well, or the manifest) will still contain paths to chunks, so that the client knows where to download them from when needed. "Intruder" in the same way can find them.
The problem must be solved from the other side: interaction with non-public endpoints must be closed by authorization or some kind of access keys.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question