Repository navigation
Require a policy-set authorisation key before showing a dialog - #18
Merged
Merged
Conversation
When HKLM\SOFTWARE\Policies\csharpDialog\AuthorisationKey holds the hex SHA-256 of a key, dialog.exe and the WPF host show a window only to a caller that passes that key in DIALOG_AUTH_KEY or with --key. Anything else writes "Key authorisation required" to stderr and the log and exits 30, matching swiftDialog. The value is read from policy only; one under HKCU or the tool's own key is ignored and logged. --key is stripped before the arguments are logged. Managed Notifications Dialog marks the key Managed on Prefs, and the Run tab takes a key and passes it through the environment, never the command line. Closes #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #17.
DialogAuthorisation(Core): readsAuthorisationKeyfromHKLM\SOFTWARE\Policies\csharpDialogonly (64-bit view), hashes the caller's key (SHA-256, hex, trimmed, constant-time compare, case-insensitive), envDIALOG_AUTH_KEYfirst then--key/--key=. Refusal: "Key authorisation required" to stderr + log, exit 30, no window.dialog.exe(CLI, covers command-file, JSON, fullscreen/kiosk, --autolaunch) and the WPF host.--keyis removed from the args before they are logged or parsed.HKLM\SOFTWARE\csharpDialog[\Settings]is ignored and logged.