mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
Fix previous commit
This commit is contained in:
parent
cd7f3dfd8d
commit
fa73b062fa
2 changed files with 4 additions and 14 deletions
13
src/keys.js
13
src/keys.js
|
@ -246,18 +246,9 @@ exports.process = (publicKey) => {
|
|||
|
||||
if ('selfCertifications' in user && user.selfCertifications.length > 0) {
|
||||
const notations = user.selfCertifications[0].rawNotations
|
||||
usersOutput[i].notations = notations
|
||||
usersOutput[i].claims = notations
|
||||
.filter(({ name, humanReadable }) => humanReadable && name === 'proof@metacode.biz')
|
||||
.map(({ value }) => openpgp.util.decode_utf8(value))
|
||||
|
||||
usersOutput[i].claims = notations.map(
|
||||
({ name, value, humanReadable }) => {
|
||||
if (humanReadable && name === 'proof@metacode.biz') {
|
||||
const notation = openpgp.util.decode_utf8(value)
|
||||
return new Claim(notation, fingerprint)
|
||||
}
|
||||
}
|
||||
)
|
||||
.map(({ value }) => new Claim(openpgp.util.decode_utf8(value)), fingerprint)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -141,9 +141,8 @@ describe('keys.process', () => {
|
|||
it('should ignore non-proof notations', async () => {
|
||||
const pubKey = await doipjs.keys.fetchPlaintext(pubKeyWithOtherNotations)
|
||||
const obj = await doipjs.keys.process(pubKey)
|
||||
console.log(obj.users[0]);
|
||||
expect(obj.users).to.be.lengthOf(1)
|
||||
expect(obj.users[0].notations).to.be.lengthOf(1)
|
||||
expect(obj.users[0].notations[0]).to.be.equal('dns:yarmo.eu?type=TXT')
|
||||
expect(obj.users[0].claims).to.be.lengthOf(1)
|
||||
expect(obj.users[0].claims[0].uri).to.be.equal('dns:yarmo.eu?type=TXT')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue