Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vignette encryption #112

Open
florianm opened this issue Dec 10, 2020 · 0 comments
Open

Vignette encryption #112

florianm opened this issue Dec 10, 2020 · 0 comments
Assignees
Labels
documentation Package and function level documentation

Comments

@florianm
Copy link
Collaborator

florianm commented Dec 10, 2020

Feature

A new vignette demonstrating workflows around encrypted forms would add context and value for ruODK users.
@Thaliehln is preparing a draft, the following are some ideas extracted from #110

Generic workflow

The updated ruODK::submission_export should now export data from both encrypted projects and non-encrypted projects.
HTTP method is changed from GET to POST and encryption key ID / passphrase are provided via POST body using a JSON format. You can unzip and inspect encrypted forms using the same routine as for non-encrypted forms:

se <- submission_export()
t <- tempdir()
f <- unzip(se, exdir = t)
fs::dir_ls(t)
fid <- get_test_fid()
sub <- fs::path(t, glue::glue("Locations.csv")) %>% readr::read_csv()
sub %>% knitr::kable(.)

Handling multiple encrypted forms with different passphrases

About multiple passphrases, I need to better understand in which scenarios we may have more than one encryption key. In the current version of the code, the selection of the first encryption key ID is hard-coded, but this is not very robust and I am wondering if using a dictionary would not be a more elegant / generic way of managing multiple passphrases.

As an option, but not a prescription, environment variables are generally a good place for sensitive information. Short of using dedicated secret managers, I'd demonstrate a mockup (doesn't have to send real requests) using several passphrases from several env vars via pp = Sys.getenv("..."), and refer to https://cran.r-project.org/web/packages/httr/vignettes/secrets.html for more advanced options of managing secrets.

submission_get example

ruODK::submission_get does not allow accessing the submission details, but retrieves encryption metadata

odata_submission_get example

ruODK::odata_submission_get does not return any error, but indeed only metadata are returned.

@florianm florianm added the feature a feature request or enhancement label Dec 10, 2020
@florianm florianm self-assigned this Dec 10, 2020
@florianm florianm added this to the Release 1.0 milestone Dec 10, 2020
@florianm florianm mentioned this issue Dec 10, 2020
2 tasks
@florianm florianm added documentation Package and function level documentation and removed feature a feature request or enhancement labels May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Package and function level documentation
Projects
None yet
Development

No branches or pull requests

1 participant