Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it really worth making a new request to retrieve the master token to be stored in a variable? #139

Closed
forgedhallpass opened this issue Aug 24, 2020 · 2 comments

Comments

@forgedhallpass
Copy link
Collaborator

One of the highlights of the 3.1 release notes is that the master token is retrieved using a new request, just to store the token in a variable. Could someone provide some details on why is this worth the performance penalty and what is the security benefit besides the obscurity, especially if the back-end either way initializes the JavaScript code with a master token value?

Besides the JavaScript code, the master token or respectively the page tokens can be found in the DOM as the JavaScript code injects it after initialization.

The logic could be modified to get rid of the first request and just rely on the value which the back-end initialized the JavaScript with, then modify the back-end code to expect a master token before returning the page tokens. This approach would come with a performance benefit (1 less request) and page tokens would not be returned without a valid master token.

@forgedhallpass
Copy link
Collaborator Author

Update: the 3.1.0 release did not have the master token served with the JS code, but based on #119 it wasn't working either. The fix for it (a7c199a) introduced the the above mentioned approach.

@forgedhallpass
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant