feat: Use get_all attr and String type for signature field

This commit is contained in:
Skye Elliot
2026-05-06 14:33:31 +01:00
parent cb23c90842
commit bd277250f7
2 changed files with 6 additions and 10 deletions
+4 -8
View File
@@ -20,7 +20,7 @@
use pyo3::{
pyclass, pymethods,
types::{PyAnyMethods, PyModule, PyModuleMethods},
Bound, Py, PyAny, PyResult, Python,
Bound, PyResult, Python,
};
pub fn register_module(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
@@ -38,23 +38,19 @@ pub fn register_module(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()>
/// A pending cross-signing signature.
#[derive(Debug)]
#[pyclass(frozen)]
#[pyclass(frozen, get_all)]
pub struct SignatureListItem {
/// Full key ID of the signing key, e.g. `"ed25519:ABCDEF"`.
#[pyo3(get)]
pub signing_key_id: String,
/// User whose key was signed.
#[pyo3(get)]
pub target_user_id: String,
/// Device ID (or master-key ID) that the signature targets.
#[pyo3(get)]
pub target_device_id: String,
/// Raw signature value.
#[pyo3(get)]
pub signature: Py<PyAny>,
pub signature: String,
}
#[pymethods]
@@ -64,7 +60,7 @@ impl SignatureListItem {
signing_key_id: String,
target_user_id: String,
target_device_id: String,
signature: Py<PyAny>,
signature: String,
) -> Self {
Self {
signing_key_id,
+2 -2
View File
@@ -12,7 +12,7 @@ class SignatureListItem:
target_device_id: str
"""Device ID (or master-key ID) that the signature targets."""
signature: Any
signature: str
"""Raw signature value."""
def __init__(
@@ -20,5 +20,5 @@ class SignatureListItem:
signing_key_id: str,
target_user_id: str,
target_device_id: str,
signature: Any,
signature: str,
) -> None: ...