Skip to content

Handle the request-public plugin stanza (#9)#14

Merged
pscheid92 merged 2 commits into
mainfrom
fix/plugin-request-public
Jul 23, 2026
Merged

Handle the request-public plugin stanza (#9)#14
pscheid92 merged 2 commits into
mainfrom
fix/plugin-request-public

Conversation

@pscheid92

@pscheid92 pscheid92 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

The plugin client (HandleCommonStanza in PluginRecipient / PluginIdentity) handled msg, request-secret, and confirm, but not request-public — so a plugin asking the user for a non-secret value got unsupported and the operation failed. See #9.

Change

Handle request-public alongside request-secret, matching the reference plugin/client.go (which pairs them and distinguishes by type). The IPluginCallbacks.RequestValue(prompt, secret) plumbing already existed, so request-public simply calls it with secret: false:

case "request-secret":
case "request-public":
    var value = callbacks!.RequestValue(Encoding.UTF8.GetString(body), secret: type == "request-secret");
    conn.WriteStanza("ok", [], Encoding.UTF8.GetBytes(value));
    break;

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 via ok, and fail is 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

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

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (61a9546) to head (a672d59).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Mirror the recipient tests for PluginIdentity: msg-with-callbacks
(DisplayMessage) and confirm-label-not-base64. These identity paths
were previously untested.
@pscheid92
pscheid92 merged commit 46d06f4 into main Jul 23, 2026
5 checks passed
@pscheid92
pscheid92 deleted the fix/plugin-request-public branch July 23, 2026 01:25
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.

Plugin client does not handle the request-public stanza

1 participant