global profile comes from server now only

This commit is contained in:
Priec
2026-08-17 11:05:16 +02:00
parent 9b1e592ecd
commit efd9e2481b
9 changed files with 33 additions and 11 deletions

2
client

Submodule client updated: 421b27e069...7319ea4178

View File

@@ -308,11 +308,18 @@ message ProfileTreeResponse {
// All profiles in the system. // All profiles in the system.
repeated Profile profiles = 1; repeated Profile profiles = 1;
// The profile holding the tables every profile shares. Callers browse this
// one when the user has not chosen a profile, so the name is reported here
// rather than being known in advance.
string shared_profile_name = 2;
} }
message GetTableCatalogRequest { message GetTableCatalogRequest {
// Selected profile. Omit this field to request the global-only scope. // Profile whose tables to list, together with the shared tables every
optional string profile_name = 1; // profile sees. The profile holding the shared tables is named like any
// other, and asking for it lists exactly those.
string profile_name = 1;
} }
message GetTableCatalogResponse { message GetTableCatalogResponse {

Binary file not shown.

View File

@@ -224,6 +224,11 @@ pub struct ProfileTreeResponse {
/// All profiles in the system. /// All profiles in the system.
#[prost(message, repeated, tag = "1")] #[prost(message, repeated, tag = "1")]
pub profiles: ::prost::alloc::vec::Vec<profile_tree_response::Profile>, pub profiles: ::prost::alloc::vec::Vec<profile_tree_response::Profile>,
/// The profile holding the tables every profile shares. Callers browse this
/// one when the user has not chosen a profile, so the name is reported here
/// rather than being known in advance.
#[prost(string, tag = "2")]
pub shared_profile_name: ::prost::alloc::string::String,
} }
/// Nested message and enum types in `ProfileTreeResponse`. /// Nested message and enum types in `ProfileTreeResponse`.
pub mod profile_tree_response { pub mod profile_tree_response {
@@ -283,9 +288,11 @@ pub mod profile_tree_response {
} }
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTableCatalogRequest { pub struct GetTableCatalogRequest {
/// Selected profile. Omit this field to request the global-only scope. /// Profile whose tables to list, together with the shared tables every
#[prost(string, optional, tag = "1")] /// profile sees. The profile holding the shared tables is named like any
pub profile_name: ::core::option::Option<::prost::alloc::string::String>, /// other, and asking for it lists exactly those.
#[prost(string, tag = "1")]
pub profile_name: ::prost::alloc::string::String,
} }
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTableCatalogResponse { pub struct GetTableCatalogResponse {

2
server

Submodule server updated: efcd4b9ed0...f3efeae04b

View File

@@ -73,7 +73,9 @@ pub(crate) async fn load_page(
// to — see `crate::pages::table_scope`. // to — see `crate::pages::table_scope`.
let catalog_tables = definitions let catalog_tables = definitions
.get_table_catalog( .get_table_catalog(
authenticated_request(headers, GetTableCatalogRequest { profile_name: None }) authenticated_request(headers, GetTableCatalogRequest {
profile_name: crate::pages::GLOBAL_SCOPE.to_string(),
})
.map_err(|_| LoadError::Unauthenticated)?, .map_err(|_| LoadError::Unauthenticated)?,
) )
.await .await

View File

@@ -51,7 +51,9 @@ pub(crate) async fn load_admin_page(
let global_tables = table_scope::global_tables( let global_tables = table_scope::global_tables(
&definitions &definitions
.get_table_catalog( .get_table_catalog(
authenticated_request(headers, GetTableCatalogRequest { profile_name: None }) authenticated_request(headers, GetTableCatalogRequest {
profile_name: crate::pages::GLOBAL_SCOPE.to_string(),
})
.map_err(authentication_error)?, .map_err(authentication_error)?,
) )
.await .await

View File

@@ -121,7 +121,9 @@ pub(crate) async fn load_page(
// had just listed. // had just listed.
let catalog_tables = definitions let catalog_tables = definitions
.get_table_catalog( .get_table_catalog(
authenticated_request(headers, GetTableCatalogRequest { profile_name: None }) authenticated_request(headers, GetTableCatalogRequest {
profile_name: crate::pages::GLOBAL_SCOPE.to_string(),
})
.map_err(|_| LoadError::Unauthenticated)?, .map_err(|_| LoadError::Unauthenticated)?,
) )
.await .await

View File

@@ -75,7 +75,9 @@ pub(crate) async fn load_catalog(
let global = table_scope::global_tables( let global = table_scope::global_tables(
&definitions &definitions
.get_table_catalog( .get_table_catalog(
authenticated_request(headers, GetTableCatalogRequest { profile_name: None }) authenticated_request(headers, GetTableCatalogRequest {
profile_name: crate::pages::GLOBAL_SCOPE.to_string(),
})
.map_err(|_| LoadError::Unauthenticated)?, .map_err(|_| LoadError::Unauthenticated)?,
) )
.await .await