-
Notifications
You must be signed in to change notification settings - Fork 23
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
[FEAT]: Create an API for updating VC for an entity #743
Comments
Understanding: I should write API for Update the verfied Credentials for an entity and once VC is updated older VC should be revoked(canceled). Implementation steps: |
Today I have read about Verified credentials from documentation, refer util/sign API from RegistryUtilsController class and revoke API from RegistryEntityController class, try to create update API for VC but its not completed |
@srprasanna I have write @PutMapping API code in RegistryEntityController Class, have created updateExistingVC() in RegistryHelper class and implement that method. Created UPDATED_CREDENTIAL variable in Constants class and UPDATE_VC variable in Response class. there is no runtime or compilation error but whenever I tried to call the API through Postman its showing errormsg -"vc: do not exist". please help me for the same |
On today I have changed the code of RegistryControllerClass, firslty i have change the url and make it as " /api/v1/{entityName}/{entityId}/vc," and http request as POST I have called revokeExistingCredentials() of class registryHelper . but when I called the method in postman its showing error - "errmsg": "Unable to reach service: 400 Bad Request: [{"error": "Bad Request", "message": Bad request}]" |
Today, I have changed the code of the RegistryEntityController class. I have called the f revokeExistingCredentialMethod firstly. Then to call sign() of the SignatureService class i have declared map, got credentialTemplate from definition manager, put entityName as well and then called sign(requestBodyMap). by doing this my new os_signed data is created. just there is the issue with method updateEntity. there is the nullPointerException and error msg :Exception while updating vc for an entity. |
Sunbird RC - Working on create Update API for VC- Today I have used revokeAnEntity() instead of revokeExistingCredential() to revoke the existing ossigned data. |
Today I have created new function updateAnEntity in RegistryHelper class. in which I have passed a variable in which result of sign() is stored. means newly generated ossigned data has passed. and called that Method controller class. |
Yesterday I have changed the RegistryEntityController class and sign() removed in RegistryHepler class by creating function updateVc(). So in RegistryHelper updateVc(), is responsible for signing the entity data, adding the cryptographic signature to the JSON data, and then updating the entity in the registry by providing the updated JSON data to the registryService.updateEntity method.but when I calling API its showing error: unable to reach service, 400 bad request |
@Sreejit-K I have made chages in updateVC method is used to update the specified entity (identified by entityId) in the database with the new _osSignedData. The method ensures that the data is signed and follows the expected JSON structure before updating the entity. so the error: is solved and |
When I calling the API its showing response 200 Ok.but when I called revokeAnEntity() ossigned data is not becoming empty so trying for that so result can be correct |
@srprasanna @Sreejit-K @Renuka-S When I calling the API of put its showing response 200 Ok.Verified credential is getting updated , I have checked with get API and database also. Its working perfectly fine with database. But its not going to update in ElasticSearch. So do I need to update it in elasticsearch also? if yes then will work for that also |
Now When I call the put API for VC verified credential is getting updated in ES and DB , for that I need to downgrade the ES image as 6.6.0. But as per the discussion with holash he told me that we don't need to create new API for update VC we can make changes in existing API of update with entityId, we tried for that on today but there was several issues so we need to solve them |
When I calling the API its showing response 200 Ok.VC get updated in database and in ElasticSearch also. as per suggested by Holash will tried to use existing update API (using entity id) to update the VC instead of using this new API.and its working now |
Raised PR |
@holashchand can you review and close this after looking at the PR. |
Issue is resolved. |
What is the feature request for?
Registry Core
What problem/inconvenience (if any) will this feature solve?
An API to update the VC for a Entity. The older VC should be revoked.
Describe the feature clearly.
Create an API to update the VC for an entity. The older VC should be revoked.
The text was updated successfully, but these errors were encountered: