From 1a8285a06f4ecedd34775c9dcf4122888c140bc9 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 17 Feb 2024 16:46:02 +0100 Subject: [PATCH] feat: scim token and saml metadata setting in UI directly chore(main): release 1.271.0 (#3237) * chore(main): release 1.271.0 * Apply automatic changes --------- Co-authored-by: rubenfiszel fix test revert ee changes revert ee changes --- CHANGELOG.md | 13 +++++++ backend/Cargo.lock | 38 +++++++++---------- backend/Cargo.toml | 4 +- backend/ee-repo-ref.txt | 2 +- backend/src/main.rs | 14 ++++++- backend/src/monitor.rs | 21 +++++++++- backend/windmill-api/openapi.yaml | 23 ++++++++++- backend/windmill-api/src/lib.rs | 3 ++ .../windmill-common/src/global_settings.rs | 2 +- benchmarks/lib.ts | 2 +- cli/main.ts | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- .../lib/components/InstanceSettings.svelte | 13 +++++++ .../src/lib/components/instanceSettings.ts | 20 ++++++++++ lsp/Pipfile | 4 +- openflow.openapi.yaml | 2 +- python-client/wmill/pyproject.toml | 2 +- python-client/wmill_pg/pyproject.toml | 2 +- typescript-client/package.json | 2 +- version.txt | 2 +- 21 files changed, 137 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9613089bd..ab6e06f869 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ # Changelog +## [1.271.0](https://github.com/windmill-labs/windmill/compare/v1.270.3...v1.271.0) (2024-02-17) + + +### Features + +* scim token and saml metadata setting in UI directly ([71e915a](https://github.com/windmill-labs/windmill/commit/71e915a86c4f0661bad7a0f977b015045f739d8a)) + + +### Bug Fixes + +* **mysql:** support integer with float type ([041b777](https://github.com/windmill-labs/windmill/commit/041b777fd65692d3549ba7ec64258882e108f5bf)) +* pre-select resource if there is only one ([801eda1](https://github.com/windmill-labs/windmill/commit/801eda1e22298f9f55d1ea87d0a19a03e6de6a64)) + ## [1.270.3](https://github.com/windmill-labs/windmill/compare/v1.270.2...v1.270.3) (2024-02-16) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 377a2abcbe..c365d05f0c 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -9119,7 +9119,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "axum", @@ -9155,7 +9155,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "argon2", @@ -9229,7 +9229,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.270.3" +version = "1.271.0" dependencies = [ "base64 0.21.7", "chrono", @@ -9247,7 +9247,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.270.3" +version = "1.271.0" dependencies = [ "chrono", "serde", @@ -9260,7 +9260,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "axum", @@ -9293,7 +9293,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.270.3" +version = "1.271.0" dependencies = [ "regex", "rsmq_async", @@ -9308,7 +9308,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.270.3" +version = "1.271.0" dependencies = [ "serde", "serde_json", @@ -9316,7 +9316,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "lazy_static", @@ -9327,7 +9327,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "gosyn", @@ -9339,7 +9339,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "lazy_static", @@ -9350,7 +9350,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "itertools 0.12.1", @@ -9361,7 +9361,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "async-recursion", @@ -9378,7 +9378,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "lazy_static", @@ -9389,7 +9389,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -9407,7 +9407,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "getrandom 0.2.12", @@ -9425,7 +9425,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "async-recursion", @@ -9458,7 +9458,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.270.3" +version = "1.271.0" dependencies = [ "anyhow", "async-recursion", @@ -9712,9 +9712,9 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53be06678ed9e83edb1745eb72efc0bbcd7b5c3c35711a860906aed827a13d61" +checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" [[package]] name = "xz2" diff --git a/backend/Cargo.toml b/backend/Cargo.toml index a8d119c511..0921513072 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.270.3" +version = "1.271.0" authors.workspace = true edition.workspace = true @@ -22,7 +22,7 @@ members = [ ] [workspace.package] -version = "1.270.3" +version = "1.271.0" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 01edafce8b..d745e03cdf 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -8ed0d6aa6218ec4f9011a60db701295e5c3a1e4a \ No newline at end of file +045dc822a95f2230e4ae97ac492df0dd9f797af6 \ No newline at end of file diff --git a/backend/src/main.rs b/backend/src/main.rs index 4616156b78..feee88adf3 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -28,7 +28,7 @@ use windmill_common::{ JOB_DEFAULT_TIMEOUT_SECS_SETTING, KEEP_JOB_DIR_SETTING, LICENSE_KEY_SETTING, NPM_CONFIG_REGISTRY_SETTING, OAUTH_SETTING, PIP_INDEX_URL_SETTING, REQUEST_SIZE_LIMIT_SETTING, REQUIRE_PREEXISTING_USER_FOR_OAUTH_SETTING, - RETENTION_PERIOD_SECS_SETTING, + RETENTION_PERIOD_SECS_SETTING, SAML_METADATA_SETTING, SCIM_TOKEN_SETTING, }, stats::schedule_stats, utils::{rd_string, Mode}, @@ -47,7 +47,8 @@ use crate::monitor::{ monitor_db, monitor_pool, reload_base_url_setting, reload_bunfig_install_scopes_setting, reload_extra_pip_index_url_setting, reload_job_default_timeout_setting, reload_license_key, reload_npm_config_registry_setting, reload_pip_index_url_setting, - reload_retention_period_setting, reload_server_config, reload_worker_config, + reload_retention_period_setting, reload_scim_token_setting, reload_server_config, + reload_worker_config, }; const GIT_VERSION: &str = git_version!(args = ["--tag", "--always"], fallback = "unknown-version"); @@ -399,6 +400,9 @@ Windmill Community Edition {GIT_VERSION} JOB_DEFAULT_TIMEOUT_SECS_SETTING => { reload_job_default_timeout_setting(&db).await }, + SCIM_TOKEN_SETTING => { + reload_scim_token_setting(&db).await + }, EXTRA_PIP_INDEX_URL_SETTING => { reload_extra_pip_index_url_setting(&db).await }, @@ -439,6 +443,12 @@ Windmill Community Edition {GIT_VERSION} } } }, + SAML_METADATA_SETTING => { + tracing::info!("SAML metadata change detected, killing server expecting to be restarted"); + if let Err(e) = tx.send(()) { + tracing::error!(error = %e, "Could not send killpill to server"); + } + }, DISABLE_STATS_SETTING => {}, a @_ => { tracing::info!("Unrecognized Global Setting Change Payload: {:?}", a); diff --git a/backend/src/monitor.rs b/backend/src/monitor.rs index 61bf89ea3f..45bfdcd67e 100644 --- a/backend/src/monitor.rs +++ b/backend/src/monitor.rs @@ -16,7 +16,7 @@ use tokio::{ use uuid::Uuid; use windmill_api::{ oauth2_ee::{build_oauth_clients, OAuthClient}, - DEFAULT_BODY_LIMIT, IS_SECURE, OAUTH_CLIENTS, REQUEST_SIZE_LIMIT, + DEFAULT_BODY_LIMIT, IS_SECURE, OAUTH_CLIENTS, REQUEST_SIZE_LIMIT, SAML_METADATA, SCIM_TOKEN, }; use windmill_common::{ error, @@ -26,7 +26,7 @@ use windmill_common::{ JOB_DEFAULT_TIMEOUT_SECS_SETTING, KEEP_JOB_DIR_SETTING, LICENSE_KEY_SETTING, NPM_CONFIG_REGISTRY_SETTING, OAUTH_SETTING, PIP_INDEX_URL_SETTING, REQUEST_SIZE_LIMIT_SETTING, REQUIRE_PREEXISTING_USER_FOR_OAUTH_SETTING, - RETENTION_PERIOD_SECS_SETTING, + RETENTION_PERIOD_SECS_SETTING, SAML_METADATA_SETTING, SCIM_TOKEN_SETTING, }, jobs::{JobKind, QueuedJob}, oauth2::REQUIRE_PREEXISTING_USER_FOR_OAUTH, @@ -125,6 +125,8 @@ pub async fn initial_load( reload_server_config(&db).await; reload_retention_period_setting(&db).await; reload_request_size(&db).await; + reload_saml_metadata_setting(&db).await; + reload_scim_token_setting(&db).await; } #[cfg(feature = "enterprise")] @@ -317,6 +319,21 @@ pub async fn delete_expired_items(db: &DB) -> () { } } +pub async fn reload_scim_token_setting(db: &DB) { + reload_option_setting_with_tracing(db, SCIM_TOKEN_SETTING, "SCIM_TOKEN", SCIM_TOKEN.clone()) + .await; +} + +pub async fn reload_saml_metadata_setting(db: &DB) { + reload_option_setting_with_tracing( + db, + SAML_METADATA_SETTING, + "SAML_METADATA", + SAML_METADATA.clone(), + ) + .await; +} + pub async fn reload_extra_pip_index_url_setting(db: &DB) { reload_option_setting_with_tracing( db, diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 75390f8834..92e80e6b3d 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.270.3 + version: 1.271.0 title: Windmill API contact: @@ -664,6 +664,27 @@ paths: schema: type: string + /saml/test_metadata: + post: + summary: test metadata + operationId: testMetadata + tags: + - setting + requestBody: + description: test metadata + required: true + content: + application/json: + schema: + type: string + responses: + "200": + description: status + content: + text/plain: + schema: + type: string + /users/email: get: summary: get current user email (if logged in) diff --git a/backend/windmill-api/src/lib.rs b/backend/windmill-api/src/lib.rs index b06453f548..000a710b42 100644 --- a/backend/windmill-api/src/lib.rs +++ b/backend/windmill-api/src/lib.rs @@ -89,6 +89,9 @@ lazy_static::lazy_static! { pub static ref REQUEST_SIZE_LIMIT: Arc> = Arc::new(RwLock::new(DEFAULT_BODY_LIMIT)); + pub static ref SCIM_TOKEN: Arc>> = Arc::new(RwLock::new(None)); + pub static ref SAML_METADATA: Arc>> = Arc::new(RwLock::new(None)); + pub static ref COOKIE_DOMAIN: Option = std::env::var("COOKIE_DOMAIN").ok(); diff --git a/backend/windmill-common/src/global_settings.rs b/backend/windmill-common/src/global_settings.rs index d5bd88d0ed..2570c92bd6 100644 --- a/backend/windmill-common/src/global_settings.rs +++ b/backend/windmill-common/src/global_settings.rs @@ -13,7 +13,7 @@ pub const BUNFIG_INSTALL_SCOPES_SETTING: &str = "bunfig_install_scopes"; pub const EXTRA_PIP_INDEX_URL_SETTING: &str = "pip_extra_index_url"; pub const PIP_INDEX_URL_SETTING: &str = "pip_index_url"; pub const SCIM_TOKEN_SETTING: &str = "scim_token"; -pub const SAML_METADATA_SETTING: &str = "saml_token"; +pub const SAML_METADATA_SETTING: &str = "saml_metadata"; pub const UNIQUE_ID_SETTING: &str = "uid"; pub const DISABLE_STATS_SETTING: &str = "disable_stats"; diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index f793682987..81a41f9d59 100644 --- a/benchmarks/lib.ts +++ b/benchmarks/lib.ts @@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts"; import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts"; import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts"; -export const VERSION = "v1.270.3"; +export const VERSION = "v1.271.0"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/main.ts b/cli/main.ts index 8702c126e1..16bb5a1f7a 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -31,7 +31,7 @@ addEventListener("error", (event) => { } }); -export const VERSION = "v1.270.3"; +export const VERSION = "v1.271.0"; let command: any = new Command() .name("wmill") diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 41e0ab9048..b73b4514de 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.270.3", + "version": "1.271.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.270.3", + "version": "1.271.0", "license": "AGPL-3.0", "dependencies": { "@aws-crypto/sha256-js": "^4.0.0", diff --git a/frontend/package.json b/frontend/package.json index fe7124fac8..283f72740d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.270.3", + "version": "1.271.0", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/frontend/src/lib/components/InstanceSettings.svelte b/frontend/src/lib/components/InstanceSettings.svelte index b988cc16cf..fc0d9cb253 100644 --- a/frontend/src/lib/components/InstanceSettings.svelte +++ b/frontend/src/lib/components/InstanceSettings.svelte @@ -436,6 +436,19 @@ placeholder={setting.placeholder} bind:value={values[setting.key]} /> + {#if setting.key == 'saml_metadata'} +
+ +
+ {/if} {:else if setting.fieldType == 'license_key'}