From 8149c2411c66b1f5a1980e4f42274e13a5ca88bc Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 13 Feb 2024 10:23:13 +0100 Subject: [PATCH] use id of credentials for du a index of revoke --- idhub/models.py | 2 +- idhub/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/idhub/models.py b/idhub/models.py index 83f30fb..3758183 100644 --- a/idhub/models.py +++ b/idhub/models.py @@ -590,7 +590,7 @@ class VerificableCredential(models.Model): on_delete=models.CASCADE, related_name='vcredentials', ) - revocationBitmapIndex = models.AutoField() + # revocationBitmapIndex = models.AutoField() def get_data(self, password): if not self.data: diff --git a/idhub/views.py b/idhub/views.py index bea0712..e5b90ce 100644 --- a/idhub/views.py +++ b/idhub/views.py @@ -114,7 +114,8 @@ def serve_did(request, did_id): revoked_credentials = did.vcredentials.filter(status=VerificableCredential.Status.REVOKED) revoked_credential_indexes = [] for credential in revoked_credentials: - revoked_credential_indexes.append(credential.revocationBitmapIndex) + revoked_credential_indexes.append(credential.id) + # revoked_credential_indexes.append(credential.revocationBitmapIndex) # TODO: Conditionally add "service" to DID document only if the DID has issued any VC revocation_bitmap = pyroaring.BitMap(revoked_credential_indexes) encoded_revocation_bitmap = base64.b64encode(zlib.compress(revocation_bitmap.serialize()))