-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PyPolicyDefinition and related Verifier API changes #12390
Conversation
This is just the rust changes, I haven't adjusted the tests for the new API where things are accessible via |
Buut, this is a good time to discuss if we do want these things to be accessible only via the |
If they're just aliases then my opinion here is that we keep, but raise warnings and remove in 46. We have explicitly stated this isn't a stable API yet and is not subject to our backwards compatibility policy, but we do have consumers so we should give them a window for migration. @alex do you have an opinion? |
What @reaperhulk said sounds fine. |
Any pointers on what to look at for implementing deprecation warnings for python getters in rust? I think I have seen something along these lines in the codebase but I have no idea where anymore. (Will update the PR tomorrow - it's already evening here in Prague) |
cryptography/src/rust/src/x509/crl.rs Lines 262 to 264 in d860aaa
|
Exactly what I was looking for, thank you! Will report back tomorrow. |
I decided to rename PS: Will add the deprecated getters back in in a bit. |
src/rust/src/x509/verify.rs
Outdated
SubjectOwner::None => Err(pyo3::exceptions::PyRuntimeError::new_err( | ||
"subject must be set for ServerVerifiers", | ||
)), |
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.
Hmm, this should be unreachable from the Python API, right?
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.
If yes, this can just be a panic.
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 I came up with a cleaner and better solution in general - instead of adding a None
value to SubjectOwner
, I just made OwnedPolicyDefinition
use Option<SubjectOwner>
as the owner
. This way the build_subject
function doesn't need to handle None (.expect
is used in the build_server_verifier
method), and even the additional test shouldn't be needed.
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.
Take a look and tell me if u prefer it that way. If not I can revert back to old behaviour with a panic instead of returning pyerror.
601db4e
to
a039d3d
Compare
No description provided.