-
Notifications
You must be signed in to change notification settings - Fork 61
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
Make separate constructors for RO/RW sessions #101
Conversation
The previous constructor took a boolean argument which made it difficult to understand what the user code would be doing. That constructor is now two separate functions, one for RO sessions, one for RW sessions. The `_no_callback` part of the method name was also removed and added to the documentation instead. Signed-off-by: Ionut Mihalcea <[email protected]>
cryptoki/tests/basic.rs
Outdated
ro_session.login(UserType::User, Some(USER_PIN))?; | ||
|
||
// generate a key pair | ||
// This should NOT work using the Read/Write session |
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 think you meant "Read-Only" in this comment rather than "Read/Write".
Should the same change also be made to |
I was wondering, but I felt more comfortable with a more verbose (but accurate) name for an internal function, though maybe consistency is more important 🤔 Will change |
Signed-off-by: Ionut Mihalcea <[email protected]>
b54085f
to
38d5538
Compare
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.
Thanks ✅
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.
This looks good indeed 👍 just remember to bump the minor version (since the API change) but this is a nice improvement for readability.
The previous constructor took a boolean argument which made it difficult
to understand what the user code would be doing. That constructor is now
two separate functions, one for RO sessions, one for RW sessions. The
_no_callback
part of the method name was also removed and added to thedocumentation instead.
cc @ximon18