use id of credentials for du a index of revoke

This commit is contained in:
Cayo Puigdefabregas 2024-02-13 10:23:13 +01:00
parent b7e64586f8
commit 8149c2411c
2 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

@ -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()))