-
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
Start converting src/x509/verify.rs
to new pyo3 APIs
#10736
Conversation
9d4ce5e
to
05dc8b3
Compare
Ah hold off the review, I pushed too early, still need to fix a couple of errors |
a4c0d78
to
80cd22f
Compare
80cd22f
to
0f86ab4
Compare
@alex Done, please check the last commit: I had to remove a call to // before
let value = subject
.getattr(pyo3::intern!(py, "value"))?
.downcast::<pyo3::types::PyString>()?
.clone();
Ok(SubjectOwner::DNSName(value.to_str()?.to_owned()))
// after
let value = subject
.getattr(pyo3::intern!(py, "value"))?
.extract::<String>()?;
Ok(SubjectOwner::DNSName(value)) So I changed the |
src/rust/src/x509/verify.rs
Outdated
Ok(SubjectOwner::IPAddress(value.into())) | ||
.downcast::<pyo3::types::PyBytes>()? | ||
.clone(); | ||
Ok(SubjectOwner::IPAddress(value.clone().unbind())) |
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 don't think this clone is required.
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.
good catch, fixed!
Ok(SubjectOwner::DNSName(value.to_str()?.to_owned())) | ||
} else if subject.is_instance(types::IP_ADDRESS.get(py)?)? { | ||
.extract::<String>()?; | ||
Ok(SubjectOwner::DNSName(value)) |
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.
Can you add a comment reminding us that when our minimum python is 3.10, we can switch to borrowing the str.
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.
done
Looks like a GHA error on one of the runners:
|
Part of #10676
This fixes all except one of the migration warnings for
src/x509/verify.rs
. The remaining warning should be fixed by the changes onverify.rs
on this PR: linkcc @alex @reaperhulk