Skip to content

Commit

Permalink
fix(ref-imp): #1015 - Set deactivated metadata property
Browse files Browse the repository at this point in the history
Set deactivated DID document metadata property in resolution result of
deactivated DID.
  • Loading branch information
clehner committed Feb 18, 2022
1 parent becc264 commit 151be6f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/core/versions/1.0/DocumentComposer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ export default class DocumentComposer {
method: {
published
},
canonicalId: did
canonicalId: did,
deactivated: true
};
return {
'@context': DocumentComposer.resolutionObjectContextUrl,
Expand Down
3 changes: 2 additions & 1 deletion lib/core/versions/latest/DocumentComposer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ export default class DocumentComposer {
method: {
published
},
canonicalId: did
canonicalId: did,
deactivated: true
};
return {
'@context': DocumentComposer.resolutionObjectContextUrl,
Expand Down
3 changes: 2 additions & 1 deletion tests/core/DocumentComposer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ describe('DocumentComposer', async () => {
method: {
published
},
canonicalId: 'did:method:suffix'
canonicalId: 'did:method:suffix',
deactivated: true
});
});
});
Expand Down
1 change: 1 addition & 0 deletions tests/core/RequestHandler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ describe('RequestHandler', () => {
const response = await requestHandler.handleResolveRequest(anyDid);

expect(response.status).toEqual(ResponseStatus.Deactivated);
expect(response.body.didDocumentMetadata.deactivated).toEqual(true);
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/vectors/resolution/afterDeactivate.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
]
},
"didDocumentMetadata": {
"deactivated": true,
"method": {
"published": true
},
Expand Down

0 comments on commit 151be6f

Please sign in to comment.