Commit graph jw-pkg/src/python/jw/pkg/cmds/secrets/lib/DistroContext.py
Author SHA1 Message Date
b88a8ee299
cmds.secrets.lib.DistroContext.install(): Add method
Add DistroContext.install(). It takes a tar file containing secrets,
decrypts it, and installs all secrets needed on target and present in
that file. For every file that should be extracted, it logs if it
acutally did something or didn't.

It also features an only_missing argument, which is just a stub for
"allow to define somy extraction policy with respect to replacing all
/ some / not replace / whatever. Not thought through.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-24 16:53:55 +02:00
563ec7463a
cmds.secrets.Cmd: Fix type hints
cmds.secrets.Cmd has a CmdDistro-typed parent, should be CmdSecrets,
fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-24 16:53:54 +02:00
32c3477102
cmds.secrets.lib.DistroContext.list_template_files(): List more
Default to Distro's idea of relevant packages if no packages are
specified on the command line.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-21 21:52:10 +02:00
655b17bfec
cmds.secrets.lib.DistroContext: packages -> pkg_names
Cosmetics: The "packages" parameter to some DistroContext's methods
has a confusing name in same contexts, notably when mixed with a list
of Package instances, so rename it to "pkg_names".

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-21 21:52:10 +02:00
b44879c517
lib.FileContext.file_exists(): Fix missing await
file_exists and _stat() in file_exists() are async, need to be
awaited, but aren't. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-21 21:52:09 +02:00
1b821f3b3f cmds.secrets: Make commands work remotely
The "secrets" class of commands currently only works on the host it's
invoked on. Use the current FileContext to allow using the existing
commands on a target host.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-18 10:43:31 +02:00