Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task: review & improve if needed UI and UX of admin2 commands #534

Open
1 of 7 tasks
Tracked by #532
MVrachev opened this issue Mar 13, 2024 · 3 comments
Open
1 of 7 tasks
Tracked by #532

Task: review & improve if needed UI and UX of admin2 commands #534

MVrachev opened this issue Mar 13, 2024 · 3 comments
Assignees

Comments

@MVrachev
Copy link
Member

MVrachev commented Mar 13, 2024

What is the task about?

What is the task about?

Compare UI and UX between admin2 commands and current corresponding commands.

This will be an umbrella issue for UI and UX improvements for each of the commands.

Parent feature

#532

TODO

  • Show keys information when choosing whether to add or remove keys.
  • Sign command
  • Ceremony command
  • Metadata Update command
  • Change v1 to not use the online key that is also used by root offline keys
  • Add a better introduction to each of the commands

Sign UI & UX improvements

Ceremony UI & UX improvements

Metadata Update improvements

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kairoaraujo
Copy link
Member

Adding here as a note for error handling in the user UI/UX

Please enter path to encrypted private key: tests/files/key_storage/online1.key
Please enter password: 
Traceback (most recent call last):
  File "/Users/kairo/.local/share/virtualenvs/repository-service-tuf-cli-EVsxK5JG/bin/rstuf", line 8, in <module>
    sys.exit(rstuf())
  File "/Users/kairo/.local/share/virtualenvs/repository-service-tuf-cli-EVsxK5JG/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/kairo/.local/share/virtualenvs/repository-service-tuf-cli-EVsxK5JG/lib/python3.9/site-packages/rich_click/rich_command.py", line 126, in main
    rv = self.invoke(ctx)
  File "/Users/kairo/.local/share/virtualenvs/repository-service-tuf-cli-EVsxK5JG/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/kairo/.local/share/virtualenvs/repository-service-tuf-cli-EVsxK5JG/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/kairo/.local/share/virtualenvs/repository-service-tuf-cli-EVsxK5JG/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/kairo/.local/share/virtualenvs/repository-service-tuf-cli-EVsxK5JG/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/kairo/dev/RSTUF/repository-service-tuf-cli/repository_service_tuf/cli/admin2/ceremony.py", line 91, in ceremony
    _add_root_signatures_prompt(root_md, None)
  File "/Users/kairo/dev/RSTUF/repository-service-tuf-cli/repository_service_tuf/cli/admin2/helpers.py", line 415, in _add_root_signatures_prompt
    _add_signature_prompt(root_md, key)
  File "/Users/kairo/dev/RSTUF/repository-service-tuf-cli/repository_service_tuf/cli/admin2/helpers.py", line 377, in _add_signature_prompt
    signer = _load_signer_from_file_prompt(key)
  File "/Users/kairo/dev/RSTUF/repository-service-tuf-cli/repository_service_tuf/cli/admin2/helpers.py", line 142, in _load_signer_from_file_prompt
    private_key = load_pem_private_key(private_pem, password.encode())
TypeError: Password was given but private key is not encrypted.

@lukpueh
Copy link
Collaborator

lukpueh commented Apr 17, 2024

Thanks, great catch (no pun intended)! :P

Let's also except TypeError here:

except (ValueError, OSError, UnsignedMetadataError) as e:

... and cryptography.exceptions.UnsupportedAlgorithm, which may also be raised by load_pem_private__key.

@lukpueh
Copy link
Collaborator

lukpueh commented Apr 17, 2024

... and cryptography.exceptions.UnsupportedAlgorithm, which may also be raised by load_pem_private__key.

UnsupportedAlgorithm may be also raised in load_pem_public_key, so we should also except it here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants