Compare commits

...

2 Commits

Author SHA1 Message Date
claude[bot]
22c495e139 feat: refactor EE file structure to use OSS proxy pattern
- Create OSS proxy files for all *_ee.rs files
- Update lib.rs to use OSS modules instead of EE modules directly
- Follow the established pattern from agent_workers_oss.rs

This refactoring allows the codebase to use a consistent proxy pattern where
OSS files act as proxies to the EE implementations, improving code organization
and maintainability.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: diegoimbert <diegoimbert@users.noreply.github.com>
2025-05-28 15:43:22 +00:00
Diego Imbert
ee1c7c300c agent_workers_oss proxy file 2025-05-28 17:38:44 +02:00
35 changed files with 756 additions and 32 deletions

View File

@@ -0,0 +1,31 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use crate::db::DB;
use axum::Router;
use serde::{Deserialize, Serialize};
pub fn global_service() -> Router {
crate::agent_workers_ee::global_service()
}
pub fn workspaced_service(
db: DB,
_base_internal_url: String,
) -> (
Router,
Vec<tokio::task::JoinHandle<()>>,
Option<windmill_worker::JobCompletedSender>,
) {
crate::agent_workers_ee::workspaced_service(db, _base_internal_url)
}
pub use crate::agent_workers_ee::AgentAuth;
pub use crate::agent_workers_ee::AgentCache;

View File

@@ -0,0 +1,13 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
pub fn global_unauthed_service() -> Router {
crate::apps_ee::global_unauthed_service()
}

View File

@@ -0,0 +1,61 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
use crate::db::DB;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use windmill_common::jobs::QueuedJob;
pub fn workspaced_service() -> Router {
crate::gcp_triggers_ee::workspaced_service()
}
pub fn start_consuming_gcp_pubsub_event(
db: DB,
killpill_rx: tokio::sync::broadcast::Receiver<()>,
) {
crate::gcp_triggers_ee::start_consuming_gcp_pubsub_event(db, killpill_rx)
}
pub fn gcp_push_route_handler() -> Router {
crate::gcp_triggers_ee::gcp_push_route_handler()
}
pub async fn manage_google_subscription(
path: String,
trigger: GcpTrigger,
operation: String,
w_id: String,
db: DB,
) -> anyhow::Result<()> {
crate::gcp_triggers_ee::manage_google_subscription(path, trigger, operation, w_id, db).await
}
pub async fn process_google_push_request(
workspace_id: String,
trigger_token: String,
message: HashMap<String, serde_json::Value>,
db: DB,
) -> anyhow::Result<Option<QueuedJob>> {
crate::gcp_triggers_ee::process_google_push_request(workspace_id, trigger_token, message, db).await
}
pub async fn validate_jwt_token(
token: String,
audience: String,
) -> anyhow::Result<()> {
crate::gcp_triggers_ee::validate_jwt_token(token, audience).await
}
pub use crate::gcp_triggers_ee::CreateUpdateConfig;
pub use crate::gcp_triggers_ee::DeliveryType;
pub use crate::gcp_triggers_ee::ExistingGcpSubscription;
pub use crate::gcp_triggers_ee::GcpTrigger;
pub use crate::gcp_triggers_ee::PushConfig;
pub use crate::gcp_triggers_ee::SubscriptionMode;

View File

@@ -0,0 +1,17 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
pub fn workspaced_service() -> Router {
crate::git_sync_ee::workspaced_service()
}
pub fn global_service() -> Router {
crate::git_sync_ee::global_service()
}

View File

@@ -0,0 +1,17 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
pub fn workspaced_service() -> Router {
crate::indexer_ee::workspaced_service()
}
pub fn global_service() -> Router {
crate::indexer_ee::global_service()
}

View File

@@ -0,0 +1,69 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
use crate::db::DB;
use serde::{Deserialize, Serialize};
pub fn workspaced_service() -> Router {
crate::job_helpers_ee::workspaced_service()
}
pub async fn get_workspace_s3_resource(
w_id: &str,
path: Option<String>,
db: &DB,
) -> windmill_common::error::Result<Option<String>> {
crate::job_helpers_ee::get_workspace_s3_resource(w_id, path, db).await
}
pub fn get_random_file_name(file_extension: Option<String>) -> String {
crate::job_helpers_ee::get_random_file_name(file_extension)
}
pub async fn get_s3_resource(
s3_resource_opt: Option<String>,
w_id: &str,
db: &DB,
) -> windmill_common::error::Result<Option<windmill_common::s3_helpers::S3Object>> {
crate::job_helpers_ee::get_s3_resource(s3_resource_opt, w_id, db).await
}
pub async fn upload_file_from_req(
req: axum::extract::Request,
storage: Option<String>,
s3_resource_path: Option<String>,
file_key: Option<String>,
resource_id: String,
db: DB,
) -> Result<axum::Json<UploadFileResponse>, windmill_common::error::Error> {
crate::job_helpers_ee::upload_file_from_req(req, storage, s3_resource_path, file_key, resource_id, db).await
}
pub async fn upload_file_internal(
s3_resource_opt: Option<String>,
w_id: &str,
content: bytes::Bytes,
file_key: String,
db: &DB,
) -> windmill_common::error::Result<String> {
crate::job_helpers_ee::upload_file_internal(s3_resource_opt, w_id, content, file_key, db).await
}
pub async fn download_s3_file_internal(
s3_resource_opt: Option<String>,
w_id: &str,
file_key: &str,
db: &DB,
) -> windmill_common::error::Result<bytes::Bytes> {
crate::job_helpers_ee::download_s3_file_internal(s3_resource_opt, w_id, file_key, db).await
}
pub use crate::job_helpers_ee::DownloadFileQuery;
pub use crate::job_helpers_ee::LoadImagePreviewQuery;
pub use crate::job_helpers_ee::UploadFileResponse;

View File

@@ -0,0 +1,25 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
use crate::db::DB;
pub fn workspaced_service() -> Router {
crate::kafka_triggers_ee::workspaced_service()
}
pub fn start_kafka_consumers(
db: DB,
killpill_rx: tokio::sync::broadcast::Receiver<()>,
) {
crate::kafka_triggers_ee::start_kafka_consumers(db, killpill_rx)
}
pub use crate::kafka_triggers_ee::KafkaResourceSecurity;
pub use crate::kafka_triggers_ee::KafkaTrigger;
pub use crate::kafka_triggers_ee::KafkaTriggerConfigConnection;

View File

@@ -12,11 +12,11 @@ use crate::ee::ExternalJwks;
#[cfg(feature = "embedding")]
use crate::embeddings::load_embeddings_db;
#[cfg(feature = "oauth2")]
use crate::oauth2_ee::AllClients;
use crate::oauth2_oss::AllClients;
#[cfg(feature = "oauth2")]
use crate::oauth2_ee::SlackVerifier;
use crate::oauth2_oss::SlackVerifier;
#[cfg(feature = "smtp")]
use crate::smtp_server_ee::SmtpServer;
use crate::smtp_server_oss::SmtpServer;
#[cfg(feature = "mcp")]
use crate::mcp::{setup_mcp_server, Runner as McpRunner};
@@ -28,7 +28,7 @@ use crate::{
};
#[cfg(feature = "agent_worker_server")]
use agent_workers_ee::AgentCache;
use agent_workers_oss::AgentCache;
use anyhow::Context;
use argon2::Argon2;
@@ -58,11 +58,11 @@ use windmill_common::db::UserDB;
use windmill_common::worker::CLOUD_HOSTED;
use windmill_common::{utils::GIT_VERSION, BASE_URL, INSTANCE_NAME};
use crate::scim_ee::has_scim_token;
use crate::scim_oss::has_scim_token;
use windmill_common::error::AppError;
#[cfg(feature = "agent_worker_server")]
mod agent_workers_ee;
mod agent_workers_oss;
mod ai;
mod apps;
pub mod args;
@@ -86,6 +86,7 @@ mod http_trigger_args;
mod http_trigger_auth;
#[cfg(feature = "http_trigger")]
pub mod http_triggers;
mod indexer_oss;
mod indexer_ee;
mod inputs;
mod integration;
@@ -93,48 +94,64 @@ mod integration;
mod postgres_triggers;
mod approvals;
mod apps_oss;
#[cfg(feature = "enterprise")]
mod apps_ee;
mod gcp_triggers_oss;
#[cfg(all(feature = "enterprise", feature = "gcp_trigger"))]
mod gcp_triggers_ee;
mod git_sync_oss;
#[cfg(feature = "enterprise")]
mod git_sync_ee;
mod job_helpers_oss;
#[cfg(feature = "parquet")]
mod job_helpers_ee;
pub mod job_metrics;
pub mod jobs;
mod kafka_triggers_oss;
#[cfg(all(feature = "enterprise", feature = "kafka"))]
mod kafka_triggers_ee;
#[cfg(feature = "mqtt_trigger")]
mod mqtt_triggers;
mod nats_triggers_oss;
#[cfg(all(feature = "enterprise", feature = "nats"))]
mod nats_triggers_ee;
pub mod oauth2_oss;
#[cfg(feature = "oauth2")]
pub mod oauth2_ee;
mod oidc_oss;
mod oidc_ee;
mod raw_apps;
mod resources;
mod saml_oss;
mod saml_ee;
mod schedule;
mod scim_oss;
mod scim_ee;
mod scripts;
mod service_logs;
mod settings;
mod slack_approvals;
mod smtp_server_oss;
#[cfg(feature = "smtp")]
mod smtp_server_ee;
mod sqs_triggers_oss;
#[cfg(all(feature = "enterprise", feature = "sqs_trigger"))]
mod sqs_triggers_ee;
mod teams_approvals_oss;
mod teams_approvals_ee;
mod trigger_helpers;
mod static_assets;
mod stripe_oss;
#[cfg(all(feature = "stripe", feature = "enterprise"))]
mod stripe_ee;
mod teams_oss;
mod teams_ee;
mod tracing_init;
mod triggers;
mod users;
mod users_oss;
mod users_ee;
mod utils;
mod variables;
@@ -143,6 +160,7 @@ pub mod webhook_util;
mod websocket_triggers;
mod workers;
mod workspaces;
mod workspaces_oss;
mod workspaces_ee;
mod workspaces_export;
mod workspaces_extra;
@@ -278,7 +296,7 @@ pub async fn run_server(
.allow_headers([http::header::CONTENT_TYPE, http::header::AUTHORIZATION])
.allow_origin(Any);
let sp_extension = Arc::new(saml_ee::build_sp_extension().await?);
let sp_extension = Arc::new(saml_oss::build_sp_extension().await?);
if server_mode {
#[cfg(feature = "embedding")]
@@ -317,7 +335,7 @@ pub async fn run_server(
let job_helpers_service = {
#[cfg(feature = "parquet")]
{
job_helpers_ee::workspaced_service()
job_helpers_oss::workspaced_service()
}
#[cfg(not(feature = "parquet"))]
@@ -329,7 +347,7 @@ pub async fn run_server(
let kafka_triggers_service = {
#[cfg(all(feature = "enterprise", feature = "kafka"))]
{
kafka_triggers_ee::workspaced_service()
kafka_triggers_oss::workspaced_service()
}
#[cfg(not(all(feature = "enterprise", feature = "kafka")))]
@@ -341,7 +359,7 @@ pub async fn run_server(
let nats_triggers_service = {
#[cfg(all(feature = "enterprise", feature = "nats"))]
{
nats_triggers_ee::workspaced_service()
nats_triggers_oss::workspaced_service()
}
#[cfg(not(all(feature = "enterprise", feature = "nats")))]
@@ -365,7 +383,7 @@ pub async fn run_server(
let gcp_triggers_service = {
#[cfg(all(feature = "enterprise", feature = "gcp_trigger"))]
{
gcp_triggers_ee::workspaced_service()
gcp_triggers_oss::workspaced_service()
}
#[cfg(not(all(feature = "enterprise", feature = "gcp_trigger")))]
@@ -377,7 +395,7 @@ pub async fn run_server(
let sqs_triggers_service = {
#[cfg(all(feature = "enterprise", feature = "sqs_trigger"))]
{
sqs_triggers_ee::workspaced_service()
sqs_triggers_oss::workspaced_service()
}
#[cfg(not(all(feature = "enterprise", feature = "sqs_trigger")))]
@@ -432,13 +450,13 @@ pub async fn run_server(
#[cfg(all(feature = "enterprise", feature = "kafka"))]
{
let kafka_killpill_rx = killpill_rx.resubscribe();
kafka_triggers_ee::start_kafka_consumers(db.clone(), kafka_killpill_rx);
kafka_triggers_oss::start_kafka_consumers(db.clone(), kafka_killpill_rx);
}
#[cfg(all(feature = "enterprise", feature = "nats"))]
{
let nats_killpill_rx = killpill_rx.resubscribe();
nats_triggers_ee::start_nats_consumers(db.clone(), nats_killpill_rx);
nats_triggers_oss::start_nats_consumers(db.clone(), nats_killpill_rx);
}
#[cfg(feature = "postgres_trigger")]
@@ -456,13 +474,13 @@ pub async fn run_server(
#[cfg(all(feature = "enterprise", feature = "sqs_trigger"))]
{
let sqs_killpill_rx = killpill_rx.resubscribe();
sqs_triggers_ee::start_sqs(db.clone(), sqs_killpill_rx);
sqs_triggers_oss::start_sqs(db.clone(), sqs_killpill_rx);
}
#[cfg(all(feature = "enterprise", feature = "gcp_trigger"))]
{
let gcp_killpill_rx = killpill_rx.resubscribe();
gcp_triggers_ee::start_consuming_gcp_pubsub_event(db.clone(), gcp_killpill_rx);
gcp_triggers_oss::start_consuming_gcp_pubsub_event(db.clone(), gcp_killpill_rx);
}
}
@@ -497,7 +515,7 @@ pub async fn run_server(
#[cfg(feature = "agent_worker_server")]
let (agent_workers_router, agent_workers_bg_processor, agent_workers_killpill_tx) =
if server_mode {
agent_workers_ee::workspaced_service(db.clone(), _base_internal_url.clone())
agent_workers_oss::workspaced_service(db.clone(), _base_internal_url.clone())
} else {
(Router::new(), vec![], None)
};
@@ -535,7 +553,7 @@ pub async fn run_server(
.nest("/oauth", {
#[cfg(feature = "oauth2")]
{
oauth2_ee::workspaced_service()
oauth2_oss::workspaced_service()
}
#[cfg(not(feature = "oauth2"))]
@@ -552,7 +570,7 @@ pub async fn run_server(
)
.nest("/variables", variables::workspaced_service())
.nest("/workspaces", workspaces::workspaced_service())
.nest("/oidc", oidc_ee::workspaced_service())
.nest("/oidc", oidc_oss::workspaced_service())
.nest("/http_triggers", http_triggers_service)
.nest("/websocket_triggers", websocket_triggers_service)
.nest("/kafka_triggers", kafka_triggers_service)
@@ -584,17 +602,17 @@ pub async fn run_server(
.nest("/jobs", jobs::global_root_service())
.nest(
"/srch/w/:workspace_id/index",
indexer_ee::workspaced_service(),
indexer_oss::workspaced_service(),
)
.nest("/srch/index", indexer_ee::global_service())
.nest("/oidc", oidc_ee::global_service())
.nest("/srch/index", indexer_oss::global_service())
.nest("/oidc", oidc_oss::global_service())
.nest(
"/saml",
saml_ee::global_service().layer(Extension(Arc::clone(&sp_extension))),
saml_oss::global_service().layer(Extension(Arc::clone(&sp_extension))),
)
.nest(
"/scim",
scim_ee::global_service()
scim_oss::global_service()
.route_layer(axum::middleware::from_fn(has_scim_token)),
)
.nest("/concurrency_groups", concurrency_groups::global_service())
@@ -602,7 +620,7 @@ pub async fn run_server(
.nest("/apps_u", {
#[cfg(feature = "enterprise")]
{
apps_ee::global_unauthed_service()
apps_oss::global_unauthed_service()
}
#[cfg(not(feature = "enterprise"))]
@@ -621,7 +639,7 @@ pub async fn run_server(
.nest("/agent_workers", {
#[cfg(feature = "agent_worker_server")]
{
agent_workers_ee::global_service().layer(Extension(agent_cache.clone()))
agent_workers_oss::global_service().layer(Extension(agent_cache.clone()))
}
#[cfg(not(feature = "agent_worker_server"))]
{
@@ -646,7 +664,7 @@ pub async fn run_server(
.nest("/teams", {
#[cfg(feature = "enterprise")]
{
teams_ee::teams_service()
teams_oss::teams_service()
}
#[cfg(not(feature = "enterprise"))]
@@ -660,12 +678,12 @@ pub async fn run_server(
)
.route(
"/w/:workspace_id/jobs/teams_approval/:job_id",
get(teams_approvals_ee::request_teams_approval),
get(teams_approvals_oss::request_teams_approval),
)
.nest("/w/:workspace_id/github_app", {
#[cfg(feature = "enterprise")]
{
git_sync_ee::workspaced_service()
git_sync_oss::workspaced_service()
}
#[cfg(not(feature = "enterprise"))]
@@ -674,7 +692,7 @@ pub async fn run_server(
.nest("/github_app", {
#[cfg(feature = "enterprise")]
{
git_sync_ee::global_service()
git_sync_oss::global_service()
}
#[cfg(not(feature = "enterprise"))]
@@ -695,7 +713,7 @@ pub async fn run_server(
.nest("/oauth", {
#[cfg(feature = "oauth2")]
{
oauth2_ee::global_service().layer(Extension(Arc::clone(&sp_extension)))
oauth2_oss::global_service().layer(Extension(Arc::clone(&sp_extension)))
}
#[cfg(not(feature = "oauth2"))]
@@ -721,7 +739,7 @@ pub async fn run_server(
{
#[cfg(all(feature = "enterprise", feature = "gcp_trigger"))]
{
gcp_triggers_ee::gcp_push_route_handler()
gcp_triggers_oss::gcp_push_route_handler()
}
#[cfg(not(all(feature = "enterprise", feature = "gcp_trigger")))]
{

View File

@@ -0,0 +1,25 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
use crate::db::DB;
pub fn workspaced_service() -> Router {
crate::nats_triggers_ee::workspaced_service()
}
pub fn start_nats_consumers(
db: DB,
killpill_rx: tokio::sync::broadcast::Receiver<()>,
) {
crate::nats_triggers_ee::start_nats_consumers(db, killpill_rx)
}
pub use crate::nats_triggers_ee::NatsResourceAuth;
pub use crate::nats_triggers_ee::NatsTrigger;
pub use crate::nats_triggers_ee::NatsTriggerConfigConnection;

View File

@@ -0,0 +1,52 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use std::collections::HashMap;
use axum::Router;
use sqlx::{Postgres, Transaction};
use crate::db::DB;
use windmill_common::error;
pub fn global_service() -> Router {
crate::oauth2_ee::global_service()
}
pub fn workspaced_service() -> Router {
crate::oauth2_ee::workspaced_service()
}
pub async fn build_oauth_clients(
base_url: &str,
oauths_from_config: Option<HashMap<String, OAuthClient>>,
db: &DB,
) -> anyhow::Result<AllClients> {
crate::oauth2_ee::build_oauth_clients(base_url, oauths_from_config, db).await
}
pub async fn _refresh_token<'c>(
tx: Transaction<'c, Postgres>,
path: &str,
w_id: &str,
id: i32,
db: &DB,
) -> error::Result<String> {
crate::oauth2_ee::_refresh_token(tx, path, w_id, id, db).await
}
pub async fn check_nb_of_user(db: &DB) -> error::Result<()> {
crate::oauth2_ee::check_nb_of_user(db).await
}
// Re-export all public types
pub use crate::oauth2_ee::AllClients;
pub use crate::oauth2_ee::BasicClientsMap;
pub use crate::oauth2_ee::ClientWithScopes;
pub use crate::oauth2_ee::OAuthClient;
pub use crate::oauth2_ee::OAuthConfig;
pub use crate::oauth2_ee::SlackVerifier;
pub use crate::oauth2_ee::TokenResponse;

View File

@@ -0,0 +1,17 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
pub fn global_service() -> Router {
crate::oidc_ee::global_service()
}
pub fn workspaced_service() -> Router {
crate::oidc_ee::workspaced_service()
}

View File

@@ -0,0 +1,23 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
pub async fn build_sp_extension() -> anyhow::Result<ServiceProviderExt> {
crate::saml_ee::build_sp_extension().await
}
pub fn global_service() -> Router {
crate::saml_ee::global_service()
}
pub async fn acs() -> String {
crate::saml_ee::acs().await
}
pub use crate::saml_ee::ServiceProviderExt;

View File

@@ -0,0 +1,22 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::{middleware::Next, response::Response, Router};
use http::Request;
pub fn global_service() -> Router {
crate::scim_ee::global_service()
}
pub async fn ee() -> String {
crate::scim_ee::ee().await
}
pub async fn has_scim_token<B>(request: Request<B>, next: Next) -> Response {
crate::scim_ee::has_scim_token(request, next).await
}

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export the EE implementation
pub use crate::smtp_server_ee::SmtpServer;

View File

@@ -0,0 +1,23 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
use crate::db::DB;
pub fn workspaced_service() -> Router {
crate::sqs_triggers_ee::workspaced_service()
}
pub fn start_sqs(
db: DB,
killpill_rx: tokio::sync::broadcast::Receiver<()>,
) {
crate::sqs_triggers_ee::start_sqs(db, killpill_rx)
}
pub use crate::sqs_triggers_ee::SqsTrigger;

View File

@@ -0,0 +1,13 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::Router;
pub fn add_stripe_routes(router: Router) -> Router {
crate::stripe_ee::add_stripe_routes(router)
}

View File

@@ -0,0 +1,14 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::http::StatusCode;
use windmill_common::error::Error;
pub async fn request_teams_approval() -> Result<StatusCode, Error> {
crate::teams_approvals_ee::request_teams_approval().await
}

View File

@@ -0,0 +1,34 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use axum::{http::StatusCode, Router};
use windmill_common::error::Error;
pub async fn edit_teams_command() -> Result<StatusCode, Error> {
crate::teams_ee::edit_teams_command().await
}
pub async fn workspaces_list_available_teams_ids() -> Result<StatusCode, Error> {
crate::teams_ee::workspaces_list_available_teams_ids().await
}
pub async fn connect_teams() -> Result<StatusCode, Error> {
crate::teams_ee::connect_teams().await
}
pub async fn run_teams_message_test_job() -> Result<StatusCode, Error> {
crate::teams_ee::run_teams_message_test_job().await
}
pub async fn workspaces_list_available_teams_channels() -> Result<StatusCode, Error> {
crate::teams_ee::workspaces_list_available_teams_channels().await
}
pub fn teams_service() -> Router {
crate::teams_ee::teams_service()
}

View File

@@ -0,0 +1,65 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use crate::db::{ApiAuthed, DB};
use argon2::Argon2;
use serde::Serialize;
use std::sync::Arc;
use windmill_common::error;
pub async fn create_user<T: Serialize>(
db: DB,
w_id: String,
authed: ApiAuthed,
email: String,
password: String,
super_admin: Option<bool>,
name: Option<String>,
company: Option<String>,
username: String,
invite_authed: ApiAuthed,
is_admin: Option<bool>,
is_operator: Option<bool>,
role: Option<String>,
groups: Option<Vec<String>>,
oidc_only: Option<bool>,
) -> error::Result<(String, T)> {
crate::users_ee::create_user(
db,
w_id,
authed,
email,
password,
super_admin,
name,
company,
username,
invite_authed,
is_admin,
is_operator,
role,
groups,
oidc_only,
)
.await
}
pub async fn set_password(
db: DB,
w_id: String,
authed: ApiAuthed,
username: String,
password: String,
argon2: Arc<Argon2<'_>>,
) -> error::Result<String> {
crate::users_ee::set_password(db, w_id, authed, username, password, argon2).await
}
pub fn send_email_if_possible(subject: &str, content: &str, to: &str) {
crate::users_ee::send_email_if_possible(subject, content, to)
}

View File

@@ -0,0 +1,25 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
use crate::db::{ApiAuthed, DB};
use serde::Deserialize;
#[derive(Deserialize)]
pub struct EditAutoInvite {
pub auto_invite_domain: Option<String>,
pub auto_invite_operator: Option<bool>,
}
pub async fn edit_auto_invite(
authed: ApiAuthed,
db: DB,
w_id: String,
ea: EditAutoInvite,
) -> windmill_common::error::Result<String> {
crate::workspaces_ee::edit_auto_invite(authed, db, w_id, ea).await
}

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::audit_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::autoscaling_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::email_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::job_s3_helpers_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::oidc_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::otel_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::stats_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::teams_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::git_sync_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::completed_runs_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::indexer_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::service_logs_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::jobs_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::job_logger_ee::*;

View File

@@ -0,0 +1,10 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/
// Re-export all items from the EE module
pub use crate::otel_ee::*;