Compare commits

...
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 f765b1474e fix(platform): a tenant erasure is confirmed only by the tenant's own id
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 5m23s
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 23m11s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
2026-11-30 21:22:34 +01:00
sharang ecfee6db6e chore(release): workspace crates at 0.4.19 (#1081)
CI / Check (push) Skipped
CI / Agent integration (push) Skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy Docs (push) Skipped
CI / Deploy MCP (push) Successful in 52s
CI / Deploy Dashboard (push) Successful in 6m33s
CI / Deploy Agent (push) Successful in 8m15s
2026-11-30 09:11:18 +00:00
sharang 30079c6504 fix(dashboard): the target-limit texts say delete, not archive (#1082)
CI / Check (push) Skipped
CI / Agent integration (push) Skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy Agent (push) Skipped
CI / Deploy Docs (push) Skipped
CI / Deploy MCP (push) Skipped
CI / Deploy Dashboard (push) Successful in 5m20s
2026-11-30 08:49:00 +00:00
sharang dd46af6f24 fix(metering): a demo target given the tenant's own sources counts under the cap (#1080)
CI / Check (push) Skipped
CI / Agent integration (push) Skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy Docs (push) Skipped
CI / Deploy MCP (push) Skipped
CI / Deploy Dashboard (push) Successful in 4m31s
CI / Deploy Agent (push) Successful in 6m2s
2026-11-29 09:56:18 +00:00
19 changed files with 335 additions and 45 deletions

No files matched your search

Generated
+9 -9
View File
@@ -601,7 +601,7 @@ dependencies = [
[[package]]
name = "compliance-agent"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"axum",
"base64 0.22.1",
@@ -657,7 +657,7 @@ dependencies = [
[[package]]
name = "compliance-core"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"aes-gcm",
"axum",
@@ -689,7 +689,7 @@ dependencies = [
[[package]]
name = "compliance-dashboard"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"async-trait",
"axum",
@@ -727,7 +727,7 @@ dependencies = [
[[package]]
name = "compliance-dast"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"axum",
"base64 0.22.1",
@@ -749,7 +749,7 @@ dependencies = [
[[package]]
name = "compliance-graph"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"bson",
"chrono",
@@ -774,7 +774,7 @@ dependencies = [
[[package]]
name = "compliance-mcp"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"axum",
"bson",
@@ -797,7 +797,7 @@ dependencies = [
[[package]]
name = "compliance-smoke"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"axum",
"compliance-core",
@@ -932,7 +932,7 @@ dependencies = [
[[package]]
name = "control-map"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"serde",
"serde_json",
@@ -7127,7 +7127,7 @@ dependencies = [
[[package]]
name = "werkbank-exec"
version = "0.4.18"
version = "0.4.19"
dependencies = [
"compliance-core",
"compliance-dast",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "compliance-agent"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
[lints]
@@ -576,6 +576,7 @@ pub async fn list_webhook_deliveries(
(status = 200, description = "The changed target"),
(status = 400, description = "Not an id"),
(status = 404, description = "No such target"),
(status = 409, description = "`target_limit`: other artifacts would make a demo target the tenant's own, and the plan has no room for it"),
(status = 422, description = "A malformed body, a project that is not the tenant's, or a device whose order number or firmware is not one"),
(status = 503, description = "A credential cannot be sealed"),
(status = 401, description = "No valid bearer token"),
@@ -587,7 +588,7 @@ pub async fn update_target(
tenant: TenantCtx,
Path(id): Path<String>,
Json(req): Json<UpdateTargetRequest>,
) -> Result<Json<ApiResponse<OnboardedTarget>>, StatusCode> {
) -> Result<Json<ApiResponse<OnboardedTarget>>, UploadRefusal> {
let oid = parse_oid(&id)?;
let db = tenant_db(&agent, &tenant).await?;
@@ -659,9 +660,14 @@ pub async fn update_target(
);
set.insert("project_ids", ids);
}
// A demo target given other sources becomes the tenant's own (below).
let mut claimed_demo = None;
if let (Some(arts), Some(stored)) = (req.artifacts, stored.as_ref()) {
let built =
merge_artifacts(&agent.secrets, &arts, &stored.artifacts).map_err(credential_error)?;
if !crate::targets::same_sources(&stored.artifacts, &built) {
claimed_demo = Some(stored);
}
set.insert(
"artifacts",
to_bson(&built).map_err(|_| StatusCode::BAD_REQUEST)?,
@@ -693,6 +699,11 @@ pub async fn update_target(
}
update.insert("$set", set);
if let Some(stored) = claimed_demo {
crate::targets::claim_demo(&agent, &db, &tenant.0.tenant_id, stored)
.await
.map_err(demo_refused)?;
}
db.onboarded_targets()
.update_one(doc! { "_id": oid }, update)
.await
@@ -708,7 +719,22 @@ pub async fn update_target(
});
}
get_target(Extension(agent), tenant, Path(id)).await
Ok(get_target(Extension(agent), tenant, Path(id)).await?)
}
/// A demo target not made the tenant's own, as the API answers: 409
/// `target_limit` when the plan has no room for it, else 500.
fn demo_refused(e: AgentError) -> UploadRefusal {
match e {
AgentError::TargetLimit(cap) => {
tracing::info!(cap, "demo target kept: the plan's targets are all active");
UploadRefusal::because(StatusCode::CONFLICT, "target_limit", "target_limit")
}
e => {
tracing::error!("claiming a demo target: {e}");
StatusCode::INTERNAL_SERVER_ERROR.into()
}
}
}
/// Remove a deleted target's clones, uploads, work trees and blobs from disk.
@@ -888,6 +914,8 @@ async fn delete_session_data(db: &crate::database::Database, session_id: &str) {
responses(
(status = 200, description = "The target with the artifact"),
(status = 400, description = "Not an id"),
(status = 404, description = "No such target"),
(status = 409, description = "`target_limit`: the artifact would make a demo target the tenant's own, and the plan has no room for it"),
(status = 422, description = "A malformed body"),
(status = 503, description = "A credential cannot be sealed"),
(status = 401, description = "No valid bearer token"),
@@ -899,9 +927,18 @@ pub async fn add_artifact(
tenant: TenantCtx,
Path(id): Path<String>,
Json(input): Json<ArtifactInput>,
) -> Result<Json<ApiResponse<OnboardedTarget>>, StatusCode> {
) -> Result<Json<ApiResponse<OnboardedTarget>>, UploadRefusal> {
let oid = parse_oid(&id)?;
let db = tenant_db(&agent, &tenant).await?;
let stored = db
.onboarded_targets()
.find_one(doc! { "_id": oid })
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?
.ok_or(StatusCode::NOT_FOUND)?;
crate::targets::claim_demo(&agent, &db, &tenant.0.tenant_id, &stored)
.await
.map_err(demo_refused)?;
let artifact = input.build(&agent.secrets, None).map_err(|e| {
tracing::error!("storing a credential: {e}");
StatusCode::SERVICE_UNAVAILABLE
@@ -914,7 +951,7 @@ pub async fn add_artifact(
)
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
get_target(Extension(agent), tenant, Path(id)).await
Ok(get_target(Extension(agent), tenant, Path(id)).await?)
}
/// The multipart form of an artifact upload.
@@ -957,6 +994,7 @@ pub struct UploadArtifactForm {
responses(
(status = 200, description = "The target with the artifact"),
(status = 404, description = "No such target"),
(status = 409, description = "`target_limit`: the file would make a demo target the tenant's own, and the plan has no room for it"),
(status = 400, description = "Not an id, or a missing or unknown field"),
(status = 413, description = "The file is too large (a supplier SBOM: over 20 MiB)"),
(status = 415, description = "An archive format that cannot be unpacked"),
@@ -981,6 +1019,11 @@ pub async fn upload_artifact(
else {
return Err(StatusCode::NOT_FOUND.into());
};
// Refused before the file streams in. A demo target becomes the
// tenant's own even when the file then turns out unreadable.
crate::targets::claim_demo(&agent, &db, &tenant.0.tenant_id, &stored_target)
.await
.map_err(demo_refused)?;
let mut kind: Option<ArtifactKind> = None;
let mut plc_format: Option<PlcFormat> = None;
+28 -3
View File
@@ -250,14 +250,16 @@ pub async fn export(
/// `DELETE /api/v1/platform/tenants/{id}/data` — GDPR erasure: drops the
/// tenant database and removes its code from disk (clones, uploads, work
/// trees, blobs, runner artifacts). Requires `{"confirm": "<slug or id>"}`.
/// trees, blobs, runner artifacts). Requires `{"confirm": "<tenant id>"}`:
/// the same id as in the path, so a call can only erase the tenant it names
/// twice; anything else is refused with 400 before anything is touched.
pub async fn delete_data(
State(st): State<PlatformState>,
Path(tenant_id): Path<String>,
body: Option<Json<LifecycleBody>>,
) -> Result<Json<serde_json::Value>, StatusCode> {
let confirm = body.and_then(|Json(b)| b.confirm).unwrap_or_default();
if confirm.is_empty() {
let confirm = body.and_then(|Json(b)| b.confirm);
if !confirms_erasure(&tenant_id, confirm.as_deref()) {
return Err(StatusCode::BAD_REQUEST);
}
// Where the tenant's code lies on disk, read before its records go.
@@ -299,6 +301,12 @@ pub async fn delete_data(
})))
}
/// Whether `confirm` confirms erasing `tenant_id`: it must be that id,
/// exactly. A missing or empty value, or another tenant's id, does not.
fn confirms_erasure(tenant_id: &str, confirm: Option<&str>) -> bool {
!tenant_id.is_empty() && confirm == Some(tenant_id)
}
/// `POST /api/v1/platform/tenants/demo/reset` — drops and re-creates the
/// demo tenant database. With `{"seed": true}` it then re-seeds the bundled
/// demo targets and starts their scans, which is what the nightly reset of the
@@ -848,3 +856,20 @@ mod target_count_tests {
assert!(stages[0].contains_key("$match") && stages[1].contains_key("$group"));
}
}
#[cfg(test)]
mod erasure_tests {
use super::*;
#[test]
fn only_the_tenants_own_id_confirms_its_erasure() {
assert!(confirms_erasure("t-1", Some("t-1")));
assert!(!confirms_erasure("t-1", None));
assert!(!confirms_erasure("t-1", Some("")));
assert!(!confirms_erasure("t-1", Some("t-2")));
assert!(!confirms_erasure("t-1", Some("T-1")));
assert!(!confirms_erasure("t-1", Some(" t-1")));
assert!(!confirms_erasure("t-1", Some("yes")));
assert!(!confirms_erasure("", Some("")));
}
}
+82 -7
View File
@@ -16,6 +16,66 @@ use crate::classify::{classify_target, MockFirmwareDetector};
use crate::database::Database;
use crate::error::AgentError;
/// Whether one more counted target fits under `cap`: the active targets
/// other than demo ones are fewer.
///
/// # Errors
///
/// [`AgentError::TargetLimit`] when they are not; a database error.
async fn room_for_one(db: &Database, cap: u32) -> Result<(), AgentError> {
let counted = db
.onboarded_targets()
.count_documents(doc! { "archived_at": null, "demo": { "$ne": true } })
.await?;
if counted >= u64::from(cap) {
return Err(AgentError::TargetLimit(cap));
}
Ok(())
}
/// Make a demo target the tenant's own before its artifacts change: from
/// then on it counts under the plan's cap like any other target. Without
/// that, a demo target pointed at the tenant's own code would sit outside
/// the cap. A target that is not a demo one is left as it is, and an
/// archived one is not checked against the cap (it does not count yet).
///
/// # Errors
///
/// [`AgentError::TargetLimit`] when the plan has no room for one more
/// counted target; the target then stays a demo one. A database error.
pub async fn claim_demo(
agent: &ComplianceAgent,
db: &Database,
tenant_id: &str,
target: &OnboardedTarget,
) -> Result<(), AgentError> {
let Some(id) = target.id.filter(|_| target.demo) else {
return Ok(());
};
if target.archived_at.is_none() {
if let Some(cap) = agent.plan(tenant_id).await.and_then(|p| p.target_cap()) {
room_for_one(db, cap).await?;
}
}
db.onboarded_targets()
.update_one(doc! { "_id": id }, doc! { "$unset": { "demo": "" } })
.await?;
Ok(())
}
/// Whether two artifact lists point at the same sources: the same kinds and
/// references, in any order. Credentials, branches and scan state may
/// differ; the dashboard's editor sends every artifact on each save.
pub fn same_sources(a: &[Artifact], b: &[Artifact]) -> bool {
let mut taken = vec![false; b.len()];
a.len() == b.len()
&& a.iter().all(|x| {
let found = (0..b.len())
.find(|&i| !taken[i] && b[i].kind == x.kind && b[i].source_ref == x.source_ref);
found.map(|i| taken[i] = true).is_some()
})
}
/// Insert a new target for `tenant_id` and emit the `target.added` usage
/// event: what every way of adding a target does (the API, accepting a
/// supplier's SBOM release, Managed Git, the demo seeder), so each counts
@@ -37,13 +97,7 @@ pub async fn create_target(
let plan = agent.plan(tenant_id).await;
// Demo targets are outside the cap: neither refused nor counted.
if let Some(cap) = plan.and_then(|p| p.target_cap()).filter(|_| !target.demo) {
let active = db
.onboarded_targets()
.count_documents(doc! { "archived_at": null, "demo": { "$ne": true } })
.await?;
if active >= u64::from(cap) {
return Err(AgentError::TargetLimit(cap));
}
room_for_one(db, cap).await?;
}
let res = db.onboarded_targets().insert_one(&target).await?;
target.id = res.inserted_id.as_object_id();
@@ -223,6 +277,27 @@ pub async fn detect_target(
mod tests {
use super::*;
#[test]
fn only_another_source_changes_a_targets_sources() {
let repo = Artifact::git_repo("https://git.example/demo.git", "main");
let site = Artifact::live_url("https://demo.example");
let other_branch = Artifact::git_repo("https://git.example/demo.git", "dev");
let own = Artifact::git_repo("https://git.example/own.git", "main");
let both = [repo.clone(), site.clone()];
let reordered = [site, repo.clone()];
let just_repo = std::slice::from_ref(&repo);
let repo_twice = [repo.clone(), repo.clone()];
assert!(same_sources(&both, &reordered));
assert!(
same_sources(just_repo, &[other_branch]),
"a branch is no new source"
);
assert!(!same_sources(just_repo, &[own]));
assert!(!same_sources(just_repo, &both));
assert!(!same_sources(&repo_twice, just_repo));
}
#[test]
fn uploaded_artifact_records_stored_path_for_file_kinds() {
let a = uploaded_artifact(
+107 -3
View File
@@ -2,7 +2,8 @@
//! `extra_targets: 0` a new target is refused (409 `target_limit`) once the
//! included ones are all active, archiving one frees its place, targets
//! already beyond it are never billed as extra, demo targets are outside the
//! cap, and a plan without the key keeps adding extra targets as before.
//! cap until they are given the tenant's own sources, and a plan without
//! the key keeps adding extra targets as before.
//! Needs a live Mongo for the agent itself; skips cleanly without one.
#![allow(clippy::expect_used, clippy::unwrap_used)]
@@ -15,13 +16,13 @@ use axum::body::Body;
use axum::extract::Request;
use axum::http::StatusCode;
use axum::middleware::{from_fn, Next};
use axum::routing::post;
use axum::routing::{patch, post};
use axum::{Extension, Json, Router};
use mongodb::bson::doc;
use tower::ServiceExt;
use compliance_agent::agent::ComplianceAgent;
use compliance_agent::api::handlers::onboarding::create_target;
use compliance_agent::api::handlers::onboarding::{create_target, update_target};
use compliance_agent::database::DatabasePool;
use compliance_core::models::{OnboardedTarget, TargetBilling, TargetType};
use compliance_core::{OrgRole, TenantContext, TenantStatus};
@@ -250,3 +251,106 @@ async fn demo_targets_are_neither_counted_nor_refused() {
.await
.expect("demo target added at the cap");
}
/// `PATCH /api/v1/targets/{id}` with `body` as a member of `tenant`.
async fn edit(
agent: &Arc<ComplianceAgent>,
tenant: &str,
id: &str,
body: serde_json::Value,
) -> (StatusCode, serde_json::Value) {
let ctx = member(tenant);
let inject = move |mut req: Request, next: Next| {
let ctx = ctx.clone();
async move {
req.extensions_mut().insert(ctx);
next.run(req).await
}
};
let app = Router::new()
.route("/api/v1/targets/{id}", patch(update_target))
.layer(Extension(agent.clone()))
.layer(from_fn(inject));
let resp = app
.oneshot(
Request::builder()
.method("PATCH")
.uri(format!("/api/v1/targets/{id}"))
.header("content-type", "application/json")
.body(Body::from(body.to_string()))
.unwrap(),
)
.await
.unwrap();
let status = resp.status();
let bytes = axum::body::to_bytes(resp.into_body(), 1 << 16)
.await
.unwrap();
(status, serde_json::from_slice(&bytes).unwrap_or_default())
}
#[tokio::test]
async fn a_demo_target_given_the_tenants_own_sources_counts() {
let registry = fake_registry().await;
let Some(agent) = agent(&registry).await else {
return;
};
let db = agent.db_pool.for_tenant_id("t-entry").await.unwrap();
let mut demo = OnboardedTarget::new("Demo · Pumpe".into(), TargetType::WebApp);
demo.demo = true;
demo.artifacts
.push(compliance_core::models::Artifact::live_url(
"https://demo.example",
));
let demo = compliance_agent::targets::create_target(&agent, &db, "t-entry", demo)
.await
.unwrap();
let id = demo.id.unwrap().to_hex();
assert_eq!(
add(&agent, "t-entry", "Steuerung A").await.0,
StatusCode::OK
);
assert_eq!(
add(&agent, "t-entry", "Steuerung B").await.0,
StatusCode::OK
);
let is_demo = || async {
db.onboarded_targets()
.find_one(doc! { "_id": demo.id.unwrap() })
.await
.unwrap()
.unwrap()
.demo
};
let own = serde_json::json!({ "artifacts": [
{ "kind": "git_repo", "source_ref": "https://git.example/own.git", "branch": "main" }
] });
// A new name and the same sources keep it a demo target.
let same = serde_json::json!({ "name": "Pumpe", "artifacts": [
{ "kind": "live_url", "source_ref": "https://demo.example" }
] });
assert_eq!(edit(&agent, "t-entry", &id, same).await.0, StatusCode::OK);
assert!(is_demo().await);
// Act + Assert: the tenant's own sources need a place, and none is free.
let (status, body) = edit(&agent, "t-entry", &id, own.clone()).await;
assert_eq!(status, StatusCode::CONFLICT);
assert_eq!(body["error"], "target_limit");
assert!(is_demo().await, "refused: still a demo target");
// With a place free, it becomes the tenant's own and takes that place.
db.onboarded_targets()
.update_one(
doc! { "name": "Steuerung A" },
doc! { "$set": { "archived_at": mongodb::bson::DateTime::now() } },
)
.await
.unwrap();
assert_eq!(edit(&agent, "t-entry", &id, own).await.0, StatusCode::OK);
assert!(!is_demo().await);
assert_eq!(
add(&agent, "t-entry", "Steuerung C").await.0,
StatusCode::CONFLICT
);
}
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "compliance-core"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
[lints]
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "compliance-dashboard"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
default-run = "compliance-dashboard"
+25 -5
View File
@@ -5786,16 +5786,36 @@ pub mod metering {
/// The plan's refusal of a new target (`target_limit`): its places are
/// all taken.
pub const TARGET_LIMIT: Text = Text {
de: "Ihr Tarif enthält keine weiteren Prüfobjekte. Archivieren Sie ein Prüfobjekt, \
um ein neues anzulegen, oder wechseln Sie den Tarif.",
en: "Your plan includes no further targets. Archive a target to add a new one, \
or change your plan.",
de: "Ihr Tarif enthält keine weiteren Prüfobjekte. Löschen Sie ein Prüfobjekt, \
um ein neues anzulegen (seine Ergebnisse werden mit gelöscht), oder wechseln \
Sie den Tarif.",
en: "Your plan includes no further targets. Delete a target to add a new one \
(its results are deleted with it), or change your plan.",
};
/// The plan's refusal to make a demo target the tenant's own
/// (`target_limit`): other sources would make it count, and its places
/// are all taken.
pub const DEMO_LIMIT: Text = Text {
de: "Mit eigenen Dateien oder Quellen zählt ein Demo-Prüfobjekt wie Ihre anderen, \
und Ihr Tarif enthält keine weiteren Prüfobjekte. Löschen Sie ein anderes \
Prüfobjekt (seine Ergebnisse werden mit gelöscht) oder wechseln Sie den Tarif.",
en: "With your own files or sources a demo target counts like your other targets, \
and your plan includes no further targets. Delete another target (its results \
are deleted with it) or change your plan.",
};
/// A failed creation of a target in words: the plan's refusal as
/// [`TARGET_LIMIT`], anything else as it came.
pub fn target_refusal(error: &str, lang: Lang) -> String {
plan_refusal(error, &TARGET_LIMIT, lang)
}
/// A failed change of a target's artifacts in words: the plan's refusal
/// as [`DEMO_LIMIT`], anything else as it came.
pub fn demo_refusal(error: &str, lang: Lang) -> String {
plan_refusal(error, &DEMO_LIMIT, lang)
}
fn plan_refusal(error: &str, text: &Text, lang: Lang) -> String {
match crate::i18n::agent_code(error, &["target_limit"]) {
Some(_) => TARGET_LIMIT.get(lang).to_string(),
Some(_) => text.get(lang).to_string(),
None => error.to_string(),
}
}
@@ -68,7 +68,7 @@ pub fn upload_problem(error: String, lang: Lang) -> String {
} else if error.contains(UNSUPPORTED_ARCHIVE) {
common::UNSUPPORTED_ARCHIVE.get(lang).to_string()
} else {
error
crate::i18n::texts::metering::demo_refusal(&error, lang)
}
}
@@ -694,6 +694,8 @@ pub async fn upload_target_artifact(
413 if sbom => format!("{SBOM_REFUSED}too_large"),
413 => "file is larger than the 512 MiB upload limit".to_string(),
415 => UNSUPPORTED_ARCHIVE.to_string(),
// A demo target the plan has no room for as the tenant's own.
409 => refusal_code(resp).await,
422 => format!("{SBOM_REFUSED}{}", refusal_code(resp).await),
code => format!("upload rejected by the agent ({code})"),
}));
+19 -2
View File
@@ -998,12 +998,29 @@ mod tests {
let error = "error running server function: target_limit (409) (details: None)";
assert_eq!(
metering::target_refusal(error, Lang::En),
"Your plan includes no further targets. Archive a target to add a new one, \
or change your plan."
"Your plan includes no further targets. Delete a target to add a new one \
(its results are deleted with it), or change your plan."
);
assert_eq!(metering::target_refusal("x (500)", Lang::De), "x (500)");
}
#[test]
fn a_demo_target_the_plan_has_no_room_for_reads_in_words() {
let error = "error running server function: target_limit (409) (details: None)";
assert_eq!(
metering::demo_refusal(error, Lang::En),
metering::DEMO_LIMIT.get(Lang::En)
);
assert_eq!(
upload_problem(
"error running server function: target_limit".into(),
Lang::De
),
metering::DEMO_LIMIT.get(Lang::De)
);
assert_eq!(metering::demo_refusal("x (500)", Lang::De), "x (500)");
}
#[test]
fn a_refused_supplier_sbom_upload_reads_in_the_readers_language() {
let error = "error running server function: supplier_sbom_refused:empty (details: None)";
+4 -1
View File
@@ -911,7 +911,10 @@ fn TargetEditor(
toasts.push(ToastType::Success, tx::UPDATED.get(lang));
on_saved.call(());
}
Err(e) => toasts.push(ToastType::Error, e.to_string()),
Err(e) => toasts.push(
ToastType::Error,
crate::i18n::texts::metering::demo_refusal(&e.to_string(), lang),
),
}
edit_saving.set(false);
});
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "compliance-dast"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
[lints]
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "compliance-graph"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
[lints]
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "compliance-mcp"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
[dependencies]
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "compliance-smoke"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
description = "Tiny Axum service exercising compliance-core M7.1 tenant gating. Run smoke.sh against it before merging anything that touches the auth/tenant path."
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "control-map"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
[lints]
+2 -1
View File
@@ -13,7 +13,8 @@ What Prüfwerk keeps about a target, where, and when it is removed.
Deleting a target (`DELETE /api/v1/targets/{id}`, or **Delete** on the
targets page) removes its records and its files. Erasing a tenant
(`DELETE /api/v1/platform/tenants/{id}/data`, confirmed) drops its database
(`DELETE /api/v1/platform/tenants/{id}/data` with `{"confirm": "<tenant id>"}`,
the same id as in the path) drops its database
and removes every file listed above; the response says how many paths were
removed and how many could not be. Only paths inside the two configured base
directories are ever removed.
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "werkbank-exec"
version = "0.4.18"
version = "0.4.19"
edition = "2021"
description = "Shared dynamic-execution logic: soft-PLC provisioning + industrial-protocol probing, used by the compliance agent and the Werkbank runner."