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

Update credential support #425

Merged
merged 2 commits into from
Aug 18, 2023
Merged

Update credential support #425

merged 2 commits into from
Aug 18, 2023

Conversation

szszszsz
Copy link
Member

@szszszsz szszszsz commented Aug 12, 2023

This PR adds support for the credentials update, introduced in Nitrokey/trussed-secrets-app#99.

It's possible now to rename the credential, change its touch button use requirement, and change content of the PWS fields.

Builds on #424.

Changes

  • add API handling for credential update
  • add CLI handling for credential update
  • add tests

Checklist

Make sure to run make check and make fix before creating a PR, otherwise the CI will fail.

  • tested with Python3.11
  • signed commits
  • updated documentation (e.g. parameter description, inline doc, docs.nitrokey)
  • added labels

Test Environment and Execution

  • OS: Linux Fedora 38
  • device's model: USB/IP Sim of Secrets App
  • device's firmware version: v0.12.0-10-gf0ac5938, head of 65-update-credential-2.

Relevant Output Example

~/w/pynitrokey (402-update-credential-2|✔) $ ./venv/bin/nitropy nk3 secrets update --help
Command line tool to interact with Nitrokey devices 0.4.39
Usage: nitropy nk3 secrets update [OPTIONS] NAME

  Update credential. Change Static Password fields, or touch button
  requirement attribute.

Options:
  --login TEXT            Password Safe Login
  --password TEXT         Password Safe Password
  --metadata TEXT         Password Safe Metadata - additional field, to which
                          extra information can be encoded
  --touch-button BOOLEAN  Activate/deactivate touch button requirement
  --help                  Show this message and exit.
~/w/pynitrokey (402-update-credential-2|✔) $ ./venv/bin/nitropy nk3 secrets update "CRED ID" --touch-butto
n False
Command line tool to interact with Nitrokey devices 0.4.39
Please touch the device if it blinks
Done
~/w/pynitrokey (402-update-credential-2|✔) $ ./venv/bin/nitropy nk3 secrets list
Command line tool to interact with Nitrokey devices 0.4.39
Please provide PIN to show PIN-protected entries (if any), or press ENTER to skip
Please touch the device if it blinks
Current PIN (8 attempts left):
No PIN provided
01. CRED ID     Hotp/Sha1
02. CRED ID2    Hotp/Sha1
~/w/pynitrokey (402-update-credential-2|✔) $ ./venv/bin/nitropy nk3 secrets update "CRED ID" --touch-butto
n True
Command line tool to interact with Nitrokey devices 0.4.39
Please touch the device if it blinks
Done
~/w/pynitrokey (402-update-credential-2|✔) $ ./venv/bin/nitropy nk3 secrets list
Command line tool to interact with Nitrokey devices 0.4.39
Please provide PIN to show PIN-protected entries (if any), or press ENTER to skip
Please touch the device if it blinks
Current PIN (8 attempts left):
No PIN provided
01. CRED ID     Hotp/Sha1       touch required
02. CRED ID2    Hotp/Sha1
~/w/pynitrokey (402-update-credential-2|✔) $

Fixes #402

Connected:

Add tests for credential update with PWS and touch button requirement
Add CLI handling for the update command
Copy link
Contributor

@sosthene-nitrokey sosthene-nitrokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we should wait to settle on Nitrokey/trussed-secrets-app#99 (comment) before merging.

@szszszsz
Copy link
Member Author

Updates:

  • correct test for Credential fields removal
  • check if registering with empty slices for PWS fields is forbidden

Base automatically changed from 402-update-credential to master August 17, 2023 15:07
@szszszsz szszszsz merged commit 88cd7e4 into master Aug 18, 2023
10 checks passed
@szszszsz szszszsz deleted the 402-update-credential-2 branch August 18, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application:secrets Secrets app: OTP and Password Safe device/Nitrokey 3 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Secrets App: allow to update credential
2 participants