sergehuber opened a new pull request, #887:
URL: https://github.com/apache/unomi/pull/887

   ## Summary
   
   Up-port of #849 (UNOMI-973) onto master.
   
   A recurrent import or export that uses the `file` scheme must resolve inside 
the deployment's base directory (`config.import.baseDir` / 
`config.export.baseDir`) **and** under that tenant's subdirectory, 
`{baseDir}/{tenantId}`. A configuration with no tenant, or a tenant id that is 
not a single path segment, is refused rather than judged against the shared 
parent, so one tenant cannot read or write another's files.
   
   The rest of #849 is kept: a refused configuration is answered 400 and is not 
stored; one that was already stored is marked `INVALID_ENDPOINT` and recovers 
when its endpoint is acceptable again; `ftp`/`sftp`/`ftps` are unchanged except 
`localWorkDirectory`, which is a local path and is confined the same way. The 
one-shot upload is untouched. It already writes 
`{uploadDir}/{tenantId}/{importConfigId}.csv`.
   
   ## Test plan
   
   - [x] `mvn -pl 
extensions/router/router-api,extensions/router/router-core,extensions/router/router-rest
 -am test`
     - `FileEndpointContainmentTest` (52), including a shared base directory 
and another tenant's directory being refused, while each tenant keeps its own
     - `RefusedConfigurationStatusTest` (10)
     - `ConfigurationEndpointValidationTest` (14), including no tenant, another 
tenant's directory, and a body that omits the tenant and is judged against the 
caller
     - existing one-shot upload and role tests
   - [ ] Pax Exam import/export ITs (`ProfileImportSurfersIT`, 
`ProfileImportActorsIT`, `ProfileImportRankingIT`, `ProfileExportIT`, 
`ProfileImportExportContainmentIT`). Their files now live under 
`data/tmp/recurrent_import/itTestTenant` and 
`data/tmp/recurrent_export/itTestTenant`. Not run in this session.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to