forked from Mirrors/doipjs
Remove message proof format
This commit is contained in:
parent
24b06d5d4c
commit
bdcff2ec89
15 changed files with 13 additions and 22 deletions
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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']
|
||||||
}
|
}
|
||||||
|
|
|
@ -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: []
|
||||||
}
|
}
|
||||||
|
|
|
@ -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: []
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue