age icon indicating copy to clipboard operation
age copied to clipboard

feat: allow plugin users to create a `ClientUI`

Open nicdumz opened this issue 1 year ago • 2 comments

Greetings,

I would like to suggest an alternative to https://github.com/FiloSottile/age/pull/591 which will allow unblocking the consumer https://github.com/getsops/sops/pull/1641. (I'm interested in plugin support in sops so I can try out FIDO2 keys inside of Nix via sops-nix).

Instead of exposing all age internals into a separate package (which I presume isn't the best from a maintenance PoV), I move functions which need to be shared between plugin and main into two new internal private modules.

This lets me eventually expose NewClientUI() for consumers.

  • Move logging functions to internal/logger.
  • Move terminal related functions to internal/term
  • Expose a public plugin.NewClientUI()

Kudos to @brianmcgee for the original work.

@FiloSottile I'm happy to iterate on this code, let me know your constraints and I'll work with you.

HTH.

nicdumz avatar Jan 13 '25 22:01 nicdumz

And now with :100: passing tests, sorry.

nicdumz avatar Jan 14 '25 06:01 nicdumz

FWIW, I saw that you were working on a plugin feature branch, and main still merges easily with your plugin after this, see https://github.com/nicdumz/age/commit/c8259addd76e68985a472ec814de76470477bf90 if you're interested.

nicdumz avatar Jan 17 '25 17:01 nicdumz