Skip to content

Fix desktop app integration bugs#10

Merged
lightcap merged 1 commit into
mainfrom
fix/desktop-integration
May 13, 2026
Merged

Fix desktop app integration bugs#10
lightcap merged 1 commit into
mainfrom
fix/desktop-integration

Conversation

@lightcap
Copy link
Copy Markdown
Collaborator

@lightcap lightcap commented May 13, 2026

Summary

Fixes two bugs discovered during a smoke test against the 1Password desktop app that prevented the desktop integration from working:

  1. ClientConfig serialization -- The 1Password shared library requires serviceAccountToken to always be present in the config payload (even as an empty string ""), and account_name to be included when set. Previously, serviceAccountToken was omitted when empty via skip_serializing_if, and account_name was unconditionally skipped via skip_serializing. Both fields are now serialized correctly.

  2. Response payload deserialization -- The shared library returns payload as a raw JSON byte array ([65,110,...]), not a base64 string. The base64_payload deserializer has been replaced with a flexible_payload deserializer that handles both formats (raw byte array and base64 string), ensuring compatibility across library versions.

Test plan

  • cargo fmt --check passes
  • cargo clippy -- -D warnings passes (default features)
  • cargo clippy --features desktop -- -D warnings passes
  • cargo test passes (23 tests, default features)
  • cargo test --features desktop passes (26 tests, including 3 new/renamed desktop tests)
  • Verify desktop_config_includes_account_name test confirms serviceAccountToken is "" and account_name is "myaccount"
  • Verify service_account_config_omits_account_name test confirms serviceAccountToken is "ops_test" and account_name is absent
  • Verify response_payload_deserializes_from_byte_array test confirms raw byte array [104,101,108,108,111] deserializes to b"hello"
  • Verify response_payload_deserializes_from_base64 test still passes (backward compat)

Note

Medium Risk
Changes request/response wire formats for the desktop shared-library integration (config serialization and response payload decoding), which can affect interoperability and error handling across library versions.

Overview
Fixes desktop shared-library interoperability by adjusting ClientConfig JSON serialization: serviceAccountToken is now always emitted (even when empty) and account_name is included when set.

Updates shared-library Response decoding to accept payload as either base64 text or a raw JSON byte array via a new flexible_payload deserializer, and updates/adds tests to cover both formats.

Reviewed by Cursor Bugbot for commit 4391436. Bugbot is set up for automated code reviews on this repo. Configure here.

The 1Password shared library requires `serviceAccountToken` to always
be present in the client config (even as empty string) and `account_name`
to be included when using desktop app auth. Previously both were
incorrectly omitted from serialization.

The shared library also returns response `payload` as a raw JSON byte
array rather than a base64 string. The deserializer now accepts both
formats.
@lightcap lightcap merged commit f633979 into main May 13, 2026
6 checks passed
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.

1 participant