Snap sign: Should the support for stdin data be deprecated or removed?

Problem: If the snap key has a passphrase, then it’s not possible to enter something in the curses/readline passphrase dialog.

Example:
cat mymodel.json | snap sign -k default > my.model

The PR below i added filename as an optional option.

https://github.com/snapcore/snapd/pull/7961

Currently i see these options:

  • Can i break the behavior of the command and remove the stdin default.
  • Make the filename optional
  • Fix or add the interpretation of the reflection-tags, so that the filename is "required: no"

The docs should also be modified here:
https://docs.ubuntu.com/core/en/guides/build-device/image-building#2.-sign-your-model-assertion

no

yes

i’m not sure I follow, but that’s for the pull request review. The forum is not the right place for code review. I’ve answered the other two as they’re more policy-ish :slight_smile: but let’s carry this on over there.

I was also not sure if it fits in the forum.

First has to find out whether the snap source code supports optionally positional arguments. If not, is it a missing feature?

it does support them, and in fact several commands use that feature. Look for example at list, refresh, changes, tasks, abort, watch, services, aliases, connections, saved, save, … you get the idea.

Hey, :slight_smile:

In the first look: None of this “positional arguments” are optional ( == “required: no” )

It was late yesterday, and i didn’t find an non-required positional argument, yet