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

Updates to status list 2021 PR #486

Merged

Conversation

thehenrytsai
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Apr 5, 2024

⚠️ No Changeset found

Latest commit: ad5e0d8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

*/
export type StatusListCredentialCreateOptions = {
statusListCredentialId: string,
issuer: string,
statusPurpose: StatusPurpose,
issuedCredentials: VerifiableCredential[]
revokedCredentials: VerifiableCredential[]
Copy link
Contributor

@nitro-neal nitro-neal Apr 6, 2024

Choose a reason for hiding this comment

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

A credential can be revoked, suspeneded, or any other word actually. Status Purpose should actually probably just be a string.

so maybe a better name is includedCredentials

Copy link
Contributor Author

@thehenrytsai thehenrytsai Apr 6, 2024

Choose a reason for hiding this comment

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

Good point, though the action of suspend or revoke result in the same bit flip to 1, this would probably go away if you decide to take my other PR suggestion of have revoke(), for now I'll rename to credentialsToDisable. Happy to discuss but I don't think includedCredentials is it.

const statusListIndexes: string[] = this.prepareCredentialsForStatusList(statusPurpose, issuedCredentials);
const bitString = this.bitstringGeneration(statusListIndexes);
const { statusListCredentialId, issuer, statusPurpose, revokedCredentials } = options;
const indexOfCredentialsToRevoke: number[] = this.validateStatusListEntryIndexesAreAllUnique(statusPurpose, revokedCredentials);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const indexOfCredentialsToRevoke: number[] = this.validateStatusListEntryIndexesAreAllUnique(statusPurpose, revokedCredentials);
const indexsOfCredentialsToRevoke: number[] = this.validateStatusListEntryIndexesAreAllUnique(statusPurpose, revokedCredentials);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, done!

*/
export interface StatusList2021Entry extends ICredentialStatus {
export interface CredentialStatusModel {
Copy link
Contributor

Choose a reason for hiding this comment

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

Following our spec, and for clarity I think it should e called StatusList2021Entry

https://github.com/TBD54566975/web5-spec/blob/main/spec/vc.md

There is a different credStatusModel that will be for vc data model 2.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted! I had strong opinion on this, but you win on this one! We can chat about it next week.

@nitro-neal
Copy link
Contributor

Looks good, little nits, and we can sync on some nuances next week if needed. Thanks for this!

@thehenrytsai thehenrytsai merged commit 7b8aa39 into status-list-credential-impl Apr 6, 2024
@thehenrytsai thehenrytsai deleted the henrytsai/status-list-update branch April 6, 2024 01:07
nitro-neal added a commit that referenced this pull request May 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
* status list cred impl

* pnpm install

* fix linter

* test vector

* update

* update

* Updates to status list 2021 PR (#486)

* updates

* updates

* updating timeout

* updates

* add changeset

* update

* Delete packages/credentials/.vscode/settings.json

* update

* update

* lint

* update

* lint

* doc warning

* Exported status list related libs

* Docs

---------

Co-authored-by: Henry Tsai <henrytsai@outlook.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants