Skip to content

Plugins: binary mode for accepts (pass uploaded files as base64, not decoded text) #1727

Open

Description

@michielbdejong

Follow-up to #1653 / #1691.

Problem

When a plugin declares accepts, the host passes the uploaded file as decoded text: UTF-8, with a windows-1252 fallback. That's right for MT940 and camt.053, but binary formats need the raw bytes. ontola/atomic-plugins#141, the Willow drop importer, currently has to reverse the decoding inside the sandbox. It works and is tested, but it's a workaround, and it depends on the fallback decoder staying exactly reversible.

Proposal

Add an optional encoding to the accepts block:

"accepts": { "types": ["..."], "as": "text" | "base64" }
  • text stays the default, so existing plugins (MT940, camt) don't change.
  • With base64, the host passes the file's exact bytes, base64-encoded, and does no charset detection.
  • Validate it in both manifest implementations (server/src/plugins/manifest.rs and browser/lib/src/plugin-manifest.ts), with shared fixtures in testdata/plugin-manifest/. Leaving the field out must keep existing release ids byte-identical.
  • Upload size limits should apply to the raw byte size, not the base64 length.

Base branch: feat/plugin-debug, on top of #1691.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpluginShould probably be an Atomic Plugin

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions