Skip to content

cli: support ECIES encryption for device configs - #223

Open
vkhoroz wants to merge 1 commit into
mainfrom
vkhoroz-ecies
Open

cli: support ECIES encryption for device configs#223
vkhoroz wants to merge 1 commit into
mainfrom
vkhoroz-ecies

Conversation

@vkhoroz

@vkhoroz vkhoroz commented Aug 7, 2026

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Volodymyr Khoroz <volodymyr.khoroz@foundries.io>
@vkhoroz
vkhoroz requested review from doanac and a lite review from Copilot August 7, 2026 18:45
@vkhoroz vkhoroz self-assigned this Aug 7, 2026
Comment thread go.mod

require (
github.com/alexflint/go-arg v1.6.0
github.com/foundriesio/go-ecies v0.3.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doanac There seems to be a way to support ECIES in web UI via https://github.com/ecies/js, but I'm not sure if we should support that. We did not in our cloud solution.
One specific UI problem I see with this is that the "edit" functionality might seem confusing, as there is no way to give a user "something" to edit in case of encrypted files - that's rather a replace operation.

Do you think that's worth an effort?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds optional ECIES encryption support to the satcli configs set command for device-specific configuration uploads by fetching the device’s stored public key and encrypting config values before submitting them to the server.

Changes:

  • Introduces --encrypt/-e for configs set and encrypts config values with ECIES (base64-encoded ciphertext) when used with --device.
  • Refactors the CLI configs API to use a SpecificConfigsApi interface and expands the device API to expose GetPubkey().
  • Updates module dependencies to include github.com/foundriesio/go-ecies.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go.mod Adds github.com/foundriesio/go-ecies dependency.
go.sum Records checksums for the new ECIES dependency.
cli/subcommands/configs/set.go Adds --encrypt/-e, encrypts device config file values via ECIES, and fetches device pubkey for encryption.
cli/subcommands/configs/cmd.go Adjusts device API selection to return the device configs API object (enables pubkey access).
cli/api/configs.go Refactors SpecificConfigsApi into an interface, introduces specificConfigsApi implementation, and adds DeviceConfigsApi.GetPubkey().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +127 to +128
if dcapi, ok := capi.(api.DeviceConfigsApi); !ok {
return errors.New("encrypt can only be used for device configuration")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doanac I like the way a message looks right now, but if you agree with ai, I'll submit.

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