30 Here is a first fragment of code to address the export of ODK Central's encrypted projects
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(.)
Roxygen2 documentation: I need to update the documentation of the passphrase pp argument in submission_export.R. Should I create a new roxygen template param-enc or would you prefer that this information is added to pre-existing templates?
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.
Double checks - ruODK::submission_get does not allow accessing the submission details, but retrieves encryption metadata
Double checks - ruODK::odata_submission_get does not return any error, but indeed only metadata are returned. I think it would make sense to update the function with a warning when handling encrypted projects?
Looking forward to your feedback / suggestions when you are back from the field. In particular, let me know if I missed something or what could be improved. In the meantime, I will continue to draft a short version of the vignette to demonstrate how ruODK workflow would work with ODK Central's encrypted projects.
Hi @florianm,
30 Here is a first fragment of code to address the export of ODK Central's encrypted projects
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:
Roxygen2 documentation: I need to update the documentation of the passphrase pp argument in submission_export.R. Should I create a new roxygen template
param-enc
or would you prefer that this information is added to pre-existing templates?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.
Double checks - ruODK::submission_get does not allow accessing the submission details, but retrieves encryption metadata![image](https://user-images.githubusercontent.com/71643277/100554788-5a37f800-3297-11eb-8312-05e354551b3c.png)
Double checks - ruODK::odata_submission_get does not return any error, but indeed only metadata are returned. I think it would make sense to update the function with a warning when handling encrypted projects?![image](https://user-images.githubusercontent.com/71643277/100554329-3aeb9b80-3294-11eb-9783-318ca0680111.png)
Looking forward to your feedback / suggestions when you are back from the field. In particular, let me know if I missed something or what could be improved. In the meantime, I will continue to draft a short version of the vignette to demonstrate how ruODK workflow would work with ODK Central's encrypted projects.