West-Life Virtual Research Environment Docs
  • Introduction
  • Data Management
  • Virtual Folder
    • User's guide
      • Settings
        • Import settings from another Virtual Folder
      • File Manager
      • File Picker
      • Related applications
        • Jupyter notebook
      • Metadata
    • Installation guide
      • Cloud installation
      • Local installation
      • Integration with SSO
    • Integration guide
      • Select File or Dir from Virtual Folder
      • Working with WEBDAV
      • Embedding Virtual Folder Component
      • Adding component into Virtual Folder
    • Developer's guide
      • Backend
      • Frontend - Web Application
      • Metadata and API
        • Dataset metadata and API
        • File metadata and API
      • Import Export Settings API
      • Related application and services
      • Untitled
  • Virtual Machines and Containers
    • Preparing vagrant VM template
    • Preparing docker container
  • Repository
    • Installation guide
      • Prerequisites
      • Automatic installation
      • Manual installation from source codes
    • User's guide
      • Scientist imports project proposal
      • Staff uploads data
      • Scientist works with dataset
      • Metadata
    • Developer's guide
      • Metadata generation
      • ARIA integration
Powered by GitBook
On this page
  1. Virtual Folder
  2. Developer's guide

Import Export Settings API

PreviousFile metadata and APINextRelated application and services

Last updated 6 years ago

This section describes technical implementation of Importing Setting from one Virtual Folder to another. For user's guide follow .

Because user's credentials are transfered via network, the settings are encrypted. Virtual Folder API generates asymetric 2048 bytes long RSA key and random symetric AES key for each transfer.

The following workflow will export settings from Virtual Folder Exported (VFE) instance (at https://portal.west-life.eu/virtualfolder) into Virtual Folder Import (VFI) instance at http://localhost:8081/virtualfolder. During import process it's possible to rename imported aliases:

  • To get public key from VFI instance, send POST request to VFI api/settings .

POST http://localhost:8081/virtualfolder/api/settings
  • The public key is returned as plain text in response body:

    <RSAKeyValue>
      <Modulus>pUPMWrEajQ2...</Modulus>
      <Exponent>AQAB</Exponent>
    </RSAKeyValue>
  • To obtain selected file providers from VFE instance, put the names of aliases (e.g. dropbox and experiment_pcloud) into SelectedAliases query parameter and VFI public key into PublicKey query parameter and send it as GET request to VFE api/settings

GET https://portal.west-life.eu/virtualfolder/api/settings?PublicKey=
<RSAKeyValue><Modulus>pUPMWrEajQ2...</Modulus>
<Exponent>AQAB</Exponent></RSAKeyValue>
&SelectedAliases=dropbox;experiment_pcloud
  • The response body from VFE contain encrypted settings using the RSA public key and AES encryption

PBy4F6DjCDmUg1h3HxIpR2I6ABNl6kEDoVuN043C4f9GGFjmSd33tVZxWeC...
  • To import the encrypted settings into VFI, attach public key, encrypted settings, old name aliases from VFE as parameter ConflictedAliases and new names of aliases in the same order which will appear in VFI as parameter NewNameAliases and send it as PUT request with e.g. the following json body (this example will import VFE b2drop as VFI b2drop_test)

PUT http://localhost:8081/virtualfolder/api/settings
{
"PublicKey":"<RSAKeyValue><Modulus>pUPMWrEajQ2...",
"EncryptedSettings":"PBy4F6DjCDmUg1h3GGFjmSd33tVZxWeC...",
"ConflictedAliases":"b2drop",
"NewNameAliases":"b2drop_test"
}
  • The PUT request will return array of all registered aliases, where a new alias should appear at the end.

[{"Id":76,"alias":"filesystem","type":"FileSystem"},
{"Id":77,"alias":"b2drop_test","type":"B2Drop","username":"...","output":"..."}]

The above workflow is supported be backend web service wp6-virtualfolder/src/WP6Service2/WP6Service2/Services/Settings/SettingsExportImport.cs and VFI frontend ui wp6-virtualfolder/www/src/virtualfoldersetting/importprovider.html and VFE frontend ui wp6-virtualfolder/www/src/syncsetting/app.html.

Import settings from another Virtual Folder