Skip to content

Commit

Permalink
Check recipient prefixes in create
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr42 committed Feb 25, 2022
1 parent 8883228 commit 6116fc1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/icepack/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6116fc1

Please sign in to comment.