Remove message proof format

This commit is contained in:
Yarmo Mackenbach 2022-08-16 21:46:54 +02:00
parent 24b06d5d4c
commit bdcff2ec89
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1
15 changed files with 13 additions and 22 deletions

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: ['body_markdown'] path: ['body_markdown']
} }

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: ['user', 'bio_raw'] path: ['user', 'bio_raw']
} }

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.EQUALS, relation: E.ClaimRelation.EQUALS,
path: ['description'] path: ['description']
} }

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: ['files', 'openpgp.md', 'content'] path: ['files', 'openpgp.md', 'content']
} }

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.EQUALS, relation: E.ClaimRelation.EQUALS,
path: ['description'] path: ['description']
} }

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: ['statements', 'content'] path: ['statements', 'content']
} }

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: ['about'] path: ['about']
} }

View file

@ -61,7 +61,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: ['content', 'body'] path: ['content', 'body']
} }

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: ['data', 'children', 'data', 'selftext'] path: ['data', 'children', 'data', 'selftext']
} }

View file

@ -49,7 +49,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: ['items', 'about_me'] path: ['items', 'about_me']
} }

View file

@ -46,7 +46,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: [] path: []
} }

View file

@ -47,7 +47,7 @@ const processURI = (uri) => {
} }
}, },
claim: { claim: {
format: E.ClaimFormat.MESSAGE, format: E.ClaimFormat.URI,
relation: E.ClaimRelation.CONTAINS, relation: E.ClaimRelation.CONTAINS,
path: [] path: []
} }

View file

@ -95,9 +95,7 @@ const ClaimFormat = {
/** `openpgp4fpr:123123123` */ /** `openpgp4fpr:123123123` */
URI: 0, URI: 0,
/** `123123123` */ /** `123123123` */
FINGERPRINT: 1, FINGERPRINT: 1
/** `[Verifying my OpenPGP key: openpgp4fpr:123123123]` */
MESSAGE: 2
} }
Object.freeze(ClaimFormat) Object.freeze(ClaimFormat)

View file

@ -56,8 +56,6 @@ const generateClaim = (fingerprint, format) => {
switch (format) { switch (format) {
case E.ClaimFormat.URI: case E.ClaimFormat.URI:
return `openpgp4fpr:${fingerprint}` return `openpgp4fpr:${fingerprint}`
case E.ClaimFormat.MESSAGE:
return `[Verifying my OpenPGP key: openpgp4fpr:${fingerprint}]`
case E.ClaimFormat.FINGERPRINT: case E.ClaimFormat.FINGERPRINT:
return fingerprint return fingerprint
default: default:

View file

@ -28,11 +28,6 @@ describe('utils.generateClaim', () => {
doipjs.utils.generateClaim('123456789', doipjs.enums.ClaimFormat.URI) doipjs.utils.generateClaim('123456789', doipjs.enums.ClaimFormat.URI)
).to.equal('openpgp4fpr:123456789') ).to.equal('openpgp4fpr:123456789')
}) })
it('should generate a correct "message" claim', () => {
expect(
doipjs.utils.generateClaim('123456789', doipjs.enums.ClaimFormat.MESSAGE)
).to.equal('[Verifying my OpenPGP key: openpgp4fpr:123456789]')
})
it('should generate a correct "fingerprint" claim', () => { it('should generate a correct "fingerprint" claim', () => {
expect( expect(
doipjs.utils.generateClaim( doipjs.utils.generateClaim(