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

feat(vc): delete w3c credential record #886

Conversation

karimStekelenburg
Copy link
Contributor

This PR adds a method to the W3cCredentialService to remove a credential record from storage. I also renamed a few properties and methods because their previous names were somewhat misleading.

  • feat: add method to remove w3c credential
  • refactor: rename methods and props for consistancy

berendsliedrecht and others added 9 commits June 17, 2022 15:43
Signed-off-by: Berend Sliedrecht <berend@animo.id>
Signed-off-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: Karim <karim@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Karim <karim@animo.id>
Signed-off-by: Karim <karim@animo.id>
@karimStekelenburg karimStekelenburg requested a review from a team as a code owner June 19, 2022 18:49
@karimStekelenburg karimStekelenburg changed the title feat/delete w3c credential record feat: delete w3c credential record Jun 19, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 19, 2022

Codecov Report

Merging #886 (351d435) into 0.3.0-pre (0f4cc18) will increase coverage by 0.03%.
The diff coverage is 77.77%.

@@              Coverage Diff              @@
##           0.3.0-pre     #886      +/-   ##
=============================================
+ Coverage      87.28%   87.32%   +0.03%     
=============================================
  Files            562      562              
  Lines          13272    13274       +2     
  Branches        2142     2142              
=============================================
+ Hits           11584    11591       +7     
+ Misses          1684     1679       -5     
  Partials           4        4              
Impacted Files Coverage Δ
...ckages/core/src/modules/vc/W3cCredentialService.ts 80.29% <77.77%> (+3.99%) ⬆️

@karimStekelenburg
Copy link
Contributor Author

Because the CI is still testing against Node v14 the tests are failing. Since the 0.3.0-pre branch itself already contains the Node v14 incompatible code I guess it's OK to merge this one, but I'd like to double check. @TimoGlastra, thoughts?

@TimoGlastra
Copy link
Contributor

You mean Node 12?

This has already been removed in main, so if we rebase 0.3.0 with main we can see if CI now fully passess

packages/core/src/modules/vc/W3cCredentialService.ts Outdated Show resolved Hide resolved
}

public async getCredentialById(id: string): Promise<W3cVerifiableCredential> {
return (await this.w3cCredentialRepository.getById(id)).credential
public async getAllCredentialRecords(): Promise<W3cCredentialRecord[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use this in all other services/modules (just getAll instead of getAllCredentials, getAllCredentialRecords). Do you think this helps? If so we should probably change this in all methods

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get your point in terms of consistency. However, I consciously did this because the W3cCredentialService deals with more than credential records. For example, there is a signPresentation() method and a getSignatureSuitesForCredential(). It seems a bit odd to me to specify the data model in some method names, but leave it out in others.

I'm fine with changing it though. However, in that case it would make sense to me to rename W3cCredentialService to W3cCredentialRecordService. Then at least the class name gives you a hint of what getAll() actually returns.

karimStekelenburg and others added 8 commits July 20, 2022 23:58
Co-authored-by: Timo Glastra <timo@animo.id>
Signed-off-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: Karim <karim@animo.id>
Signed-off-by: Karim <karim@animo.id>
Co-authored-by: Timo Glastra <timo@animo.id>
Signed-off-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
@TimoGlastra
Copy link
Contributor

Merging as only failing test is the bbs test

@TimoGlastra TimoGlastra changed the title feat: delete w3c credential record feat(vc): delete w3c credential record Jul 21, 2022
@TimoGlastra TimoGlastra merged commit 72a11e3 into openwallet-foundation:0.3.0-pre Jul 21, 2022
@TimoGlastra TimoGlastra deleted the feat/delete-w3c-credential-record branch July 21, 2022 12:05
TimoGlastra pushed a commit that referenced this pull request Aug 11, 2022
Signed-off-by: Karim <karim@animo.id>
TimoGlastra pushed a commit that referenced this pull request Aug 26, 2022
Signed-off-by: Karim <karim@animo.id>
TimoGlastra pushed a commit that referenced this pull request Aug 26, 2022
Signed-off-by: Karim <karim@animo.id>
genaris pushed a commit to 2060-io/aries-framework-javascript that referenced this pull request Sep 16, 2022
Signed-off-by: Karim <karim@animo.id>
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants