restricted webxdc internet access (#3516)

* add request_internet_access manifest option

* test request_internet_access

* update CHANGELOG

* force warning when internet access is enabled

if internet access is enabled,
show a warning instead of the normal summary
(the internet access is currently mainly to test out integrations
as maps for video chat; the summary is dispensable in the cases currently)

* adapt json-rpc's WebxdcMessageInfo
This commit is contained in:
bjoern
2022-09-05 11:45:34 +02:00
committed by GitHub
parent 4b91a88bc9
commit 949370ad63
6 changed files with 92 additions and 8 deletions

View File

@@ -33,6 +33,8 @@ pub struct WebxdcMessageInfo {
/// defaults to an empty string.
/// Implementations may offer an menu or a button to open this URL.
source_code_url: Option<String>,
/// True if full internet access should be granted to the app.
internet_access: bool,
}
impl WebxdcMessageInfo {
@@ -47,6 +49,7 @@ impl WebxdcMessageInfo {
document,
summary,
source_code_url,
internet_access,
} = message.get_webxdc_info(context).await?;
Ok(Self {
@@ -55,6 +58,7 @@ impl WebxdcMessageInfo {
document: maybe_empty_string_to_option(document),
summary: maybe_empty_string_to_option(summary),
source_code_url: maybe_empty_string_to_option(source_code_url),
internet_access,
})
}
}