58web3 / re-action

GNU General Public License v3.0
0 stars 0 forks source link

[Swagger] 新規APIのSwagger定義 #31

Closed hanchenglin closed 11 months ago

hanchenglin commented 1 year ago

KR: 新規APIのSwagger定義 Miro: https://miro.com/app/board/uXjVMuLcdQE=/

Mediaの画面は下記の部分です。 image

KenYurino commented 1 year ago

@hanchenglin FrontendからBackendへのVCの取得や検証の際に、同期して動作するのか、非同期で動作するのか、どちらを想定していますでしょうか?

同期であれば、Backend内でCallbackの受付を行い、VCが発行できたら返却しますが、待ち時間が必要です 非同期であれば、VCを一旦DBに保存して、Frontendからのリクエストに応じて返却する、と言った処理が想定されます

hanchenglin commented 1 year ago

@hanchenglin FrontendからBackendへのVCの取得や検証の際に、同期して動作するのか、非同期で動作するのか、どちらを想定していますでしょうか?

同期であれば、Backend内でCallbackの受付を行い、VCが発行できたら返却しますが、待ち時間が必要です 非同期であれば、VCを一旦DBに保存して、Frontendからのリクエストに応じて返却する、と言った処理が想定されます

@KenYurino ありがとうございます。 以前サンプルで試した際にはFrontendが繰り返しAPIを読んでサーバの状態を確認しているようですが、 非同期のようですが、詳細処理はコードを理解する必要があります。

>非同期であれば、VCを一旦DBに保存して、Frontendからのリクエストに応じて返却する、と言った処理が想定されます VC自体はブラウザのStorageに保存すると村上さんの話があって、詳細は別途検討しましょう。 APIはサンプルコードのように定義いただくと、Frontendからみやすいと思います。

KenYurino commented 1 year ago

@hanchenglin @maihao1997 Request VCのシーケンス図はこんな感じでしょうか? Would a Request VC sequence diagram look like this?

Request VC drawio https://drive.google.com/file/d/14G58MBwdRDTF9iVVNJ0t8AiEfAr6Wc5G/view?usp=sharing

maihao1997 commented 1 year ago

@hanchenglin What do you think? @KenYurino by the way, let me ask you that after I call v1/issuer/issuance-request the result is like this, but don't know how to call back to our server. Can you help me? This is my first time working with VC so I don't understand how it works.

{
    "message": "Success",
    "data": {
        "requestId": "d0605050-2f95-474d-9fee-86a2a9d2c214",
        "url": "openid-vc://?request_uri=https://verifiedid.did.msidentity.com/v1.0/tenants/766072a8-e18b-4139-b3f4-4bbc875ff40b/verifiableCredentials/issuanceRequests/d0605050-2f95-474d-9fee-86a2a9d2c214",
        "expiry": 1692698583
    }
}
hanchenglin commented 1 year ago

@KenYurino @maihao1997 Hi! The above sequence isn't just one conversation. There is 4 steps in https://github.com/Azure-Samples/active-directory-verifiable-credentials-node

maihao1997 commented 1 year ago

@hanchenglin @KenYurino after calling Issuance in step 1. I get a QR code and url. I then scan and expect it to call the Release Callback but it gives the following error, do you know the reason?

log: IMG_5019

\"error\\\":{\\\"code\\\":\\\"notFound\\\",\\\"message\\\":\\\"The requested resource does not exist.\\\",\\\"innererror\\\":{\\\"code\\\":\\\"notFound\\\",\\\"message\\\":\\\"Request with requestId \\\'f14d4860-e4ed-4a1b-b85a-a5990ddadd46\\\' not found.\\\"}}}\", statusCode: 404))"
KenYurino commented 1 year ago

@maihao1997 (@hanchenglin )

The Callback destination must be implemented in Backend. Backend is described separately in the sequence diagram.

It is assumed that processing is performed in separate threads as shown below. Specify the Endpoint of the Backend as the Callback destination at the time of Request. Request VC drawio (1)

maihao1997 commented 1 year ago

@KenYurino (@hanchenglin ) Hi! I have a question where the callback is in the sequence diagram. According to the diagram you describe, after calling api /api/issuer/issurance-request, the callback will be received. But I look through the demo code and it returns the url or QR Code. Then the user scans that QR code to receive the callback function from the VC. Can you tell me how our implementation differs from the sample code documentation. image

maihao1997 commented 1 year ago

@KenYurino cc @hanchenglin Hi! Can you suggest how to define table to store data from callback?

hanchenglin commented 1 year ago

@KenYurino cc @hanchenglin Hi! Can you suggest how to define table to store data from callback?

@maihao1997 Hi! Can you create PR with all api? I will confirm logic weekend

maihao1997 commented 1 year ago

@hanchenglin Hi! I created PR with all api. Please confirm logic and get me your feedbacks. Thank you! https://github.com/58web3/re-action/pull/43

hanchenglin commented 11 months ago

phares1 close