Update Rust crate ruma-common to 0.17.0 #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.13.0->0.17.0Release Notes
ruma/ruma (ruma-common)
v0.17.0: ruma-common 0.17.0Compare Source
Breaking changes:
PartialOrdAsRefStrderive macro intoOrdAsRefStr, so both traits are always implemented using the same logic.PartialEqAsRefStrderive macro toEqAsRefStrand make it implement bothPartialEqandEq.StringEnumderive macro also implementsOrd,PartialOrd,EqandPartialEqusing theAsRef<str>implementation of the enum.PatternedPushRule::contains_user_name(),ConditionalPushRule::contains_display_name()andConditionalPushRule::roomnotif()were removed, according to MSC4210. Their rule IDs are still available inPredefinedContentRuleIdandPredefinedOverrideRuleId, and they are still supported inPatternedPushRule::applies_to()andConditionalPushRule::applies(), for backwards-compatibility for clients.rumaandruma-eventscrate from thematrix-sdk-appservicecrate. This crate was dropped 2 years ago.Metadatawas changed from astructto atrait. It is a supertrait ofOutgoingRequestandIncomingRequest, and its fields are now associated types or constants.authenticationfield of theMetadatastruct is now an associated type namedAuthentication. TheAuthSchemeenum was changed from anenumto atrait. Its variants are now structs implementing theAuthSchemetrait. TheNonevariant was renamed toNoAuthenticationand theServerSignaturesvariant was moved to ruma-federation-api. Theaccess_tokenargument ofOutgoingRequest::try_into_http_request()is renamed toauthentication_inputand is generic over theInputassociated type of theAuthSchemetrait.historyfield of theMetadatastruct is now an associated constant namedPATH_BUILDER. The type of this constant is defined by thePathBuilderassociated type, which must implement thePathBuildertrait. Theconsideringargument ofOutgoingRequest::try_into_http_request()is renamed topath_builder_inputand is generic over theInputassociated type of thePathBuildertrait. TheInputofVersionHistorywas changed from&'_ SupportedVersionstoCow<'_, SupportedVersions>.Metadatastruct are now associated constants with the same name converted to uppercase.metadata!macro generates theMetadatatrait implementation for a type namedRequestby default. This type can be changed with an@forsetting.http_headersmodule is now behind theapicargo feature.OutgoingRequestAppserviceExt::try_into_http_request_with_user_id()is renamed totry_into_http_request_with_identity()and takes anAppserviceUserIdentityinstead of aUserId. This allows to specify a device ID, according to MSC4326.IntoHttpError::NeedsAuthenticationis a newtype variant renamed toAuthenticationthat accepts any error type.StringEnum,AsRefStrandFromStringderive macros'rename_allattribute, because they either can be replaced by the(prefix = "prefix", rule = "rule")syntax or are unused as far as we know:"PascalCase""SCREAMING-KEBAB-CASE""m.dotted.case""M_MATRIX_ERROR_CASE""m.lowercase""m.snake_case"".m.rule.snake_case""m.role.snake_case"Bug fixes:
requestandresponseattribute macros, theContent-Typeheader defaults toapplication/octet-streaminstead ofapplication/jsonif theraw_bodyattribute is set on a field.VersionHistorycontain the same number of variables. It was broken since the syntax was changed from:variableto{variable}.Improvements:
org.matrix.msc4380unstable feature support to/versions.MatrixVersion::V1_16org.matrix.hydra.11room version and the correspondingunstable-hydracargo feature. It should only have been used for development, and room version 12 should be used instead.Metadata::make_endpoint_url()is also available asVersionHistory::make_endpoint_url().PushCondition::ContainsDisplayNameis deprecated, according to MSC4210.SinglePathas aPathBuilder. It should be used for APIs that don't have a/versionsendpoint and for endpoints that can't be versioned.AuthSchemedata can be extracted from incoming HTTP requests withAuthScheme::extract_authentication().StringEnum,AsRefStrandFromStringderive macros allow to set a custom prefix alongside the rule to rename all the variants, like this:#[ruma_enum(rename_all(prefix = "m.", rule = "snake_case"))]. The previous syntax using#[ruma_enum(rename_all = "snake_case")]still works and assumes that the prefix is empty.v0.16.0: ruma-common 0.16.0Compare Source
Breaking changes:
PushCondition::applies,ConditionalPushRule::applies,AnyPushRuleRef::applies,AnyPushRule::applies,Ruleset::applies,Ruleset::get_actions,Ruleset::get_matchall became async, to allow for lazy evaluation of push rules.UserIdparsing and deserialization are now compatible with all non-compliant user IDs in the wild by default, due to a clarification in the spec.compat-user-idcargo feature was removed.UserId::validate_historical()andUserId::validate_strict()allow to check for spec compliance.(owned_)user_id!macros always validate against the strict grammar in the spec, regardless of the compat features that are enabled.(owned_)room_id!macros disallow theNULbyte, due to a clarification in the spec.(owned_)room_alias_id!macros disallow theNULbyte for the localpart, due to a clarification in the spec.MatrixVersiondoes not implementDisplayanymore as it is not correct to convertV1_0to a string. InsteadMatrixVersion::as_str()can be used that only returnsNonefor that same variant.MatrixVersion::(into/from)_partsare no longer exposed as public methods. They were usually used to sortMatrixVersions, now thePartialOrdandOrdimplementations can be used instead.ProtocolandProtocolInitare generic on the protocol instance type.AppserviceTokentoAppserviceTokenOptional, with the new variant takingAppserviceToken's place.redact*functions incanonical_jsontakeRedactionRulesinstead ofRoomVersionId. This avoids undefined behavior for unknown room versions.OutgoingRequest::try_into_http_request(),OutgoingRequestAppserviceExt::try_into_http_request_with_user_id()andMetadata::make_endpoint_url()take aSupportedVersionsinstead of a&[MatrixVersion].metadatamacro allows to specify stable and unstable feature flags for the paths inhistory.VersionHistory::new()takes a&'static [(Option<&'static str>, &'static str)]for the unstable paths and a&'static [(StablePathSelector, &'static str)]for the stable paths.VersionHistory::unstable_paths()returns animpl Iterator<Item = (Option<&'static str>, &'static str)>.VersionHistory::stable_paths()returns animpl Iterator<Item = (StablePathSelector, &'static str)>.VersionHistory::stable_endpoint_for()was renamed toversion_path().VersioningDecision'sStablevariant was renamed toVersionandUnstablewas renamed toFeature.metadatamacro has changed: the variable must now be surrounded by{}instead of being preceded by:. For example/_matrix/client/foo/{bar}. This matches the OpenAPI syntax and the new syntax supported by axum 0.8.JoinRuleand its associated types where imported fromruma-eventsinto theroommodule.space::SpaceRoomJoinRulewas removed and replaced byroom::JoinRuleSummary.directory::PublicRoomJoinRulewas moved and renamed toroom::JoinRuleKind.JoinRule::kind()andJoinRuleSummary::kind().PushConditionRoomCtxandPushConditionPowerLevelsCtxnon-exhaustive.versionsfield ofSupportedVersionsis now aBTreeSet<MatrixVersion>, to make sure that the versions are always deduplicated and sorted.NotificationPowerLevelsnow takes aNotificationPowerLevelsKeyfor thekey, an enum that accepts any string.keyfield ofPushCondition::SenderNotificationPermissionuses the same type.RoomId::new()was renamed toRoomId::new_v1(), as several formats are now supported for this type.StateResolutionVersion::V2now takesStateResolutionV2Rulesas a unit field, to specify tweaks to be used when resolving state with version 2 of the state resolution algorithm.StateResolutionVersion::v2_rules, returningNoneifstate_resis notStateResolutionVersion::V2.StateResolutionV2Ruleshas the following fields:begin_iterative_auth_checks_with_empty_state_map, to determine whether to begin the first phase of iterative auth checks with an empty state map.consider_conflicted_state_subgraph, to determine whether to include the conflicted state subgraph in the full conflicted state.Bug fix:
dispositionofRoomVersionRules::MSC2870as unstable.Improvements:
Zeroizetrait for theBase64type.ProtocolInstancehas aninstance_idfield, due to a clarification in the spec.unstable-unspecifiedcargo feature was removed.AnyKeyNameas a helper type to useKeyIdAPIs without validating the key name.IdentityServerBase64PublicKeyas a helper type to decode identity server public keys encoded using standard or URL-safe base64.RoomVersionwas imported from ruma-state-res and renamed toRoomVersionRules, along with the following changes:RoomVersionRules::new()was removed and replaced byRoomVersionId::rules().RoomDispositionenum was renamed toRoomVersionDisposition.event_formatfield was renamed toevent_id_formatand theEventFormatenum was renamed toEventIdFormat.AuthorizationRulesstruct, which is available in theauthorizationfield ofRoomVersionRules.special_case_aliases_authfield was renamed tospecial_case_room_aliases.strict_canonicaljsonfield was renamed tostrict_canonical_json.extra_redaction_checksfield was renamed tospecial_case_room_redaction.allow_knockingfield was renamed toknocking.restricted_join_rulesfield was renamed torestricted_join_rule.RedactionRuleswas added under theredactionfield.SignaturesRuleswas added under thesignaturesfield.RoomVersionIdhas anMSC2870variant for theorg.matrix.msc2870room version defined in MSC2870.OutgoingRequest::is_supported()andVersionHistory::is_supported()to be able to know if a server advertises support for an endpoint.ID_MAX_BYTESfromruma-identifiers-validation.From<PublicRoomsChunk>forRoomSummary.content_field_redactsfield toRedactionRules, which is used to determine whether thecontentor top-levelredactsfield should be used to determine what event anm.room.redactionevent redacts.SpaceChildOrderwhich allows to validate theorderof anm.space.childevent.org.matrix.hydra.11.explicitly_privilege_room_creatorsandadditional_room_creatorstoAuthorizationRulesto indicate whether room creators are considered to have "infinite" power level and whether additional room creators can be specified with thecontent.additional_creatorsfield of anm.room.createevent respectively.RoomPowerLevelsRules, to provide tweaks to how the power level of a user is determined, and add it toPushConditionPowerLevelsCtxvia therulesfield.room_id_formattoRoomVersionRules, to identify the format to use for room IDs depending on the room version.RoomId::new_v2()for the new format of room IDs.RoomId::strip_sigil()allows to access the reference hash used in that format.unstable-msc3768feature.room_create_event_id_as_room_idtoAuthorizationRulesto indicate whether the reference hash of them.room.createevent is used to construct the room ID. It has other implications, like them.room.createevent not having a room ID, and them.room.createevent not listed in theauth_eventsof a PDU.require_room_create_room_idandallow_room_create_in_auth_eventstoEventFormatRulesto indicate whether the room ID is required form.room.createevents and whether the event ID of them.room.createis allowed in theauth_events, respectively.v0.15.4: ruma-common 0.15.4Compare Source
Bug fix:
serde::default_on_errordeserialization helper. It was working withserde_json::from_valuebut not other functions likeserde_json::from_(str/slice). It now works with all 3 methods but is limited to deserializing JSON.v0.15.3: ruma-common 0.15.3Compare Source
Improvements:
RoomSummarythat represents the summary of a room's state.From<RoomSummary>forPublicRoomsChunkMatrixVersion::V1_15.PublicRoomJoinRulenow includes all possible join rule kinds, due to a clarification in Matrix 1.15.serde::default_on_error()as a helper to ignore errors during deserialization.PublicRoomJoinRuleandSpaceRoomJoinRule.FeatureFlagas an enum whose variants are the flags of features supported by Ruma.SupportedVersions, a type to parse/versionsresponses to get lists of supported versions and features.v0.15.2: ruma-common 0.15.2Compare Source
Bug fixes:
MatrixVersion::V1_0now also matches Identity Service API versions r0.2.0 to r0.3.0.RUMA_UNSTABLE_EXHAUSTIVE_TYPESenvironment variableImprovements:
MatrixVersionimplementsPartialOrdandOrd. The variants are ordered by release date, with a newer version being greater than an older version.SignaturesimplementsIntoIteratorPartialEqAsRefStr,Eq,PartialOrdAsRefStr,OrdAsRefStrforruma_common::media::Method.DeviceId::new()generates a string with 10 chars instead of 8.ignore_invalid_vec_items, to assist deserialization ofVecs, where invalid items should be ignored.MatrixVersion::V1_14.v0.15.1: ruma-common 0.15.1Compare Source
Improvements:
MatrixVersion::V1_13.v0.15.0: ruma-common 0.15.0Compare Source
Breaking changes:
#[serde(flatten)]on the only body field of a#[request]or#[response]struct is disallowed.#[ruma_api(body)]must be used instead.Improvements:
ruma_identifiers_storagecompile-timecfgsetting can also be configured by setting theRUMA_IDENTIFIERS_STORAGEenvironment variable at compile time. It has the benefit of not requiring to re-compile all the crates of the dependency chain when the value is changed.unstable-exhaustive-typescargo feature was replaced by theruma_unstable_exhaustive_typescompile-timecfgsetting. Like allcfgsettings, it can be enabled at compile-time with theRUSTFLAGSenvironment variable, or inside.cargo/config.toml. It can also be enabled by setting theRUMA_UNSTABLE_EXHAUSTIVE_TYPESenvironment variable.HttpPusherDataallows to set custom data for the pusher in thedatafield, due to a clarification in the spec.default_payloadfield that was behind theunstable-unspecifiedwas removed. It can be added manually to the custom data.v0.14.1: ruma-common 0.14.1Compare Source
Bug fixes:
KeyId::key_namemethod now returns the key name. In 0.14.0,key_namemistakenly returned the algorithm.v0.14.0: ruma 0.14.0Compare Source
Please refer to the changelogs of:
Configuration
📅 Schedule: Branch creation - "after 8pm,before 6am" in timezone America/Los_Angeles, Automerge - "after 8pm,before 6am" in timezone America/Los_Angeles.
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.