Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getSecretKeys feature and change getSecretKey uri #78

Open
gyuguen opened this issue Jan 20, 2023 · 0 comments
Open

Add getSecretKeys feature and change getSecretKey uri #78

gyuguen opened this issue Jan 20, 2023 · 0 comments
Assignees

Comments

@gyuguen
Copy link
Contributor

gyuguen commented Jan 20, 2023

Background

We currently allow consumers to get deal_id and data_hash from deal and secretKey one by one.
However, there can be multiple data in a deal, and it is inconvenient for consumers to bring these one by one.
Therefore, we develop an API that can return multiple secretKeys.

Also, I want to change the uri of the API to get the secretKey.
Currently we have a uri configured as /v0/secretKey?deal_id={dealID}&data_hash={dataHash}.
However, since this secretKey belongs to the deal, I think it should be changed as follows.

  • multiple search: /v0/datadeal/deals/{deal_id}/secret-keys
  • one search: /v0/datadeal/deals/{deal_id}/secret-keys/{data_hash}

Implement

GetSecretKeys

Request

GET /v0/datadeal/deals/{deal_id}/secret-keys?offset={offset}&limit={limit}
# Authorization: Bearer {jwtToken}
# Content-Type: application/json

Response

{
  "secret_keys":[
    {
      "deal_id": 0,
      "data_hash": "",
      "cid": "",
      "encrypted_secret_key": ""
    }
  ],
  "page": {
    "offset": 0,
    "limit": 100
  }
}

GetSecretKey

Request

GET /v0/datadeal/deals/{deal_id}/secret-keys/{data_hash}
# Authorization: Bearer {jwtToken}
# Content-Type: application/json

Response

{
      "deal_id": 0,
      "data_hash": "",
      "cid":"",
      "encrypted_secret_key": ""
}
@gyuguen gyuguen added this to the v2.1.1-beta milestone Jan 20, 2023
@gyuguen gyuguen self-assigned this Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant