-
Notifications
You must be signed in to change notification settings - Fork 28
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
Require authentication for partial restore #554
Conversation
c2c9e25
to
cc4cdf1
Compare
This includes now latest nethsm-sdk-py and can be reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Should I still perform some tests or can we directly merge and release?
pynitrokey/cli/nethsm.py
Outdated
if state == State.UNPROVISIONED: | ||
require_auth = False | ||
elif state == State.OPERATIONAL: | ||
require_auth = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens in the else
case? maybe just check for one of the two states, or directly raise an exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change this to have a default to require_auth = False
. Only the state Operational
will change this. Otherwise the error is handled by the SDK, with error message from the NetHSM.
fb56e31
to
0a1d765
Compare
I tested it with the latest container, but feel free to test if you want. |
0a1d765
to
f526fce
Compare
This PR adds a check for the NetHSM restore command, to determine if the authentication is required based on the state. Also raises the version for nethsm-sdk-py.
Depends on Nitrokey/nethsm-sdk-py#124
Changes
1.2.1
.Checklist
Make sure to run
make check
andmake fix
before creating a PR, otherwise the CI will fail.Test Environment and Execution
Relevant Output Example
Fixes #