Better show key

This commit is contained in:
Douglas Barone 2021-02-02 18:30:51 -04:00
parent 6d190bcc71
commit 9769298d94

View File

@ -2,7 +2,13 @@ import { decryptKey } from '../lib/paloalto'
import prisma from '../prisma'
const PAHost = {
key: parent => `${decryptKey(parent.encryptedKey).slice(0, 5)}*****`,
key: parent => {
const decryptedKey = decryptKey(parent.encryptedKey)
return `${decryptedKey.slice(0, 3)}*****${decryptedKey.slice(
decryptedKey.length - 4,
decryptedKey.length
)}`
},
owner: parent => prisma.user.findUnique({ where: { id: parent.ownerId } })
}