Skip to content

feat: allow plugin users to create a ClientUI#611

Closed
nicdumz wants to merge 3 commits into
FiloSottile:mainfrom
nicdumz:main
Closed

feat: allow plugin users to create a ClientUI#611
nicdumz wants to merge 3 commits into
FiloSottile:mainfrom
nicdumz:main

Conversation

@nicdumz
Copy link
Copy Markdown
Contributor

@nicdumz nicdumz commented Jan 13, 2025

Greetings,

I would like to suggest an alternative to #591 which will allow unblocking the consumer getsops/sops#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 nicdumz changed the title feat: allow plugin users to create a ClientUI feat: allow plugin users to create a ClientUI Jan 13, 2025
This would allow `age` library users to create the needed inputs to interact with the `plugin` module.
@nicdumz
Copy link
Copy Markdown
Contributor Author

nicdumz commented Jan 14, 2025

And now with 💯 passing tests, sorry.

@nicdumz
Copy link
Copy Markdown
Contributor Author

nicdumz commented Jan 17, 2025

FWIW, I saw that you were working on a plugin feature branch, and main still merges easily with your plugin after this, see nicdumz@c8259ad if you're interested.

FiloSottile added a commit that referenced this pull request Dec 24, 2025
Closes #611
Closes #591

Co-authored-by: Nicolas Dumazet <nicdumz.commits@gmail.com>
@FiloSottile
Copy link
Copy Markdown
Owner

@nicdumz This was definitely the right approach, thank you!

I implemented it slightly differently, without centralizing the printf functions.

Since it's based on your PR, I kept you as co-author on the commit.

@nicdumz
Copy link
Copy Markdown
Contributor Author

nicdumz commented Dec 26, 2025

Sounds good, thank you. We'll wait for the next release and that will allow deleting https://github.com/getsops/sops/blob/main/age/tui.go and replacing it with plugin.NewClientUI()

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.

2 participants