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

Add backup validation #52

Merged
merged 1 commit into from
Oct 27, 2023
Merged

Add backup validation #52

merged 1 commit into from
Oct 27, 2023

Conversation

robin-nitrokey
Copy link
Member

This patch adds the Backup and EncryptedBackup classes.
EncryptedBackup.parse can be used to parse and validate the format of a
backup file. EncryptedBackup.decrypt can be used to decrypt a backup
and validate the decrypted data.

This also adds validation of the backup file to the unit tests.

Fixes: #49

Depends on: #51

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (bd090a7) 79.36% compared to head (436ac8e) 79.42%.

❗ Current head 436ac8e differs from pull request most recent head 84970f5. Consider uploading reports for the commit 84970f5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   79.36%   79.42%   +0.06%     
==========================================
  Files         782      783       +1     
  Lines       13387    13465      +78     
==========================================
+ Hits        10625    10695      +70     
- Misses       2762     2770       +8     
Files Coverage Δ
nethsm/backup.py 89.47% <89.47%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daringer
Copy link
Collaborator

first merge this and release then update the pynitrokey dependency to a release instead of a git url?

This patch adds the Backup and EncryptedBackup classes.
EncryptedBackup.parse can be used to parse and validate the format of a
backup file.  EncryptedBackup.decrypt can be used to decrypt a backup
and validate the decrypted data.

This also adds validation of the backup file to the unit tests.

Fixes: #49
@robin-nitrokey robin-nitrokey marked this pull request as ready for review October 27, 2023 16:59
@robin-nitrokey robin-nitrokey merged commit ea83d38 into main Oct 27, 2023
@robin-nitrokey robin-nitrokey deleted the validate-backup branch October 27, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add backup validation
2 participants