-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Description
Currently, PIMO offers a command-line interface (CLI) for masking JSON data based on a configuration in a masking.yml file. To enhance its flexibility, I propose adding a dynamic API feature, introducing a new pimo serve command.
Proposed Features
- Addition of a new
pimo servecommand to start a dynamic API server. - Endpoint POST /context/ to dynamically create a context using a
masking.ymlfile.- Example request:
curl -X POST -H 'Content-Type: application/x-yaml' -d @'my-masking-file.yml' http://localhost:8080/context
- Example request:
- Endpoint POST /context/{contextID} to mask data based on a specific
masking.ymlfile for a context.- Example request:
curl -X POST -H 'Content-Type: application/json' -d @'input.json' http://localhost:8080/context/context-id
- Example request:
- Endpoint DELETE /context/{contextID} to delete a specific context.
- Example request:
curl -X DELETE http://localhost:8080/context/context-id
- Example request:
How to Test
- Run
pimo serveto start the dynamic API server. - Send POST requests to create a context, POST requests to mask data, and DELETE requests to delete a context using curl or a similar tool.
- Examples:
- Create context:
curl -X POST -H 'Content-Type: application/x-yaml' -d @'my-masking-file.yml' http://localhost:8080/context - Mask data:
curl -X POST -H 'Content-Type: application/json' -d @'input.json' http://localhost:8080/context/context-id - Delete context:
curl -X DELETE http://localhost:8080/context/context-id
- Create context:
- Examples:
Expected Results
- POST requests to create a context and mask data should return an HTTP 200 response with the masked data.
- DELETE requests to delete a context should return an HTTP 204 response on success.
Metadata
Metadata
Assignees
Labels
No labels