mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
chore(connlib): support can_be_disabled from the portal for internet resource (#6396)
In preparation for #6299 --------- Signed-off-by: Gabi <gabrielalejandro7@gmail.com> Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
@@ -78,9 +78,11 @@ impl ResourceDescriptionCidr {
|
||||
pub struct ResourceDescriptionInternet {
|
||||
/// Resource's id.
|
||||
pub id: ResourceId,
|
||||
// TBD
|
||||
/// Sites for the internet resource
|
||||
#[serde(rename = "gateway_groups")]
|
||||
pub sites: Vec<Site>,
|
||||
/// Whether or not resource can be disabled from UI
|
||||
pub can_be_disabled: Option<bool>,
|
||||
}
|
||||
|
||||
impl ResourceDescriptionInternet {
|
||||
@@ -90,7 +92,7 @@ impl ResourceDescriptionInternet {
|
||||
address: "All internet addresses".to_string(),
|
||||
id: self.id,
|
||||
sites: self.sites,
|
||||
can_be_disabled: false,
|
||||
can_be_disabled: self.can_be_disabled.unwrap_or_default(),
|
||||
status,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,13 @@ pub fn cidr_resource(
|
||||
pub fn internet_resource(
|
||||
sites: impl Strategy<Value = Vec<Site>>,
|
||||
) -> impl Strategy<Value = ResourceDescriptionInternet> {
|
||||
(resource_id(), sites).prop_map(move |(id, sites)| ResourceDescriptionInternet { id, sites })
|
||||
(resource_id(), sites, any::<bool>()).prop_map(move |(id, sites, can_be_disabled)| {
|
||||
ResourceDescriptionInternet {
|
||||
id,
|
||||
sites,
|
||||
can_be_disabled: Some(can_be_disabled),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn address_description() -> impl Strategy<Value = Option<String>> {
|
||||
|
||||
Reference in New Issue
Block a user