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

docs: document platform-specific behavior on Windows #152

Closed
wants to merge 1 commit into from

Conversation

ReactorScram
Copy link
Contributor

where service is not used.

This could lead to callers silently using a very generic collision-prone name like "token"

e.g. https://github.com/firezone/firezone/blob/main/rust/windows-client/src-tauri/src/client/gui.rs#L215-L219

I ran cargo test a few times and it passed once but failed other times. I think it isn't playing well with Rust's multi-threaded test framework.

@brotskydotcom
Copy link
Collaborator

Hi @ReactorScram, thanks for the suggestion. All the platform-specific behavior is documented in the platform-specific documentation, so you might want to switch your platform on docs.rs to Windows (rather than the default linux). There, in the documentation of the windows credential store module, you will find this paragraph:

Because the Windows credential manager doesn't support multiple collections of credentials,
and because many Windows programs use only the service name as the credential target name,
the Entry::new_with_target call uses the target parameter as the credential's target name
rather than concatenating the username and service.
So if you have a custom algorithm you want to use for computing the Windows target name,
you can specify the target name directly. (You still need to provide a service and username,
because they are used in the credential's metadata.)

With respect to the testing issue you've noticed, I have found that the problem seems to be less related to multi-threading and more to proper initialization of the windows credential manager (which can be tricky in a terminal session, especially if your are running headless). Whenever I'm actually on a physical windows box, and have logged in "normally", the tests run fine.

I'm going to close this PR based on the above. If you feel the current docs aren't adequate, please feel free to open an issue.

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

Successfully merging this pull request may close these issues.

2 participants