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

Perform presence detection on Windows using UserConsentVerifier interop #1890

Merged

Conversation

RebeccaMahany
Copy link
Contributor

@RebeccaMahany RebeccaMahany commented Oct 14, 2024

Supersedes #1865 with a more appropriate implementation for our usecase.

This PR uses UserConsentVerifier.RequestVerificationAsync to perform presence detection. Because we are not a UWP app, we have to call this method by way of the interop interface --IUserConsentVerifierInterop.RequestVerificationForWindowAsync.

Calling RequestVerificationForWindowAsync requires a reference to a window, which we already have via systray, so I exposed that window in systray for use here.

I pulled in winrt-go because it makes it significantly easier to call async functions.

@RebeccaMahany RebeccaMahany marked this pull request as ready for review October 16, 2024 15:58
@RebeccaMahany RebeccaMahany added the features-improvements Features and Improvements label Oct 16, 2024
James-Pickett
James-Pickett previously approved these changes Oct 16, 2024
Copy link
Contributor

@James-Pickett James-Pickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

ee/presencedetection/presencedetection_windows.go Outdated Show resolved Hide resolved
@RebeccaMahany RebeccaMahany added this pull request to the merge queue Oct 16, 2024
Merged via the queue into kolide:main with commit fb83c23 Oct 16, 2024
29 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/windows-user-consent-verifier branch October 16, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features-improvements Features and Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants