Skip to content

Commit

Permalink
Upload key updates
Browse files Browse the repository at this point in the history
* Record the key id for a specific unit and don't allow multiple keys for that unit.
  • Loading branch information
wtgee committed Jan 10, 2024
1 parent 9e2a788 commit 3d7ec52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/panoptes/pocs/utils/cli/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@


@app.command('get-key')
def get_key_cmd(secret_password: str = typer.Option(..., prompt=True, hide_input=True),
def get_key_cmd(unit_id: str = typer.Option(..., prompt=True),
secret_password: str = typer.Option(..., prompt=True, hide_input=True),
save_dir: Path = Path('~/keys').expanduser(),
key_name: str = 'panoptes-upload-key.json',
enable_image_upload: bool = True,
Expand All @@ -34,7 +35,7 @@ def get_key_cmd(secret_password: str = typer.Option(..., prompt=True, hide_input
return

# Make a request for the key.
res = requests.post(url, json=dict(pwd=secret_password))
res = requests.post(url, json=dict(pwd=secret_password, unit_id=unit_id))
if not res.ok:
print(f'[red]Error getting key: {res.text}[/]')
return
Expand Down

0 comments on commit 3d7ec52

Please sign in to comment.