mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
feat(phisherman): assume master API key is always valid
This commit is contained in:
parent
901a723080
commit
ac03711574
1 changed files with 4 additions and 0 deletions
|
@ -184,6 +184,10 @@ export async function getPhishermanDomainInfo(domain: string): Promise<Phisherma
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function phishermanApiKeyIsValid(apiKey: string): Promise<boolean> {
|
export async function phishermanApiKeyIsValid(apiKey: string): Promise<boolean> {
|
||||||
|
if (apiKey === MASTER_API_KEY) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const keyCache = getKeyCacheRepository();
|
const keyCache = getKeyCacheRepository();
|
||||||
const hash = crypto.createHash("sha256").update(apiKey).digest("hex");
|
const hash = crypto.createHash("sha256").update(apiKey).digest("hex");
|
||||||
const entry = await keyCache.findOne({ hash });
|
const entry = await keyCache.findOne({ hash });
|
||||||
|
|
Loading…
Add table
Reference in a new issue