From 6116fc1d9ed82f84aa6c7f3bbfdedee013fd4198 Mon Sep 17 00:00:00 2001 From: Alexander Dietrich Date: Fri, 25 Feb 2022 14:17:32 +0100 Subject: [PATCH] Check recipient prefixes in create --- src/icepack/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/icepack/cli.py b/src/icepack/cli.py index b03f8d8..a33d8cd 100644 --- a/src/icepack/cli.py +++ b/src/icepack/cli.py @@ -84,7 +84,9 @@ def create(ctx, src, dst, compression, mode, mtime, recipient): aliases = {alias: key for key, alias in signers if alias is not None} recipients = [aliases[r] if r in aliases else r for r in recipient] recipients.insert(0, public_key.read_text().strip()) - # TODO Validate recipient values + for r in recipients: + if not r.startswith('ssh-'): + raise click.ClickException(f'Invalid recipient: {r}') kwargs = { 'compression': compression, 'mode': mode,