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

Server app integrity check #26

Open
Narenvaran opened this issue Sep 22, 2019 · 2 comments
Open

Server app integrity check #26

Narenvaran opened this issue Sep 22, 2019 · 2 comments
Labels

Comments

@Narenvaran
Copy link

Hi @duddu ,
Can I Share the hash generated by plugin to server and check integrity in ajax call.
If so i wanted to know where will the generated hash keys be stored to verify?

@duddu
Copy link
Owner

duddu commented Sep 22, 2019

hello @Narenvaran, at this moment the verification occurs on the app native side: the hash for the assets are generated at compile time and bundled as part of the application code; then compared at launch time with the current ones.
in order to enable integrity check on your server-side the easiest way is to get the generated hash from the cordova compile logs (using verbose you will see all the operations made by this plugin), and store them (associating them with the version of the app) in any data-store form you like, and then implement a service that the native code will call at launch, which would compare the has that the plugin generated at compile time with the ones that sends at app launch. This call do cannot be an ajax call from javascript: it must occur from native code, or all the assets have already been loaded and there is no point in checking the integrity anymore!

Enabling a server-side integrity check as described above wouldn't be hard, but I wasn't originally keen to put this in this plugin since it would require (and dictate) a server-side implementation to couple with the native one.
But feel free to give it a go in a PR if you are interested, happy to consider it.

@duddu duddu added the question label Sep 22, 2019
@oxr463
Copy link

oxr463 commented Feb 27, 2020

Enabling a server-side integrity check as described above wouldn't be hard, but I wasn't originally keen to put this in this plugin since it would require (and dictate) a server-side implementation to couple with the native one.

Or simply create a separate plugin for that.

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

No branches or pull requests

3 participants