bliutech / SeBRUS

MIT IEEE URTC 2023. GSET 2023. Repository for "SeBRUS: Mitigating Data Poisoning in Crowdsourced Datasets with Blockchain". Using Ethereum smart contracts to stop AI security attacks on crowdsourced datasets.
https://ieeexplore.ieee.org/document/10535023
8 stars 0 forks source link

πŸš€ Feature[backend]: Implement `/api/dataset` Endpoint #10

Closed bliutech closed 1 year ago

bliutech commented 1 year ago

Use Case

For our application, we need to be able to easily track metadata about the contributed datasets so that we can easily know where our datasets are. This is because our initial implementation of our blockchain will have the Dataset smart contract for each dataset point to a unique address. We will also need to include some additional information about our datasets such as a description and title so that the dataset is easily searchable. We may extend this feature later on to include more information about datasets.

Proposed Solution

Below is a set of resources and a list of action items that will help with implementing this feature. There are some modifications that need to be made to the examples on the resources below in order to complete this feature. There are three files you will need to create/modify to complete this ticket: app.py, routes/dataset.py, and models/dataset.py. For similar instructions or references, check out the implementation of /api/user in #8.

Action Items

Here are some tests that can be done to verify the implementation of POST, GET, PUT, DELETE.

> curl -X POST -H 'Content-Type: application/json' -d '{ "name": "CIFAR10", "description": "CIFAR10 dataset", "address": "aaaabbbbccccdddd000011111222233334444"}' http://localhost:5000/api/dataset
> curl http://localhost:5000/api/dataset/0
> curl -X PUT -H 'Content-Type: application/json' -d '{ "name": "CIFAR10", "description": "CIFAR10 dataset edited", "address": "aaaabbbbccccdddd000011111222233334444"}' http://localhost:5000/api/dataset/0
> curl -X DELETE http://localhost:5000/api/dataset/0

Resources

https://flask.palletsprojects.com/en/2.3.x/#api-reference https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/quickstart/ https://github.com/bliutech/wikisafe/blob/main/server/app.py


This is a :rocket: Feature Request

bliutech commented 1 year ago

@ChL4859 I recommend checking out #23 if you need some guidance on how to implement this endpoint. πŸ˜„

bliutech commented 1 year ago

Quick update to the API implementation, for all response JSON add a status message.