diff --git a/keyserver/src/utils/fc-cache.js b/keyserver/src/utils/fc-cache.js --- a/keyserver/src/utils/fc-cache.js +++ b/keyserver/src/utils/fc-cache.js @@ -1,6 +1,5 @@ // @flow -import { getCommConfig } from 'lib/utils/comm-config.js'; import { getFCNames as baseGetFCNames, type GetFCNames, @@ -9,19 +8,13 @@ import { FCCache } from 'lib/utils/fc-cache.js'; import { NeynarClient } from 'lib/utils/neynar-client.js'; -type NeynarConfig = { - +key: string, - +signerUUID?: string, - +neynarWebhookSecret?: string, -}; +import { getNeynarConfig } from './neynar-utils.js'; let getFCNames: ?GetFCNames; let neynarClient: ?NeynarClient; async function initFCCache() { - const neynarSecret = await getCommConfig({ - folder: 'secrets', - name: 'neynar', - }); + const neynarSecret = await getNeynarConfig(); + const neynarKey = neynarSecret?.key; if (!neynarKey) { return; diff --git a/keyserver/src/utils/neynar-utils.js b/keyserver/src/utils/neynar-utils.js new file mode 100644 --- /dev/null +++ b/keyserver/src/utils/neynar-utils.js @@ -0,0 +1,18 @@ +// @flow + +import { getCommConfig } from 'lib/utils/comm-config.js'; + +type NeynarConfig = { + +key: string, + +signerUUID?: string, + +neynarWebhookSecret?: string, +}; + +function getNeynarConfig(): Promise { + return getCommConfig({ + folder: 'secrets', + name: 'neynar', + }); +} + +export { getNeynarConfig };