Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(merge progress on syn2mas tool into main branch) #3895

Merged
merged 6 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ mas-tasks = { path = "./crates/tasks/", version = "=0.13.0-rc.1" }
mas-templates = { path = "./crates/templates/", version = "=0.13.0-rc.1" }
mas-tower = { path = "./crates/tower/", version = "=0.13.0-rc.1" }
oauth2-types = { path = "./crates/oauth2-types/", version = "=0.13.0-rc.1" }
syn2mas = { path = "./crates/syn2mas", version = "=0.13.0-rc.1" }

# OpenAPI schema generation and validation
[workspace.dependencies.aide]
Expand All @@ -65,6 +66,9 @@ features = ["axum", "axum-headers", "macros"]
version = "7.0.14"
features = ["chrono", "url", "tracing"]

[workspace.dependencies.async-stream]
version = "0.3.6"

# Utility to write and implement async traits
[workspace.dependencies.async-trait]
version = "0.1.85"
Expand Down Expand Up @@ -94,6 +98,10 @@ version = "1.9.0"
[workspace.dependencies.camino]
version = "1.1.9"

# Memory optimisation for short strings
[workspace.dependencies.compact_str]
version = "0.8.0"

# Time utilities
[workspace.dependencies.chrono]
version = "0.4.39"
Expand Down Expand Up @@ -312,11 +320,17 @@ features = [
[workspace.dependencies.thiserror]
version = "2.0.11"

[workspace.dependencies.thiserror-ext]
version = "0.2.0"

# Async runtime
[workspace.dependencies.tokio]
version = "1.43.0"
features = ["full"]

[workspace.dependencies.tokio-stream]
version = "0.1.16"

# Useful async utilities
[workspace.dependencies.tokio-util]
version = "0.7.13"
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
doc-valid-idents = ["OpenID", "OAuth", "..", "PostgreSQL"]
doc-valid-idents = ["OpenID", "OAuth", "..", "PostgreSQL", "SQLite"]

disallowed-methods = [
{ path = "rand::thread_rng", reason = "do not create rngs on the fly, pass them as parameters" },
Expand Down
4 changes: 4 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ serde_yaml = "0.9.34"
sqlx.workspace = true
tokio.workspace = true
tokio-util.workspace = true
tokio-stream.workspace = true
tower.workspace = true
tower-http.workspace = true
url.workspace = true
Expand Down Expand Up @@ -78,6 +79,9 @@ mas-tasks.workspace = true
mas-templates.workspace = true
mas-tower.workspace = true

oauth2-types.workspace = true
syn2mas.workspace = true

[build-dependencies]
anyhow.workspace = true
vergen-gitcl = { version = "1.0.5", features = ["rustc"] }
Expand Down
7 changes: 7 additions & 0 deletions crates/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ mod debug;
mod doctor;
mod manage;
mod server;
mod syn2mas;
mod templates;
mod worker;

Expand Down Expand Up @@ -48,6 +49,11 @@ enum Subcommand {

/// Run diagnostics on the deployment
Doctor(self::doctor::Options),

/// Migrate from Synapse's built-in auth system to MAS.
#[clap(name = "syn2mas")]
// Box<> is to work around a 'large size difference between variants' lint
Syn2Mas(Box<self::syn2mas::Options>),
}

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -75,6 +81,7 @@ impl Options {
Some(S::Templates(c)) => Box::pin(c.run(figment)).await,
Some(S::Debug(c)) => Box::pin(c.run(figment)).await,
Some(S::Doctor(c)) => Box::pin(c.run(figment)).await,
Some(S::Syn2Mas(c)) => Box::pin(c.run(figment)).await,
None => Box::pin(self::server::Options::default().run(figment)).await,
}
}
Expand Down
Loading
Loading