profile name sent with every table from now on

This commit is contained in:
Priec
2026-08-16 23:51:39 +02:00
parent c05c177624
commit 9b1e592ecd
11 changed files with 64 additions and 26 deletions

34
Cargo.lock generated
View File

@@ -207,7 +207,7 @@ dependencies = [
"objc2-foundation", "objc2-foundation",
"parking_lot", "parking_lot",
"percent-encoding", "percent-encoding",
"windows-sys 0.59.0", "windows-sys 0.52.0",
"x11rb", "x11rb",
] ]
@@ -883,7 +883,7 @@ version = "3.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "519bd3116aeeb42d5372c29d982d16d0170d3d4a5ed85fc7dd91642ffff3c67c" checksum = "519bd3116aeeb42d5372c29d982d16d0170d3d4a5ed85fc7dd91642ffff3c67c"
dependencies = [ dependencies = [
"darling 0.23.0", "darling 0.20.11",
"ident_case", "ident_case",
"prettyplease", "prettyplease",
"proc-macro2", "proc-macro2",
@@ -1161,7 +1161,7 @@ checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
[[package]] [[package]]
name = "client" name = "client"
version = "0.8.41" version = "0.8.46"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@@ -1282,7 +1282,7 @@ dependencies = [
[[package]] [[package]]
name = "common" name = "common"
version = "0.8.41" version = "0.8.46"
dependencies = [ dependencies = [
"prost", "prost",
"prost-build", "prost-build",
@@ -2735,7 +2735,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -5755,7 +5755,7 @@ version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042"
dependencies = [ dependencies = [
"heck 0.5.0", "heck 0.4.1",
"itertools 0.14.0", "itertools 0.14.0",
"log", "log",
"multimap", "multimap",
@@ -5906,7 +5906,7 @@ dependencies = [
"once_cell", "once_cell",
"socket2", "socket2",
"tracing", "tracing",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -6590,7 +6590,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -6647,7 +6647,7 @@ dependencies = [
"security-framework", "security-framework",
"security-framework-sys", "security-framework-sys",
"webpki-root-certs", "webpki-root-certs",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -6754,7 +6754,7 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
[[package]] [[package]]
name = "search" name = "search"
version = "0.8.41" version = "0.8.46"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"common", "common",
@@ -6942,7 +6942,7 @@ dependencies = [
[[package]] [[package]]
name = "server" name = "server"
version = "0.8.41" version = "0.8.46"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bcrypt", "bcrypt",
@@ -7205,7 +7205,7 @@ version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f103c50866b8743da9429b8a581d81a27c2d3a9c4ac7df8f8571c1dd7896eda" checksum = "5f103c50866b8743da9429b8a581d81a27c2d3a9c4ac7df8f8571c1dd7896eda"
dependencies = [ dependencies = [
"heck 0.5.0", "heck 0.4.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.117", "syn 2.0.117",
@@ -7929,7 +7929,7 @@ dependencies = [
"getrandom 0.4.2", "getrandom 0.4.2",
"once_cell", "once_cell",
"rustix", "rustix",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -8532,7 +8532,7 @@ checksum = "e78122066b0cb818b8afd08f7ed22f7fdbc3e90815035726f0840d0d26c0747a"
[[package]] [[package]]
name = "tui-canvas" name = "tui-canvas"
version = "0.8.41" version = "0.8.46"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arboard", "arboard",
@@ -8563,7 +8563,7 @@ dependencies = [
[[package]] [[package]]
name = "tui-canvas-validation-core" name = "tui-canvas-validation-core"
version = "0.8.41" version = "0.8.46"
dependencies = [ dependencies = [
"regex", "regex",
"serde", "serde",
@@ -8573,7 +8573,7 @@ dependencies = [
[[package]] [[package]]
name = "tui-pages" name = "tui-pages"
version = "0.8.41" version = "0.8.46"
dependencies = [ dependencies = [
"criterion", "criterion",
"crossterm", "crossterm",
@@ -9284,7 +9284,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]

View File

@@ -5,7 +5,7 @@ resolver = "3"
[workspace.package] [workspace.package]
# TODO: idk how to do the name, fix later # TODO: idk how to do the name, fix later
# name = "komp_ac" # name = "komp_ac"
version = "0.8.41" version = "0.8.46"
edition = "2024" edition = "2024"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
authors = ["Filip Priečinský <filippriec@gmail.com>"] authors = ["Filip Priečinský <filippriec@gmail.com>"]

2
client

Submodule client updated: b87d463f78...421b27e069

View File

@@ -289,6 +289,12 @@ message ProfileTreeResponse {
// True when this table is shared by every profile. // True when this table is shared by every profile.
bool global = 6; bool global = 6;
// Profile (schema) the table is actually stored in. A global table is
// listed under every profile it is visible from, so this names the one it
// belongs to rather than the one it was reached through, and callers can
// use it as the table's identity without deciding anything themselves.
string profile_name = 7;
} }
// Profile (schema) entry. // Profile (schema) entry.
@@ -377,6 +383,11 @@ message TableDetail {
bool global = 9; bool global = 9;
// Revision of this table definition for optimistic concurrency control. // Revision of this table definition for optimistic concurrency control.
int64 row_version = 10; int64 row_version = 10;
// Profile (schema) the table is actually stored in, which is not the
// requested profile when a global table is being listed. See
// ProfileTreeResponse.Table.profile_name.
string profile_name = 11;
} }
// Server-owned behavior for one logical column returned in table details. // Server-owned behavior for one logical column returned in table details.

Binary file not shown.

View File

@@ -263,6 +263,12 @@ pub mod profile_tree_response {
/// True when this table is shared by every profile. /// True when this table is shared by every profile.
#[prost(bool, tag = "6")] #[prost(bool, tag = "6")]
pub global: bool, pub global: bool,
/// Profile (schema) the table is actually stored in. A global table is
/// listed under every profile it is visible from, so this names the one it
/// belongs to rather than the one it was reached through, and callers can
/// use it as the table's identity without deciding anything themselves.
#[prost(string, tag = "7")]
pub profile_name: ::prost::alloc::string::String,
} }
/// Profile (schema) entry. /// Profile (schema) entry.
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
@@ -388,6 +394,11 @@ pub struct TableDetail {
/// Revision of this table definition for optimistic concurrency control. /// Revision of this table definition for optimistic concurrency control.
#[prost(int64, tag = "10")] #[prost(int64, tag = "10")]
pub row_version: i64, pub row_version: i64,
/// Profile (schema) the table is actually stored in, which is not the
/// requested profile when a global table is being listed. See
/// ProfileTreeResponse.Table.profile_name.
#[prost(string, tag = "11")]
pub profile_name: ::prost::alloc::string::String,
} }
/// Server-owned behavior for one logical column returned in table details. /// Server-owned behavior for one logical column returned in table details.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]

2
server

Submodule server updated: 08ab3c2e49...efcd4b9ed0

View File

@@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
--- ---
## [Unreleased] ## [v0.8.46] — 2026-08-16
### Added ### Added
@@ -56,9 +56,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
so inherited `superadmin` authorization works and data roles are no longer so inherited `superadmin` authorization works and data roles are no longer
treated as administrators. Login redirects structural users to the admin treated as administrators. Login redirects structural users to the admin
workspace and data users to analytics. workspace and data users to analytics.
- **Analytics and import/export use the caller's visible data** — profile-tree - **Import and export are their own grant actions** — the import page requires
discovery is authenticated, export is limited to readable tables, and the caller's `import` grant and the export page the caller's `export` grant,
import is limited to tables for which the snapshot carries `insert`. on top of the underlying row action each transfer performs (`insert` for
import, `read` for export). A table is offered only when the caller holds
both, so the menu never leads to a transfer the backend would refuse halfway
through. Profile-tree discovery for these pages is authenticated.
- **CSV transfer system columns and header normalizing** — the import page
gained a "File includes system columns" checkbox (so `deleted` loads back as
it left) and a "Normalize headers" action that rewrites header rows into the
backend's column spellings before anything is posted; the export page gained
an "Include system columns" checkbox that adds `id`, `deleted`, and
`row_revision`. No new gRPC endpoint is consumed — these reuse
`PostTableDataBulk`, `GetTableDataByPosition`, and `GetTableDataCount`.
- **Permission mutations keep the browser session** — grants, role changes and - **Permission mutations keep the browser session** — grants, role changes and
assignments now reload the live authorization state without replacing the assignments now reload the live authorization state without replacing the
identity-only JWT. The permissions workspace reloads in place and shows the identity-only JWT. The permissions workspace reloads in place and shows the

View File

@@ -63,6 +63,7 @@ pub(crate) fn linkable_tables(
#[cfg(test)] #[cfg(test)]
pub(crate) mod tests { pub(crate) mod tests {
use super::*; use super::*;
use crate::pages::GLOBAL_SCOPE;
pub(crate) fn table(name: &str, global: bool) -> Table { pub(crate) fn table(name: &str, global: bool) -> Table {
Table { Table {
@@ -72,6 +73,11 @@ pub(crate) mod tests {
row_display_columns: Vec::new(), row_display_columns: Vec::new(),
table_kind: "dynamic".to_string(), table_kind: "dynamic".to_string(),
global, global,
profile_name: if global {
GLOBAL_SCOPE.to_string()
} else {
"test_profile".to_string()
},
} }
} }