diff --git a/client-gui2 b/client-gui2 index 43a95c35..a66fa8e7 160000 --- a/client-gui2 +++ b/client-gui2 @@ -1 +1 @@ -Subproject commit 43a95c353369d17b5fd235ad67cdedc76026ad71 +Subproject commit a66fa8e746484b53e8ed541832f902a821509129 diff --git a/common/proto/analytics.proto b/common/proto/analytics.proto index 6f7c66dd..05be4530 100644 --- a/common/proto/analytics.proto +++ b/common/proto/analytics.proto @@ -196,15 +196,6 @@ enum ReportNullPolicy { REPORT_NULL_POLICY_ZERO = 2; } -enum ReportCapability { - REPORT_CAPABILITY_UNSPECIFIED = 0; - REPORT_CAPABILITY_VIEW = 1; - REPORT_CAPABILITY_FILTER = 2; - REPORT_CAPABILITY_DRILL = 3; - REPORT_CAPABILITY_EXPORT = 4; - REPORT_CAPABILITY_CUSTOMIZE = 5; -} - enum ReportExecutionPurpose { REPORT_EXECUTION_PURPOSE_UNSPECIFIED = 0; REPORT_EXECUTION_PURPOSE_VIEW = 1; @@ -360,20 +351,11 @@ message ReportPanel { repeated ReportPanelAction actions = 23; } -message ReportGrant { - oneof subject { - string role = 1; - string user_id = 2; - } - repeated ReportCapability capabilities = 3; -} - message ReportDashboardDefinition { string title = 1; string description = 2; repeated ReportDashboardFilter filters = 3; repeated ReportPanel panels = 4; - repeated ReportGrant grants = 5; uint32 refresh_seconds = 6; repeated ReportDatasetVersionRef dataset_versions = 7; ReportPeriod period = 8; @@ -420,7 +402,6 @@ message ReportAssetSummary { uint64 published_version = 6; bool archived = 7; string updated_at = 8; - repeated ReportCapability capabilities = 9; } message ReportAsset { diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 359038c8..4f6594ee 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.analytics.rs b/common/src/proto/komp_ac.analytics.rs index 19214f9e..528332b7 100644 --- a/common/src/proto/komp_ac.analytics.rs +++ b/common/src/proto/komp_ac.analytics.rs @@ -389,25 +389,6 @@ pub struct ReportPanel { pub actions: ::prost::alloc::vec::Vec, } #[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct ReportGrant { - #[prost(enumeration = "ReportCapability", repeated, tag = "3")] - pub capabilities: ::prost::alloc::vec::Vec, - #[prost(oneof = "report_grant::Subject", tags = "1, 2")] - pub subject: ::core::option::Option, -} -/// Nested message and enum types in `ReportGrant`. -pub mod report_grant { - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] - pub enum Subject { - #[prost(string, tag = "1")] - Role(::prost::alloc::string::String), - #[prost(string, tag = "2")] - UserId(::prost::alloc::string::String), - } -} -#[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReportDashboardDefinition { #[prost(string, tag = "1")] @@ -418,8 +399,6 @@ pub struct ReportDashboardDefinition { pub filters: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "4")] pub panels: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "5")] - pub grants: ::prost::alloc::vec::Vec, #[prost(uint32, tag = "6")] pub refresh_seconds: u32, #[prost(message, repeated, tag = "7")] @@ -504,8 +483,6 @@ pub struct ReportAssetSummary { pub archived: bool, #[prost(string, tag = "8")] pub updated_at: ::prost::alloc::string::String, - #[prost(enumeration = "ReportCapability", repeated, tag = "9")] - pub capabilities: ::prost::alloc::vec::Vec, } #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1069,45 +1046,6 @@ impl ReportNullPolicy { #[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -pub enum ReportCapability { - Unspecified = 0, - View = 1, - Filter = 2, - Drill = 3, - Export = 4, - Customize = 5, -} -impl ReportCapability { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Unspecified => "REPORT_CAPABILITY_UNSPECIFIED", - Self::View => "REPORT_CAPABILITY_VIEW", - Self::Filter => "REPORT_CAPABILITY_FILTER", - Self::Drill => "REPORT_CAPABILITY_DRILL", - Self::Export => "REPORT_CAPABILITY_EXPORT", - Self::Customize => "REPORT_CAPABILITY_CUSTOMIZE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "REPORT_CAPABILITY_UNSPECIFIED" => Some(Self::Unspecified), - "REPORT_CAPABILITY_VIEW" => Some(Self::View), - "REPORT_CAPABILITY_FILTER" => Some(Self::Filter), - "REPORT_CAPABILITY_DRILL" => Some(Self::Drill), - "REPORT_CAPABILITY_EXPORT" => Some(Self::Export), - "REPORT_CAPABILITY_CUSTOMIZE" => Some(Self::Customize), - _ => None, - } - } -} -#[derive(serde::Serialize, serde::Deserialize)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] pub enum ReportExecutionPurpose { Unspecified = 0, View = 1, diff --git a/common/src/reporting.rs b/common/src/reporting.rs index 0783e29d..f14d6107 100644 --- a/common/src/reporting.rs +++ b/common/src/reporting.rs @@ -176,10 +176,6 @@ pub fn validate_draft(definition: &ReportDefinition) -> Result<(), String> { enum_value::(p.null_policy, "null policy")?; for action in &p.actions { action.target.as_ref().ok_or("An action target is required")?; } } - for g in &d.grants { - g.subject.as_ref().ok_or("A grant subject is required")?; - for c in &g.capabilities { enum_value::(*c, "capability")?; } - } if let Some(period) = &d.period { period.selection.as_ref().ok_or("A period selection is required")?; } if let Some(report_period::Selection::DateRange(range)) = d.period.as_ref().and_then(|p| p.selection.as_ref()) { enum_value::(range.end_boundary, "period end boundary")?; @@ -299,10 +295,9 @@ fn validate_dashboard(dashboard: &ReportDashboardDefinition) -> Result<(), Strin if dashboard.filters.len() > 32 || dashboard.panels.is_empty() || dashboard.panels.len() > 32 - || dashboard.grants.len() > 200 { return Err( - "Dashboards allow up to 32 filters, between 1 and 32 panels, and up to 200 grants" + "Dashboards allow up to 32 filters and between 1 and 32 panels" .into(), ); } @@ -421,30 +416,6 @@ fn validate_dashboard(dashboard: &ReportDashboardDefinition) -> Result<(), Strin } } } - let mut subjects = HashSet::new(); - for grant in &dashboard.grants { - let subject = grant - .subject - .as_ref() - .ok_or("A grant subject is required")?; - let value = match subject { - report_grant::Subject::Role(role) => role, - report_grant::Subject::UserId(user) => user, - }; - nonempty(value, "Grant subject", 128)?; - if !subjects.insert(subject) { - return Err("Duplicate report grant subject".into()); - } - let mut capabilities = HashSet::new(); - for capability in &grant.capabilities { - capabilities.insert(enum_value::(*capability, "capability")?); - } - if !capabilities.contains(&ReportCapability::View) - || capabilities.len() != grant.capabilities.len() - { - return Err("Report grants need View and unique capabilities".into()); - } - } Ok(()) } diff --git a/server b/server index 96339d88..07ee9087 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 96339d88c4322cc8957d28524fca757f7e4ba8fa +Subproject commit 07ee9087862d0a467aeccc72c9a69ee9a9f66a51