Files
windmill/backend/windmill-api-users/src/users_oss.rs
T
51e9017c67 feat: flag risky tokens and add a superadmin token review (#12693)
* feat: flag risky tokens in the tokens drawer and add a superadmin token review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: load the whole token review at once and pin the risk rules in a test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: a job tag filter alone does not narrow a privileged token

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: flag the rights a token carries, not the rights of its owner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: flag tokens that work in every workspace and filter the review by flag

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf: compute token risks in a view and page the review with a cursor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: trust only reserved labels or short lifetimes as server-managed, keep the review cursor on raw rows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: leave a day of clock skew on the server-managed token lifetime

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: make the instance-wide token list and deletion an EE feature

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep the token list EE in the CE image, which builds private

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: update ee-repo-ref to b3c5cbb7edcc42f3db92865896d472cdd8842cf9

This commit updates the EE repository reference after PR #1020 was merged in windmill-ee-private.

Previous ee-repo-ref: 51a2425e60989d727d40330bdfa7b2d302224c9c

New ee-repo-ref: b3c5cbb7edcc42f3db92865896d472cdd8842cf9

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
2026-11-27 16:24:34 +01:00

59 lines
1.9 KiB
Rust

#[cfg(feature = "private")]
#[allow(unused)]
pub use crate::users_ee::*;
#[cfg(not(feature = "private"))]
use crate::users::ImpersonateServiceAccountRequest;
#[cfg(not(feature = "private"))]
use http::StatusCode;
#[cfg(not(feature = "private"))]
use tower_cookies::Cookies;
#[cfg(not(feature = "private"))]
use windmill_api_auth::ApiAuthed;
#[cfg(not(feature = "private"))]
use windmill_common::DB;
#[cfg(not(feature = "private"))]
pub async fn impersonate_service_account(
_db: DB,
_authed: ApiAuthed,
_cookies: Cookies,
_current_token: String,
_w_id: String,
_req: ImpersonateServiceAccountRequest,
) -> windmill_common::error::Result<(StatusCode, String)> {
Err(windmill_common::error::Error::BadRequest(
"Service accounts require Windmill Enterprise Edition".to_string(),
))
}
#[cfg(not(feature = "private"))]
pub(crate) async fn portal_cloud_trial_login(
_email: &str,
) -> windmill_common::error::Result<crate::users::PortalTrialLogin> {
Err(windmill_common::error::Error::FeatureUnavailable(
"Starting a pre-approved trial from Windmill Cloud requires Windmill Enterprise Edition"
.to_string(),
))
}
// The CE image builds with `private` but not `enterprise`, so these, not `users_ee`'s, serve
// it: the instance-wide token list stays EE.
#[cfg(not(all(feature = "private", feature = "enterprise")))]
pub(crate) async fn list_tokens_as_super_admin(
_db: &windmill_common::DB,
_query: crate::users::TokenReviewQuery,
) -> windmill_common::error::Result<Vec<crate::users::TokenForReview>> {
Err(crate::users::token_review_requires_ee())
}
#[cfg(not(all(feature = "private", feature = "enterprise")))]
pub(crate) async fn delete_token_as_super_admin(
_db: &windmill_common::DB,
_authed: &windmill_api_auth::ApiAuthed,
_email: &str,
_token_prefix: &str,
) -> windmill_common::error::Result<String> {
Err(crate::users::token_review_requires_ee())
}