diff --git a/lib/api/messages.js b/lib/api/messages.js index 41fdddd5..d7bd495e 100644 --- a/lib/api/messages.js +++ b/lib/api/messages.js @@ -139,7 +139,8 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti messageData.bimi = { certified: bimiData.type === 'authority', url: bimiData.url, - image: `data:image/svg+xml;base64,${bimiData.content.toString('base64')}` + image: `data:image/svg+xml;base64,${bimiData.content.toString('base64')}`, + type: bimiData.type === 'authority' ? bimiData.vmc?.type || 'VMC' : undefined }; } delete messageData.verificationResults.bimi; @@ -1112,7 +1113,8 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti bimi: Joi.object({ certified: booleanSchema.description('If true, then this logo is from a VMC file'), url: Joi.string().description('URL of the resource the logo was retrieved from'), - image: Joi.string().description('Data URL for the SVG image') + image: Joi.string().description('Data URL for the SVG image'), + type: Joi.string().valid('VMC', 'CMC').description('Certificate type (only for VMC files)') }).description('BIMI logo info. If logo validation failed in any way, then this property is not set'), contentType: Joi.object({ value: Joi.string().required().description('MIME type of the message, eg. "multipart/mixed'), @@ -1372,7 +1374,8 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti response.bimi = { certified: bimiData.type === 'authority', url: bimiData.url, - image: `data:image/svg+xml;base64,${bimiData.content.toString('base64')}` + image: `data:image/svg+xml;base64,${bimiData.content.toString('base64')}`, + type: bimiData.type === 'authority' ? bimiData.vmc?.type || 'VMC' : undefined }; } } catch (err) {