[MS] Use pki bindings instead of mocks #11652
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To purely check the design part (how it looks), it's possible to set
(window as any).TESTING_PKI = truesomwhere at the top of the main.ts, which will switch the PKI implementation to the mock one. Usefull for e2e tests (since PKI is not available on web) or quickly checking the design, but of course, not enough to see if it actually works. It does help to check how some errors are displayed as they can be difficult to generate manually.It can only be properly tested on Windows right now.
Since certificates are needed for that, a nice little script if provided. Launch a Powershell terminal, go to
parsec-cloud\libparsec\crates\platform_pki\examples, and run.\init_windows_credstore.ps1. Just accept to add the certificate, and when you're killing the script, it will automatically remove the certificates for you (if you accept). You may need to provide specific permissions to be able to exec the script (something aboutExec-Policy).Then run Electron: the smardcard should be available as a mean to authenticate, and the PKI tab in invitations should be visible.