https://github.com/dirkschumacher/ContentSecurityPolicy
Content Security Policies for Shiny Apps
https://github.com/dirkschumacher/ContentSecurityPolicy
Last synced: 4 months ago
JSON representation
Content Security Policies for Shiny Apps
- Host: GitHub
- URL: https://github.com/dirkschumacher/ContentSecurityPolicy
- Owner: dirkschumacher
- License: other
- Created: 2019-12-31T16:18:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-31T16:22:10.000Z (over 5 years ago)
- Last Synced: 2024-11-19T12:18:26.041Z (5 months ago)
- Language: R
- Size: 5.86 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - dirkschumacher/ContentSecurityPolicy - Content Security Policies for Shiny Apps (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ContentSecurityPolicy[](https://www.tidyverse.org/lifecycle/#experimental)
The goal of `ContentSecurityPolicy` is provide a DSL and helpers functions for defining [Content Security Policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP#) to make your Web-Apps more secure.
> Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement to distribution of malware.
*WORK IN PROGRESS - DO NOT USE IN PRODUCTION*
Feedback and contributors welcome!
## Installation
You can install the released version of ContentSecurityPolicy from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("ContentSecurityPolicy")
remotes::install_github("dirkschumacher/ContentSecurityPolicy")
```## Example
Take a look at the example shiny app in the `inst/examples` directory.
```{r example}
library(ContentSecurityPolicy)csp <- content_security_policy(
default_src(self),
script_src(self, unsafe_inline),
style_src(self, unsafe_inline),
img_src(self, "data:")
)print(as_shiny_meta_tag(csp))
```