Handle the request-public plugin stanza (#9)#14
Merged
Conversation
The plugin client handled msg, request-secret, and confirm but not request-public, so a plugin asking for a non-secret value got 'unsupported' and failed. Handle it alongside request-secret (the interface already carries the secret flag), distinguishing the two by type: request-secret masks input, request-public does not. It also replies 'fail' when no callbacks are wired, like the others. Fixes #9
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14 +/- ##
==========================================
+ Coverage 91.57% 91.87% +0.29%
==========================================
Files 38 38
Lines 2338 2338
Branches 310 310
==========================================
+ Hits 2141 2148 +7
+ Misses 139 133 -6
+ Partials 58 57 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Mirror the recipient tests for PluginIdentity: msg-with-callbacks (DisplayMessage) and confirm-label-not-base64. These identity paths were previously untested.
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.
The plugin client (
HandleCommonStanzainPluginRecipient/PluginIdentity) handledmsg,request-secret, andconfirm, but notrequest-public— so a plugin asking the user for a non-secret value gotunsupportedand the operation failed. See #9.Change
Handle
request-publicalongsiderequest-secret, matching the referenceplugin/client.go(which pairs them and distinguishes by type). TheIPluginCallbacks.RequestValue(prompt, secret)plumbing already existed, sorequest-publicsimply calls it withsecret: false:It's also added to the no-callbacks guard, so it replies
fail(per spec) when the client has no UI.Tests
New coverage for both recipient and identity paths: the callback is invoked with
secret: false, the value is returned viaok, andfailis sent when no callbacks are wired. Full suite green (Age.Tests 348/348, Age.TestKit 143/143, 0 skipped); runs on the 3-OS matrix.Fixes #9