3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

feat(phisherman): assume master API key is always valid

This commit is contained in:
Dragory 2021-11-02 22:16:06 +02:00
parent 901a723080
commit ac03711574
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -184,6 +184,10 @@ export async function getPhishermanDomainInfo(domain: string): Promise<Phisherma
}
export async function phishermanApiKeyIsValid(apiKey: string): Promise<boolean> {
if (apiKey === MASTER_API_KEY) {
return true;
}
const keyCache = getKeyCacheRepository();
const hash = crypto.createHash("sha256").update(apiKey).digest("hex");
const entry = await keyCache.findOne({ hash });