Add ariadne-identity-proof header

This commit is contained in:
Yarmo Mackenbach 2022-09-10 09:59:08 +02:00
parent ab1542c7cf
commit 8629033702
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1
2 changed files with 7 additions and 0 deletions

View file

@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added ### Added
- h-card markup to profile pages (thanks to [caesar](https://codeberg.org/caesar) [PR#130](https://codeberg.org/keyoxide/keyoxide-web/pulls/130)) - h-card markup to profile pages (thanks to [caesar](https://codeberg.org/caesar) [PR#130](https://codeberg.org/keyoxide/keyoxide-web/pulls/130))
- `ariadne-identity-proof` header to profile pages
### Fixed ### Fixed
- Keybase profiles (thanks to [gonz0](https://codeberg.org/gonz0)) - Keybase profiles (thanks to [gonz0](https://codeberg.org/gonz0))

View file

@ -41,30 +41,35 @@ router.get('/sig', (req, res) => {
router.post('/sig', bodyParser, async (req, res) => { router.post('/sig', bodyParser, async (req, res) => {
const data = await generateSignatureProfile(req.body.signature) const data = await generateSignatureProfile(req.body.signature)
const title = utils.generatePageTitle('profile', data) const title = utils.generatePageTitle('profile', data)
res.set('ariadne-identity-proof', data.keyData.openpgp4fpr)
res.render('profile', { title: title, data: data, isSignature: true, signature: req.body.signature }) res.render('profile', { title: title, data: data, isSignature: true, signature: req.body.signature })
}) })
router.get('/wkd/:id', async (req, res) => { router.get('/wkd/:id', async (req, res) => {
const data = await generateWKDProfile(req.params.id) const data = await generateWKDProfile(req.params.id)
const title = utils.generatePageTitle('profile', data) const title = utils.generatePageTitle('profile', data)
res.set('ariadne-identity-proof', data.keyData.openpgp4fpr)
res.render('profile', { title: title, data: data }) res.render('profile', { title: title, data: data })
}) })
router.get('/hkp/:id', async (req, res) => { router.get('/hkp/:id', async (req, res) => {
const data = await generateHKPProfile(req.params.id) const data = await generateHKPProfile(req.params.id)
const title = utils.generatePageTitle('profile', data) const title = utils.generatePageTitle('profile', data)
res.set('ariadne-identity-proof', data.keyData.openpgp4fpr)
res.render('profile', { title: title, data: data }) res.render('profile', { title: title, data: data })
}) })
router.get('/hkp/:server/:id', async (req, res) => { router.get('/hkp/:server/:id', async (req, res) => {
const data = await generateHKPProfile(req.params.id, req.params.server) const data = await generateHKPProfile(req.params.id, req.params.server)
const title = utils.generatePageTitle('profile', data) const title = utils.generatePageTitle('profile', data)
res.set('ariadne-identity-proof', data.keyData.openpgp4fpr)
res.render('profile', { title: title, data: data }) res.render('profile', { title: title, data: data })
}) })
router.get('/keybase/:username/:fingerprint', async (req, res) => { router.get('/keybase/:username/:fingerprint', async (req, res) => {
const data = await generateKeybaseProfile(req.params.username, req.params.fingerprint) const data = await generateKeybaseProfile(req.params.username, req.params.fingerprint)
const title = utils.generatePageTitle('profile', data) const title = utils.generatePageTitle('profile', data)
res.set('ariadne-identity-proof', data.keyData.openpgp4fpr)
res.render('profile', { title: title, data: data }) res.render('profile', { title: title, data: data })
}) })
@ -76,6 +81,7 @@ router.get('/:id', async (req, res) => {
data = await generateHKPProfile(req.params.id) data = await generateHKPProfile(req.params.id)
} }
const title = utils.generatePageTitle('profile', data) const title = utils.generatePageTitle('profile', data)
res.set('ariadne-identity-proof', data.keyData.openpgp4fpr)
res.render('profile', { title: title, data: data }) res.render('profile', { title: title, data: data })
}) })