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

Remove self asserted claims (holder claims) vp statements #155

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions tests/4.13-verifiable-presentations.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,62 +111,3 @@ describe('Verifiable Presentations', function() {
});
}
});

// 4.12.4 Presentations Including Holder Claims https://w3c.github.io/vc-data-model/#presentations-including-holder-claims
describe('VP - Presentations Including Holder Claims', function() {
setupMatrix.call(this, match);
for(const [name, implementation] of match) {
const endpoints = new TestEndpoints({implementation, tag});

describe(name, function() {
beforeEach(addPerTestMetadata);

it('A verifiable presentation that includes a self-asserted verifiable ' +
'credential that is only secured using the same mechanism as the ' +
'verifiable presentation MUST include a holder property.',
async function() {
this.test.link = `https://w3c.github.io/vc-data-model/#presentations-including-holder-claims:~:text=A%20verifiable%20presentation%20that%20includes%20a%20self%2Dasserted%20verifiable%20credential%20that%20is%20only%20secured%20using%20the%20same%20mechanism%20as%20the%20verifiable%20presentation%20MUST%20include%20a%20holder%20property.`;
const selfAssertedNoHolder = await createLocalVp({
presentation: require(
'./input/presentation-self-asserted-vc-no-holder.json')
});
await assert.rejects(endpoints.verifyVp(
selfAssertedNoHolder
), 'Failed to reject a VP with self-asserted VC without holder.');
});

it('When a self-asserted verifiable credential is secured using the ' +
'same mechanism as the verifiable presentation, the value of the ' +
'issuer property of the verifiable credential MUST be identical to ' +
'the holder property of the verifiable presentation.',
async function() {
this.test.link = `https://w3c.github.io/vc-data-model/#presentations-including-holder-claims:~:text=When%20a%20self%2Dasserted%20verifiable%20credential%20is%20secured%20using%20the%20same%20mechanism%20as%20the%20verifiable%20presentation%2C%20the%20value%20of%20the%20issuer%20property%20of%20the%20verifiable%20credential%20MUST%20be%20identical%20to%20the%20holder%20property%20of%20the%20verifiable%20presentation.`;
const presentationHolderMatch = await createLocalVp({
presentation: require(
'./input/presentation-self-asserted-vc-ok.json')
});
await assert.doesNotReject(endpoints.verifyVp(
presentationHolderMatch
), 'Failed to verify a VP containing a self-asserted VC.');

const presentationHolderMismatch = await createLocalVp({
presentation: require(
'./input/presentation-self-asserted-vc-holder-mismatch.json')
});
await assert.rejects(endpoints.verifyVp(
presentationHolderMismatch
), 'Failed to reject a VP with self-asserted VC ' +
'with a holder/issuer mismatch.');

const presentationIssuerMismatch = await createLocalVp({
presentation: require(
'./input/presentation-self-asserted-vc-issuer-mismatch.json')
});
await assert.rejects(endpoints.verifyVp(
presentationIssuerMismatch
), 'Failed to reject a VP with self-asserted VC ' +
'with a holder/issuer mismatch.');
});
});
}
});