mirror of
https://github.com/element-hq/synapse.git
synced 2026-05-14 14:45:10 +00:00
feat: Use get_all attr and String type for signature field
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user