mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-07-15 03:59:18 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ac05838dd | |||
| 7ecd2aa5e2 | |||
| 69a3145983 | |||
| 73b7553b1e | |||
| 232ec3f620 | |||
| e52bbeaf94 | |||
| ad1c194fb0 |
@@ -71,7 +71,7 @@ runs:
|
|||||||
|
|
||||||
- name: Install timelord-cli and git-warp-time
|
- name: Install timelord-cli and git-warp-time
|
||||||
if: steps.check-binaries.outputs.need-install == 'true'
|
if: steps.check-binaries.outputs.need-install == 'true'
|
||||||
uses: https://github.com/taiki-e/install-action@50414676f9f5d50a65992c6dd2ed02641263226c # v2
|
uses: https://github.com/taiki-e/install-action@43aecc8d72668fbcfe75c31400bc4f890f1c5853 # v2
|
||||||
with:
|
with:
|
||||||
tool: git-warp-time,timelord-cli@3.0.1
|
tool: git-warp-time,timelord-cli@3.0.1
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
path: binaries
|
path: binaries
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: Create Release and Upload
|
- name: Create Release and Upload
|
||||||
uses: https://github.com/softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3
|
uses: https://github.com/softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: binaries/*
|
files: binaries/*
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
if: steps.runner-env.outputs.node_major == '' || steps.runner-env.outputs.node_major < '20'
|
if: steps.runner-env.outputs.node_major == '' || steps.runner-env.outputs.node_major < '20'
|
||||||
uses: https://github.com/actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
uses: https://github.com/actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 📦 Setup Node.js
|
- name: 📦 Setup Node.js
|
||||||
uses: https://github.com/actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
uses: https://github.com/actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
||||||
with:
|
with:
|
||||||
node-version: "22"
|
node-version: "22"
|
||||||
|
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ jobs:
|
|||||||
path: binaries
|
path: binaries
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: Create Release and Upload
|
- name: Create Release and Upload
|
||||||
uses: https://github.com/softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3
|
uses: https://github.com/softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
files: binaries/*
|
files: binaries/*
|
||||||
|
|||||||
+2
-2
@@ -26,7 +26,7 @@ ### Pre-commit Checks
|
|||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install prek using cargo-binstall
|
# Install prek using cargo-binstall https://github.com/cargo-bins/cargo-binstall
|
||||||
cargo binstall prek
|
cargo binstall prek
|
||||||
|
|
||||||
# Install git hooks to run checks automatically
|
# Install git hooks to run checks automatically
|
||||||
@@ -155,7 +155,7 @@ ### Creating pull requests
|
|||||||
|
|
||||||
Before submitting a pull request, please ensure:
|
Before submitting a pull request, please ensure:
|
||||||
1. Your code passes all CI checks (formatting, linting, typo detection, etc.)
|
1. Your code passes all CI checks (formatting, linting, typo detection, etc.)
|
||||||
2. Your code follows the [code style guide](/development/code_style.md)
|
2. Your code follows the [code style guide](docs/development/code_style.mdx)
|
||||||
3. Your commit messages follow the conventional commits format
|
3. Your commit messages follow the conventional commits format
|
||||||
4. Tests are added for new functionality
|
4. Tests are added for new functionality
|
||||||
5. Documentation is updated if needed
|
5. Documentation is updated if needed
|
||||||
|
|||||||
Generated
+4
-4
@@ -2443,9 +2443,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http-body-util"
|
name = "http-body-util"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
|
checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
@@ -4849,9 +4849,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls"
|
name = "rustls"
|
||||||
version = "0.23.41"
|
version = "0.23.42"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f"
|
checksum = "3c54fcab019b409d04215d3a17cb438fd7fbf192ee61461f20f4fe18704bc138"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aws-lc-rs",
|
"aws-lc-rs",
|
||||||
"log",
|
"log",
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Fix status code for oauth registration. Contributed by @n00byking
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Exempt m.room.create from auth_events check. Contributed by @eleboucher
|
||||||
@@ -24,5 +24,5 @@ pub(crate) async fn register_client_route(
|
|||||||
.await
|
.await
|
||||||
.map_err(|err| (StatusCode::BAD_REQUEST, Json(err)).into_response())?;
|
.map_err(|err| (StatusCode::BAD_REQUEST, Json(err)).into_response())?;
|
||||||
|
|
||||||
Ok(Json(RegisteredClient { client_id, metadata }).into_response())
|
Ok((StatusCode::CREATED, Json(RegisteredClient { client_id, metadata })).into_response())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
};
|
};
|
||||||
use futures::future::ready;
|
use futures::future::ready;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
CanonicalJsonObject, EventId, OwnedEventId, ServerName, api::error::ErrorKind,
|
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, ServerName,
|
||||||
canonical_json::redact, events::StateEventType, room_version_rules::RoomVersionRules,
|
api::error::ErrorKind, canonical_json::redact, events::StateEventType,
|
||||||
|
room_version_rules::RoomVersionRules,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::rooms::{
|
use crate::rooms::{
|
||||||
@@ -42,11 +43,27 @@ pub fn pdu_format_check_1(
|
|||||||
return Err!(Request(BadJson("PDU has too many auth events")));
|
return Err!(Request(BadJson("PDU has too many auth events")));
|
||||||
}
|
}
|
||||||
|
|
||||||
let create_event_in_auth_events = auth_events.iter().any(|id| id == create_event_id);
|
// The m.room.create event is the genesis event and has empty auth_events
|
||||||
if !event_format.allow_room_create_in_auth_events && create_event_in_auth_events {
|
// by definition, so it is exempt from the checks below requiring or
|
||||||
return Err!(Request(BadJson("PDU references a create event")));
|
// forbidding the create event in auth_events (it cannot reference itself).
|
||||||
} else if event_format.allow_room_create_in_auth_events && !create_event_in_auth_events {
|
let Some(event_type) = pdu_json.get("type").and_then(CanonicalJsonValue::as_str) else {
|
||||||
return Err!(Request(BadJson("PDU does not reference the room create event")));
|
return Err!(Request(BadJson("PDU is missing a type")));
|
||||||
|
};
|
||||||
|
let state_key = pdu_json
|
||||||
|
.get("state_key")
|
||||||
|
.and_then(CanonicalJsonValue::as_str);
|
||||||
|
|
||||||
|
let is_create_event = event_type == "m.room.create" && state_key == Some("");
|
||||||
|
|
||||||
|
if !is_create_event {
|
||||||
|
let create_event_in_auth_events = auth_events.iter().any(|id| id == create_event_id);
|
||||||
|
if !event_format.allow_room_create_in_auth_events && create_event_in_auth_events {
|
||||||
|
return Err!(Request(BadJson("PDU references a create event")));
|
||||||
|
} else if event_format.allow_room_create_in_auth_events
|
||||||
|
&& !create_event_in_auth_events
|
||||||
|
{
|
||||||
|
return Err!(Request(BadJson("PDU does not reference the room create event")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let prev_events = expect_event_id_array(pdu_json, "prev_events")?;
|
let prev_events = expect_event_id_array(pdu_json, "prev_events")?;
|
||||||
|
|||||||
Reference in New Issue
Block a user