repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/appservice.rs | crates/core/src/appservice.rs | //! (De)serializable types for the [Matrix Application Service
//! API][appservice-api]. These types can be shared by application service and
//! server code.
//!
//! [appservice-api]: https://spec.matrix.org/latest/application-service-api/
use serde::{Deserialize, Serialize};
use url::Url;
pub mod event;
pub mod pin... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state.rs | crates/core/src/state.rs | use std::{
borrow::Borrow,
cmp::{Ordering, Reverse},
collections::{BinaryHeap, HashMap, HashSet},
hash::Hash,
sync::OnceLock,
};
use futures_util::{StreamExt, stream};
use tracing::{debug, info, instrument, trace, warn};
mod error;
pub use error::{StateError, StateResult};
pub mod event_auth;
pub ... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | true |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/media.rs | crates/core/src/media.rs | /// Endpoints for the media repository.
mod content;
use std::time::Duration;
pub use content::*;
use reqwest::Url;
use salvo::oapi::{ToParameters, ToSchema};
use serde::{Deserialize, Serialize};
use crate::{
OwnedMxcUri, OwnedServerName, PrivOwnedStr, ServerName, UnixMillis,
sending::{SendRequest, SendResult... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/test_utils.rs | crates/core/src/test_utils.rs | use std::{
borrow::Borrow,
collections::{BTreeMap, HashMap, HashSet},
sync::{
Arc,
atomic::{AtomicU64, Ordering::SeqCst},
},
};
use serde_json::{json, value::to_raw_value as to_raw_json_value};
pub(crate) use self::event::PduEvent;
use crate::serde::RawJsonValue;
use crate::{
Event... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/room_version_rules.rs | crates/core/src/room_version_rules.rs | //! Types for the rules applied to the different [room versions].
//!
//! [room versions]: https://spec.matrix.org/latest/rooms/
#[allow(clippy::disallowed_types)]
use std::collections::HashSet;
use as_variant::as_variant;
use crate::OwnedUserId;
/// The rules applied to a [room version].
///
/// This type can be c... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/client.rs | crates/core/src/client.rs | pub mod account;
pub mod appservice;
pub mod backup;
pub mod dehydrated_device;
pub mod device;
pub mod directory;
pub mod discovery;
pub mod event;
pub mod filter;
pub mod http_header;
pub mod key;
pub mod media;
pub mod membership;
pub mod message;
pub mod presence;
pub mod profile;
pub mod push;
pub mod redact;
pub ... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/federation.rs | crates/core/src/federation.rs | //! (De)serializable types for the [Matrix Server-Server API][federation-api].
//! These types are used by server code.
//!
//! [federation-api]: https://spec.matrix.org/latest/server-server-api/
#![cfg_attr(docsrs, feature(doc_cfg))]
mod serde;
pub mod authenticated_media;
pub mod authentication;
pub mod authorizati... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/error.rs | crates/core/src/error.rs | //! Errors that can be sent from the homeserver.
use std::{error::Error as StdError, fmt, iter::FromIterator, num::ParseIntError};
use salvo::{
http::{Response, StatusCode, header},
writing::Scribe,
};
use serde::{Deserialize, Serialize};
use serde_json::{Map as JsonMap, Value as JsonValue, json};
mod auth;
... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/utils.rs | crates/core/src/utils.rs | use crate::{EventId, IdParseError, OwnedEventId, RoomId};
/// Convenience extension trait for [`RoomId`].
pub(crate) trait RoomIdExt {
/// Get the event ID of the `m.room.create` event of the room from a PDU, for room versions
/// using it as the room ID.
fn room_create_event_id(&self) -> Result<OwnedEvent... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/invite_permission_config.rs | crates/core/src/invite_permission_config.rs | //! Types for the [`m.invite_permission_config`] account data event.
//!
//! [`m.invite_permission_config`]: https://github.com/matrix-org/matrix-spec-proposals/pull/4380
use palpo_core_macros::EventContent;
use serde::{Deserialize, Serialize};
/// The content of an `m.invite_permission_config` event.
///
/// A singl... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/http_headers.rs | crates/core/src/http_headers.rs | //! Helpers for HTTP headers.
use std::borrow::Cow;
mod content_disposition;
mod rfc8187;
pub use self::content_disposition::{
ContentDisposition, ContentDispositionParseError, ContentDispositionType, TokenString,
TokenStringParseError,
};
/// Whether the given byte is a [`token` char].
///
/// [`token` cha... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/authentication.rs | crates/core/src/authentication.rs | //! Common types for authentication.
use salvo::prelude::*;
use crate::{PrivOwnedStr, serde::StringEnum};
/// Access token types.
#[doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/doc/string_enum.md"))]
#[derive(ToSchema, Clone, StringEnum)]
#[non_exhaustive]
pub enum TokenType {
/// Bearer token ty... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/to_device.rs | crates/core/src/to_device.rs | use std::collections::BTreeMap;
/// Common types for the Send-To-Device Messaging
///
/// [send-to-device]: https://spec.matrix.org/latest/client-server-api/#send-to-device-messaging
use std::fmt::{Display, Formatter, Result as FmtResult};
use salvo::prelude::*;
use serde::{
Deserialize, Deserializer, Serialize, S... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/auth_scheme.rs | crates/core/src/auth_scheme.rs | //! The `AuthScheme` trait used to specify the authentication scheme used by endpoints and the types
//! that implement it.
#![allow(clippy::exhaustive_structs)]
use as_variant::as_variant;
use http::HeaderMap;
use http::header::{self, InvalidHeaderValue};
use serde::Deserialize;
/// Trait implemented by types repre... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/events.rs | crates/core/src/events.rs | //! (De)serializable types for the events in the [Matrix](https://matrix.org) specification.
//! These types are used by other Palpo use crate::s.
//!
//! All data exchanged over Matrix is expressed as an event.
//! Different event types represent different actions, such as joining a room or
//! sending a message. E... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identity.rs | crates/core/src/identity.rs | //! (De)serializable types for the [Matrix Identity Service API][identity-api].
//! These types can be shared by client and identity service code.
//!
//! [identity-api]: https://spec.matrix.org/latest/identity-service-api/
use std::fmt;
pub mod association;
pub mod authentication;
pub mod discovery;
pub mod invitati... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/space.rs | crates/core/src/space.rs | //! Common types for [spaces].
//!
//! [spaces]: https://spec.matrix.org/latest/client-server-api/#spaces
use salvo::prelude::*;
use crate::macros::StringEnum;
use crate::{PrivOwnedStr, room::JoinRule};
/// The rule used for users wishing to join a room.
///
/// In contrast to the regular `JoinRule` in `palpo_core::... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/metadata.rs | crates/core/src/metadata.rs | mod matrix_version;
pub use matrix_version::*;
mod supported_versions;
pub use supported_versions::*;
// #[cfg(test)]
// mod tests;
// /// The complete history of this endpoint as far as Palpo knows, together
// with all variants on /// versions stable and unstable.
// ///
// /// The amount and positioning of path va... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/room.rs | crates/core/src/room.rs | //! Common types for rooms.
use std::{
borrow::{Borrow, Cow},
collections::BTreeMap,
};
use as_variant::as_variant;
use salvo::prelude::*;
use serde::de::Error as _;
use serde::{Deserialize, Serialize, de};
use serde_json::{Value as JsonValue, value::RawValue as RawJsonValue};
use crate::{
Direction, Even... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/directory.rs | crates/core/src/directory.rs | /// Common types for room directory endpoints.
use serde::{Deserialize, Serialize};
mod filter_room_type_serde;
mod room_network_serde;
use salvo::prelude::*;
use crate::{
OwnedMxcUri, OwnedRoomAliasId, OwnedRoomId, PrivOwnedStr, UnixMillis, room::RoomType,
serde::StringEnum,
};
/// A chunk of a room list res... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/conditional_push_rule.rs | crates/core/src/push/conditional_push_rule.rs | //! Common types for the [push notifications module][push].
//!
//! [push]: https://spec.matrix.org/latest/client-server-api/#push-notifications
//!
//! ## Understanding the types of this module
//!
//! Push rules are grouped in `RuleSet`s, and are grouped in five kinds (for
//! more details about the different kind of... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/simple_push_rule.rs | crates/core/src/push/simple_push_rule.rs | //! Common types for the [push notifications module][push].
//!
//! [push]: https://spec.matrix.org/latest/client-server-api/#push-notifications
//!
//! ## Understanding the types of this module
//!
//! Push rules are grouped in `RuleSet`s, and are grouped in five kinds (for
//! more details about the different kind of... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/push_gateway.rs | crates/core/src/push/push_gateway.rs | //! `GET /_matrix/client/*/notifications`
//!
//! Paginate through the list of events that the user has been, or would have
//! been notified about. `/v3/` ([spec])
//!
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3notifications
use salvo::prelude::*;
use serde::{Deserialize, Serialize... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/error.rs | crates/core/src/push/error.rs | use std::{error::Error as StdError, fmt};
use thiserror::Error;
/// The error type returned when trying to insert a user-defined push rule into
/// a `Ruleset`.
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum InsertPushRuleError {
/// The rule ID starts with a dot (`.`), which is reserved for
/// server-de... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/push_rule.rs | crates/core/src/push/push_rule.rs | //! Common types for the [push notifications module][push].
//!
//! [push]: https://spec.matrix.org/latest/client-server-api/#push-notifications
//!
//! ## Understanding the types of this module
//!
//! Push rules are grouped in `RuleSet`s, and are grouped in five kinds (for
//! more details about the different kind of... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/condition.rs | crates/core/src/push/condition.rs | #[cfg(feature = "unstable-msc4306")]
use std::panic::RefUnwindSafe;
use std::{collections::BTreeMap, ops::RangeBounds, str::FromStr};
#[cfg(feature = "unstable-msc4306")]
use std::{future::Future, pin::Pin, sync::Arc};
use regex::bytes::Regex;
use salvo::oapi::ToSchema;
use serde::{Deserialize, Serialize};
use serde_j... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | true |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/predefined.rs | crates/core/src/push/predefined.rs | //! Constructors for [predefined push rules].
//!
//! [predefined push rules]: https://spec.matrix.org/latest/client-server-api/#predefined-rules
use crate::macros::StringEnum;
use super::{
Action, ConditionalPushRule, PushCondition::*, RoomMemberCountIs, RuleKind, Ruleset, Tweak,
};
use crate::{PrivOwnedStr, Use... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/ruleset.rs | crates/core/src/push/ruleset.rs | //! Constructors for [predefined push rules].
//!
//! [predefined push rules]: https://spec.matrix.org/latest/client-server-api/#predefined-rules
use indexmap::IndexSet;
use salvo::oapi::ToSchema;
use serde::{Deserialize, Serialize};
use tracing::instrument;
use super::{
Action, AnyPushRuleRef, ConditionalPushRul... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/patterned_push_rule.rs | crates/core/src/push/patterned_push_rule.rs | //! Common types for the [push notifications module][push].
//!
//! [push]: https://spec.matrix.org/latest/client-server-api/#push-notifications
//!
//! ## Understanding the types of this module
//!
//! Push rules are grouped in `RuleSet`s, and are grouped in five kinds (for
//! more details about the different kind of... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/action.rs | crates/core/src/push/action.rs | use std::collections::BTreeMap;
use as_variant::as_variant;
use salvo::prelude::*;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use crate::serde::{JsonValue, RawJsonValue, from_raw_json_value};
/// This represents the different actions that should be taken when a rule is
/// matched, and controls h... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/iter.rs | crates/core/src/push/iter.rs | use indexmap::set::{IntoIter as IndexSetIntoIter, Iter as IndexSetIter};
use super::{
Action, ConditionalPushRule, FlattenedJson, PatternedPushRule, PushConditionRoomCtx, PushRule,
Ruleset, SimplePushRule, condition,
};
use crate::{OwnedRoomId, OwnedUserId};
/// The kinds of push rules that are available.
#[d... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/pusher.rs | crates/core/src/push/pusher.rs | //! Common types for the [push notifications module][push].
//!
//! [push]: https://spec.matrix.org/latest/client-server-api/#push-notifications
//!
//! ## Understanding the types of this module
//!
//! Push rules are grouped in `RuleSet`s, and are grouped in five kinds (for
//! more details about the different kind of... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/condition/push_condition_serde.rs | crates/core/src/push/condition/push_condition_serde.rs | use serde::{Deserialize, Serialize, Serializer, de};
use super::{PushCondition, RoomMemberCountIs, RoomVersionFeature, ScalarJsonValue};
use crate::serde::{RawJsonValue, from_raw_json_value};
impl Serialize for PushCondition {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: S... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/condition/flattened_json.rs | crates/core/src/push/condition/flattened_json.rs | use std::collections::BTreeMap;
use as_variant::as_variant;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_json::{to_value as to_json_value, value::Value as JsonValue};
use thiserror::Error;
use tracing::{instrument, warn};
use crate::serde::RawJson;
/// The flattened representation of a JS... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/push/condition/room_member_count_is.rs | crates/core/src/push/condition/room_member_count_is.rs | use std::{
fmt,
ops::{Bound, RangeBounds, RangeFrom, RangeTo, RangeToInclusive},
str::FromStr,
};
use salvo::oapi::ToSchema;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
/// One of `==`, `<`, `>`, `>=` or `<=`.
///
/// Used by `RoomMemberCountIs`. Defaults to `==`.
#[derive(ToSchema, Cop... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/event_auth.rs | crates/core/src/state/event_auth.rs | use std::{
borrow::Borrow,
collections::{BTreeMap, BTreeSet, HashSet},
};
use serde_json::value::RawValue as RawJsonValue;
use tracing::{debug, info, instrument};
mod room_member;
// #[cfg(test)]
// mod tests;
use self::room_member::check_room_member;
use crate::{
OwnedEventId, OwnedUserId, UserId,
e... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/tests.rs | crates/core/src/state/tests.rs | use std::{
collections::{HashMap, HashSet},
sync::Arc,
};
use maplit::{hashmap, hashset};
use rand::seq::SliceRandom;
use crate::{
room_version_rules::{AuthorizationRules, StateResolutionV2Rules},
UnixMillis, OwnedEventId,
};
use crate::events::{
room::join_rules::{JoinRule, RoomJoinRulesEventConte... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/room_version.rs | crates/core/src/state/room_version.rs | #[derive(Debug)]
#[allow(clippy::exhaustive_enums)]
pub enum RoomDisposition {
/// A room version that has a stable specification.
Stable,
/// A room version that is not yet fully specified.
Unstable,
}
#[derive(Debug)]
pub enum EventFormatVersion {
/// $id:server event id format
V1,
/// MS... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/error.rs | crates/core/src/state/error.rs | use thiserror::Error;
use crate::OwnedEventId;
/// Result type for state resolution.
pub type StateResult<T> = std::result::Result<T, StateError>;
/// Represents the various errors that arise when resolving state.
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum StateError {
/// The given event was not found.
... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/events.rs | crates/core/src/state/events.rs | //! Helper traits and types to work with events (aka PDUs).
mod create;
mod join_rules;
pub(crate) mod member;
pub(crate) mod power_levels;
mod third_party_invite;
pub use self::{
create::RoomCreateEvent,
join_rules::RoomJoinRulesEvent,
member::RoomMemberEvent,
power_levels::{RoomPowerLevelsEvent, Roo... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/event_auth/room_member.rs | crates/core/src/state/event_auth/room_member.rs | use std::borrow::Borrow;
use tracing::debug;
// #[cfg(test)]
// mod tests;
use super::FetchStateExt;
use crate::events::{StateEventType, room::member::MembershipState};
use crate::state::{
Event, StateError, StateResult,
events::{
RoomCreateEvent, RoomMemberEvent,
member::ThirdPartyInvite,
... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/event_auth/tests.rs | crates/core/src/state/event_auth/tests.rs | use std::collections::BTreeMap;
use serde_json::{json, value::to_raw_value as to_raw_json_value};
mod room_power_levels;
use self::room_power_levels::default_room_power_levels;
use super::check_room_create;
use crate::{
ServerSignatures, UnixMillis, check_state_dependent_auth_rules,
check_state_independent_a... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/event_auth/room_member/tests.rs | crates/core/src/state/event_auth/room_member/tests.rs | use crate::events::{
TimelineEventType,
room::{
join_rules::{JoinRule, Restricted, RoomJoinRulesEventContent},
member::{MembershipState, RoomMemberEventContent, SignedContent, ThirdPartyInvite},
third_party_invite::RoomThirdPartyInviteEventContent,
},
};
use palpo_core::{
Signatu... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | true |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/event_auth/tests/room_power_levels.rs | crates/core/src/state/event_auth/tests/room_power_levels.rs | use std::{collections::HashSet, sync::Arc};
use crate::events::{TimelineEventType, room::power_levels::UserPowerLevel};
use as_variant::as_variant;
use palpo_core::room_version_rules::AuthorizationRules;
use serde_json::{
Value as JsonValue, json,
value::{Map as JsonMap, to_raw_value as to_raw_json_value},
};
... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | true |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/events/third_party_invite.rs | crates/core/src/state/events/third_party_invite.rs | //! Types to deserialize `m.room.third_party_invite` events.
use std::{collections::BTreeSet, ops::Deref};
use serde::Deserialize;
use crate::state::Event;
use crate::{serde::from_raw_json_value, third_party_invite::IdentityServerBase64PublicKey};
/// A helper type for an [`Event`] of type `m.room.third_party_invit... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/events/power_levels.rs | crates/core/src/state/events/power_levels.rs | //! Types to deserialize `m.room.power_levels` events.
use std::{
collections::{BTreeMap, HashSet},
ops::Deref,
sync::{Arc, Mutex, OnceLock},
};
use serde::de::DeserializeOwned;
use serde_json::{Error, from_value as from_json_value};
use super::Event;
use crate::events::{TimelineEventType, room::power_le... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/events/join_rules.rs | crates/core/src/state/events/join_rules.rs | //! Types to deserialize `m.room.join_rules` events.
use std::ops::Deref;
use serde::Deserialize;
use super::Event;
use crate::state::StateResult;
use crate::{room::JoinRuleKind, serde::from_raw_json_value};
/// A helper type for an [`Event`] of type `m.room.join_rules`.
///
/// This is a type that deserializes eac... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/events/member.rs | crates/core/src/state/events/member.rs | //! Types to deserialize `m.room.member` events.
use std::ops::Deref;
use serde::Deserialize;
use crate::events::room::member::MembershipState;
use crate::serde::{CanonicalJsonObject, RawJsonValue, from_raw_json_value};
use crate::state::{Event, StateResult};
use crate::{identifiers::*, signatures::canonical_json};
... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/state/events/create.rs | crates/core/src/state/events/create.rs | //! Types to deserialize `m.room.create` events.
use std::{borrow::Cow, collections::HashSet, ops::Deref};
use serde::{Deserialize, de::IgnoredAny};
use super::Event;
use crate::room_version_rules::RoomVersionRules;
use crate::{OwnedUserId, RoomVersionId, UserId, serde::from_raw_json_value, state::StateResult};
///... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/appservice/event.rs | crates/core/src/appservice/event.rs | //! Endpoint for sending events.
//! `PUT /_matrix/app/*/transactions/{txn_id}`
//!
//! Endpoint to push an event (or batch of events) to the application service.
//! `/v1/` ([spec])
//!
//! [spec]: https://spec.matrix.org/latest/application-service-api/#put_matrixappv1transactionstxnid
use std::borrow::Cow;
use reqw... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/appservice/third_party.rs | crates/core/src/appservice/third_party.rs | //! Endpoints for third party lookups
// `GET /_matrix/app/*/thirdparty/location/{protocol}`
//
// Retrieve a list of Matrix portal rooms that lead to the matched third party
// location. `/v1/` ([spec])
//
// [spec]: https://spec.matrix.org/latest/application-service-api/#get_matrixappv1thirdpartylocationprotocol
use... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/appservice/ping.rs | crates/core/src/appservice/ping.rs | //! Endpoint for pinging the application service.
//! `PUT /_matrix/app/*/ping`
//!
//! Endpoint to ping the application service.
//! `/v1/` ([spec])
//!
//! [spec]: https://spec.matrix.org/latest/application-service-api/#post_matrixappv1ping
use std::time::Duration;
use salvo::oapi::ToSchema;
use serde::{Deserialize... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/appservice/query.rs | crates/core/src/appservice/query.rs | /// Endpoints for querying user IDs and room aliases
///
/// `GET /_matrix/app/*/rooms/{roomAlias}`
///
/// Endpoint to query the existence of a given room alias.
/// `/v1/` ([spec])
///
/// [spec]: https://spec.matrix.org/latest/application-service-api/#get_matrixappv1roomsroomalias
use salvo::oapi::ToParameters;
use ... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/appservice/tests/appservice_registration.rs | crates/core/src/appservice/tests/appservice_registration.rs | use assert_matches2::assert_matches;
use palpo_appservice_api::Registration;
#[test]
fn registration_deserialization() {
let registration_config = r##"
id: "IRC Bridge"
url: "http://127.0.0.1:1234"
as_token: "30c05ae90a248a4188e620216fa72e349803310ec83e2a77b34fe90be6081f46"
hs_token... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/directory/room_network_serde.rs | crates/core/src/directory/room_network_serde.rs | use std::fmt;
use serde::{
Deserialize, Deserializer, Serialize, Serializer,
de::{Error, MapAccess, Visitor},
ser::SerializeStruct,
};
use serde_json::Value as JsonValue;
use super::RoomNetwork;
impl Serialize for RoomNetwork {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
wher... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/directory/filter_room_type_serde.rs | crates/core/src/directory/filter_room_type_serde.rs | use std::borrow::Cow;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use super::RoomTypeFilter;
impl Serialize for RoomTypeFilter {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
self.as_str().serialize(serializer)
}
}
impl<'de... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/metadata/tests.rs | crates/core/src/metadata/tests.rs | use std::collections::{BTreeMap, BTreeSet};
use assert_matches2::assert_matches;
use http::Method;
use super::{
MatrixVersion::{self, V1_0, V1_1, V1_2, V1_3},
StablePathSelector, SupportedVersions, VersionHistory,
};
use crate::AuthScheme;
use crate::error::IntoHttpError;
fn stable_only_metadata(stable_paths... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/metadata/matrix_version.rs | crates/core/src/metadata/matrix_version.rs | use std::{
cmp::Ordering,
fmt::{self, Display},
str::FromStr,
};
use salvo::prelude::*;
use serde::Serialize;
use crate::RoomVersionId;
use crate::error::UnknownVersionError;
/// The Matrix versions Palpo currently understands to exist.
///
/// Matrix, since fall 2021, has a quarterly release schedule, u... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/metadata/supported_versions.rs | crates/core/src/metadata/supported_versions.rs | use std::collections::{BTreeMap, BTreeSet};
use crate::serde::StringEnum;
use crate::{MatrixVersion, PrivOwnedStr};
/// The list of Matrix versions and features supported by a homeserver.
#[derive(Debug, Clone)]
#[allow(clippy::exhaustive_structs)]
pub struct SupportedVersions {
/// The Matrix versions that are s... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/error/kind.rs | crates/core/src/error/kind.rs | //! Errors that can be sent from the homeserver.
use std::collections::BTreeMap;
use serde_json::Value as JsonValue;
use super::{ErrorCode, RetryAfter};
use crate::error::AuthenticateError;
use crate::{PrivOwnedStr, RoomVersionId};
/// An enum for the error kind.
///
/// Items may contain additional information.
#[... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/error/auth.rs | crates/core/src/error/auth.rs | //! Errors that can be sent from the homeserver.
use std::collections::BTreeMap;
use crate::PrivOwnedStr;
/// Errors in the `WWW-Authenticate` header.
///
/// To construct this use `::from_str()`. To get its serialized form, use its
/// `TryInto<http::HeaderValue>` implementation.
#[derive(Clone, Debug, PartialEq, E... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/error/kind_serde.rs | crates/core/src/error/kind_serde.rs | use std::{
borrow::Cow,
collections::btree_map::{BTreeMap, Entry},
fmt,
str::FromStr,
time::{Duration, SystemTime},
};
use serde::{
de::{self, Deserialize, Deserializer, MapAccess, Visitor},
ser::{self, Serialize, SerializeMap, Serializer},
};
use serde_json::from_value as from_json_value;
... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/signatures/tests.rs | crates/core/src/signatures/tests.rs | use std::collections::BTreeMap;
use crate::{serde::Base64, RoomVersionId, ServerSigningKeyId, SigningKeyAlgorithm};
use palpo_core::signatures::{sign_json, verify_event, Ed25519KeyPair, PublicKeyMap, Verified};
static PKCS8_ED25519_DER: &[u8] = include_bytes!("./keys/ed25519.der");
fn add_key_to_map(public_key_map: ... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/signatures/verification.rs | crates/core/src/signatures/verification.rs | //! Verification of digital signatures.
use ed25519_dalek::{Verifier as _, VerifyingKey};
use crate::SigningKeyAlgorithm;
use crate::signatures::{Error, ParseError, VerificationError};
/// A digital signature verifier.
pub(crate) trait Verifier {
/// Use a public key to verify a signature against the JSON object... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/signatures/functions.rs | crates/core/src/signatures/functions.rs | //! Functions for signing and verifying JSON and events.
use std::{
borrow::Cow,
collections::{BTreeMap, BTreeSet},
mem,
};
use base64::{Engine, alphabet};
use serde_json::to_string as to_json_string;
use sha2::{Sha256, digest::Digest};
#[cfg(test)]
mod tests;
use crate::signatures::{
Error, JsonErr... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/signatures/error.rs | crates/core/src/signatures/error.rs | use thiserror::Error;
use crate::{
EventId, OwnedEventId, RoomVersionId,
serde::{
Base64DecodeError,
canonical_json::{JsonType, RedactionError},
},
};
/// `palpo-signature`'s error type, wraps a number of other error types.
#[derive(Debug, Error)]
#[non_exhaustive]
#[allow(clippy::enum_var... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/signatures/keys.rs | crates/core/src/signatures/keys.rs | //! Public and private key pairs.
use std::{
collections::BTreeMap,
fmt::{Debug, Formatter, Result as FmtResult},
};
use ed25519_dalek::{PUBLIC_KEY_LENGTH, SecretKey, Signer, SigningKey, pkcs8::ALGORITHM_OID};
use pkcs8::{
DecodePrivateKey, EncodePrivateKey, ObjectIdentifier, PrivateKeyInfo, der::zeroize:... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/signatures/functions/tests.rs | crates/core/src/signatures/functions/tests.rs | use std::collections::BTreeMap;
use assert_matches2::assert_matches;
use serde_json::json;
use super::{
canonical_json, servers_to_check_signatures, sign_json, verify_canonical_json_bytes,
verify_event,
};
use crate::signatures::{
Ed25519KeyPair, Error, KeyPair, PublicKeyMap, PublicKeySet, VerificationErr... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/signatures/keys/compat.rs | crates/core/src/signatures/keys/compat.rs | use subslice::SubsliceExt as _;
#[derive(Debug)]
pub(super) enum CompatibleDocument<'a> {
WellFormed(&'a [u8]),
CleanedFromRing(Vec<u8>),
}
impl<'a> CompatibleDocument<'a> {
pub(super) fn from_bytes(bytes: &'a [u8]) -> Self {
if is_ring(bytes) {
Self::CleanedFromRing(fix_ring_doc(bytes... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/html/helpers.rs | crates/core/src/html/helpers.rs | //! Convenience methods and types to sanitize HTML messages.
use crate::html::{Html, HtmlSanitizerMode, SanitizerConfig};
/// Sanitize the given HTML string.
///
/// This removes the [tags and attributes] that are not listed in the Matrix specification.
///
/// It can also optionally remove the [rich reply] fallback.... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/html/sanitizer_config.rs | crates/core/src/html/sanitizer_config.rs | #![allow(clippy::disallowed_types)]
use std::collections::{HashMap, HashSet};
pub(crate) mod clean;
use crate::html::HtmlSanitizerMode;
/// Configuration to sanitize HTML elements and attributes.
#[derive(Debug, Default, Clone)]
pub struct SanitizerConfig {
/// The mode of the sanitizer, if any.
mode: Optio... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/html/matrix.rs | crates/core/src/html/matrix.rs | //! Types to work with HTML elements and attributes [suggested by the Matrix Specification][spec].
//!
//! [spec]: https://spec.matrix.org/latest/client-server-api/#mroommessage-msgtypes
use std::collections::BTreeSet;
use html5ever::{Attribute, QualName, ns, tendril::StrTendril};
use crate::html::sanitizer_config::... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/html/sanitizer_config/clean.rs | crates/core/src/html/sanitizer_config/clean.rs | use html5ever::{Attribute, LocalName, tendril::StrTendril};
use phf::{Map, Set, phf_map, phf_set};
use wildmatch::WildMatch;
use crate::html::{ElementData, Html, HtmlSanitizerMode, NodeData, NodeRef, SanitizerConfig};
/// HTML elements allowed in the Matrix specification.
static ALLOWED_ELEMENTS_STRICT: Set<&str> = p... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/room_id.rs | crates/core/src/identifiers/room_id.rs | //! Matrix room identifiers.
use diesel::expression::AsExpression;
use super::{
MatrixToUri, MatrixUri, OwnedEventId, OwnedServerName, ServerName, matrix_uri::UriAction,
};
use crate::macros::IdDst;
use crate::{IdParseError, RoomOrAliasId};
/// A Matrix [room ID].
///
/// A `RoomId` is generated randomly or conv... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/matrix_uri.rs | crates/core/src/identifiers/matrix_uri.rs | //! Matrix URIs.
use std::{fmt, str::FromStr};
use palpo_identifiers_validation::{
Error,
error::{MatrixIdError, MatrixToError, MatrixUriError},
};
use percent_encoding::{percent_decode_str, percent_encode};
use url::Url;
use super::{
EventId, OwnedEventId, OwnedRoomAliasId, OwnedRoomId, OwnedRoomOrAlias... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | true |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/user_id.rs | crates/core/src/identifiers/user_id.rs | //! Matrix user identifiers.
use std::{rc::Rc, sync::Arc};
use diesel::expression::AsExpression;
use palpo_identifiers_validation::MAX_BYTES;
pub use palpo_identifiers_validation::user_id::localpart_is_fully_conforming;
use super::{IdParseError, MatrixToUri, MatrixUri, ServerName, matrix_uri::UriAction};
use crate:... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/room_or_alias_id.rs | crates/core/src/identifiers/room_or_alias_id.rs | //! Matrix identifiers for places where a room ID or room alias ID are used
//! interchangeably.
use std::hint::unreachable_unchecked;
use crate::macros::IdDst;
use diesel::expression::AsExpression;
use super::{OwnedRoomAliasId, OwnedRoomId, RoomAliasId, RoomId, server_name::ServerName};
/// A Matrix [room ID] or a... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/one_time_key_name.rs | crates/core/src/identifiers/one_time_key_name.rs | use super::{IdParseError, KeyName};
use crate::macros::IdDst;
/// The name of a [one-time or fallback key].
///
/// One-time and fallback key names in Matrix are completely opaque character sequences. This
/// type is provided simply for its semantic value.
///
/// [one-time or fallback key]: https://spec.matrix.org/l... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/server_name.rs | crates/core/src/identifiers/server_name.rs | //! Matrix-spec compliant server names.
use std::net::Ipv4Addr;
use diesel::expression::AsExpression;
use crate::macros::IdDst;
/// A Matrix-spec compliant [server name].
///
/// It consists of a host and an optional port (separated by a colon if
/// present).
///
/// [server name]: https://spec.matrix.org/latest/a... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/base64_public_key.rs | crates/core/src/identifiers/base64_public_key.rs | use super::{IdParseError, KeyName};
use crate::macros::IdDst;
use crate::serde::{Base64, Base64DecodeError, base64::Standard};
/// A public key encoded using unpadded base64, used as an identifier for [cross-signing] keys.
///
/// This string is validated using the set `[a-zA-Z0-9+/=]`, but it is not validated to be d... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/voip_version_id.rs | crates/core/src/identifiers/voip_version_id.rs | //! Matrix VoIP version identifier.
use std::fmt;
use crate::macros::DisplayAsRefStr;
use salvo::oapi::ToSchema;
use serde::{
Deserialize, Deserializer, Serialize,
de::{self, Visitor},
};
use crate::{IdParseError, PrivOwnedStr};
/// A Matrix VoIP version ID.
///
/// A `VoipVersionId` representing VoIP versi... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/signatures.rs | crates/core/src/identifiers/signatures.rs | use std::{
borrow::Borrow,
collections::BTreeMap,
ops::{Deref, DerefMut},
};
use salvo::oapi::ToSchema;
use serde::{Deserialize, Serialize};
use super::{
Base64PublicKeyOrDeviceId, DeviceId, KeyName, OwnedServerName, OwnedSigningKeyId, OwnedUserId,
ServerSigningKeyVersion,
};
/// Map of key ident... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/session_id.rs | crates/core/src/identifiers/session_id.rs | //! Matrix session ID.
use crate::macros::IdDst;
use diesel::expression::AsExpression;
use super::IdParseError;
/// A session ID.
///
/// Session IDs in Matrix are opaque character sequences of `[0-9a-zA-Z.=_-]`.
/// Their length must must not exceed 255 characters.
#[repr(transparent)]
#[derive(PartialEq, Eq, Parti... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/server_signing_key_version.rs | crates/core/src/identifiers/server_signing_key_version.rs | use crate::macros::IdDst;
use crate::{IdParseError, KeyName};
/// The version of a [homeserver signing key].
///
/// This is an opaque character sequences of `[a-zA-Z0-9_]`. This type is
/// provided simply for its semantic value.
///
/// With the `compat-server-signing-key-version` cargo feature, the validation
/// o... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/room_alias_id.rs | crates/core/src/identifiers/room_alias_id.rs | //! Matrix room alias identifiers.
use crate::macros::IdDst;
use diesel::expression::AsExpression;
use super::{MatrixToUri, MatrixUri, OwnedEventId, matrix_uri::UriAction, server_name::ServerName};
/// A Matrix [room alias ID].
///
/// A `RoomAliasId` is converted from a string slice, and can be converted back
/// i... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/space_child_order.rs | crates/core/src/identifiers/space_child_order.rs | //! `m.space.child` order.
use crate::macros::IdDst;
/// The order of an [`m.space.child`] event.
///
/// Space child orders in Matrix are opaque character sequences consisting of ASCII characters
/// within the range `\x20` (space) and `\x7E` (~), inclusive. Their length must must not exceed 50
/// characters.
///
/... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/client_secret.rs | crates/core/src/identifiers/client_secret.rs | //! Client secret identifier.
use crate::macros::IdDst;
/// A client secret.
///
/// Client secrets in Matrix are opaque character sequences of
/// `[0-9a-zA-Z.=_-]`. Their length must must not exceed 255 characters.
///
/// You can create one from a string (using `ClientSecret::parse()`) but the
/// recommended way ... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/transaction_id.rs | crates/core/src/identifiers/transaction_id.rs | use crate::macros::IdDst;
use diesel::expression::AsExpression;
/// A Matrix transaction ID.
///
/// Transaction IDs in Matrix are opaque strings. This type is provided simply
/// for its semantic value.
///
/// You can create one from a string (using `.into()`) but the recommended way
/// is to use `TransactionId::ne... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/event_id.rs | crates/core/src/identifiers/event_id.rs | //! Matrix event identifiers.
use diesel::expression::AsExpression;
use super::ServerName;
use crate::macros::IdDst;
/// A Matrix [event ID].
///
/// An `EventId` is generated randomly or converted from a string slice, and can
/// be converted back into a string as needed.
///
/// # Room versions
///
/// Matrix spec... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/device_id.rs | crates/core/src/identifiers/device_id.rs | use diesel::expression::AsExpression;
use super::generate_localpart;
use crate::macros::IdDst;
use crate::{IdParseError, KeyName};
/// A Matrix key ID.
///
/// Device identifiers in Matrix are completely opaque character sequences. This
/// type is provided simply for its semantic value.
///
/// # Example
///
/// ```... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/crypto_algorithms.rs | crates/core/src/identifiers/crypto_algorithms.rs | //! Key algorithms used in Matrix spec.
use crate::macros::StringEnum;
use salvo::prelude::*;
use crate::PrivOwnedStr;
/// The basic key algorithms in the specification.
#[derive(ToSchema, Clone, StringEnum)]
#[non_exhaustive]
#[palpo_enum(rename_all = "snake_case")]
pub enum DeviceKeyAlgorithm {
/// The Ed25519... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/key_id.rs | crates/core/src/identifiers/key_id.rs | use std::{
cmp::Ordering,
hash::{Hash, Hasher},
marker::PhantomData,
};
use super::{
Base64PublicKey, Base64PublicKeyOrDeviceId, DeviceId, DeviceKeyAlgorithm, KeyName,
OneTimeKeyAlgorithm, OneTimeKeyName, ServerSigningKeyVersion,
crypto_algorithms::SigningKeyAlgorithm,
};
use crate::macros::IdD... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/voip_id.rs | crates/core/src/identifiers/voip_id.rs | //! VoIP identifier.
use crate::macros::IdDst;
use diesel::expression::AsExpression;
/// A VoIP identifier.
///
/// VoIP IDs in Matrix are opaque strings. This type is provided simply for its
/// semantic value.
///
/// You can create one from a string (using `VoipId::parse()`) but the
/// recommended way is to use `... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/base64_public_key_or_device_id.rs | crates/core/src/identifiers/base64_public_key_or_device_id.rs | use palpo_core_macros::IdDst;
use super::{
Base64PublicKey, DeviceId, IdParseError, KeyName, OwnedBase64PublicKey, OwnedDeviceId,
};
/// A Matrix ID that can be either a [`DeviceId`] or a [`Base64PublicKey`].
///
/// Device identifiers in Matrix are completely opaque character sequences and cross-signing keys
///... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/room_version_id.rs | crates/core/src/identifiers/room_version_id.rs | //! Matrix room version identifiers.
use std::{cmp::Ordering, str::FromStr};
use salvo::oapi::{Components, RefOr, Schema, ToSchema};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use super::IdParseError;
use crate::macros::DisplayAsRefStr;
use crate::room_version_rules::RoomVersionRules;
/// A Matr... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/identifiers/mxc_uri.rs | crates/core/src/identifiers/mxc_uri.rs | //! A URI that should be a Matrix-spec compliant [MXC URI].
//!
//! [MXC URI]: https://spec.matrix.org/latest/client-server-api/#matrix-content-mxc-uris
use std::{fmt, num::NonZeroU8};
use crate::macros::IdDst;
use palpo_identifiers_validation::{error::MxcUriError, mxc_uri::validate};
use serde::{Serialize, Serialize... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/serde/json_string.rs | crates/core/src/serde/json_string.rs | //! De-/serialization functions to and from json strings, allows the type to be
//! used as a query string.
use serde::{
de::{DeserializeOwned, Deserializer, Error as _},
ser::{Error as _, Serialize, Serializer},
};
/// Serialize the given value as a JSON string.
pub fn serialize<T, S>(value: T, serializer: S... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/serde/test.rs | crates/core/src/serde/test.rs | //! Helpers for tests
use std::fmt::Debug;
use serde::{Serialize, de::DeserializeOwned};
/// Assert that serialization of `de` results in `se` and deserialization of
/// `se` results in `de`.
pub fn serde_json_eq<T>(de: T, se: serde_json::Value)
where
T: Clone + Debug + PartialEq + Serialize + DeserializeOwned,
... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/serde/raw_json.rs | crates/core/src/serde/raw_json.rs | use std::{
clone::Clone,
fmt::{self, Debug},
marker::PhantomData,
mem,
};
use salvo::{
oapi::{Components, RefOr, Schema},
prelude::*,
};
use serde::{
de::{self, Deserialize, DeserializeSeed, Deserializer, IgnoredAny, MapAccess, Visitor},
ser::{Serialize, Serializer},
};
use serde_json::... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
palpo-im/palpo | https://github.com/palpo-im/palpo/blob/066b5b15ce094d4e9f6d28484cbc9cb8bd913e67/crates/core/src/serde/single_element_seq.rs | crates/core/src/serde/single_element_seq.rs | //! De-/serialization functions to and from single element sequences.
use serde::{
de::{Deserialize, Deserializer},
ser::{Serialize, Serializer},
};
/// Serialize the given value as a list of just that value.
pub fn serialize<T, S>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
where
T: Serialize,
... | rust | Apache-2.0 | 066b5b15ce094d4e9f6d28484cbc9cb8bd913e67 | 2026-01-04T20:22:21.242775Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.