diff --git a/packages/access-api/src/config.js b/packages/access-api/src/config.js index 6e771428b..647ca9fa0 100644 --- a/packages/access-api/src/config.js +++ b/packages/access-api/src/config.js @@ -32,11 +32,14 @@ export function loadConfig(env) { } } + const DID = env.DID + const PRIVATE_KEY = vars.PRIVATE_KEY + const signer = configureSigner({ DID, PRIVATE_KEY }) return { DEBUG: boolValue(vars.DEBUG), ENV: parseRuntimeEnv(vars.ENV), - PRIVATE_KEY: vars.PRIVATE_KEY, + PRIVATE_KEY, POSTMARK_TOKEN: vars.POSTMARK_TOKEN, SENTRY_DSN: vars.SENTRY_DSN, LOGTAIL_TOKEN: vars.LOGTAIL_TOKEN, @@ -52,7 +55,8 @@ export function loadConfig(env) { // eslint-disable-next-line no-undef COMMITHASH: ACCOUNT_COMMITHASH, - DID: env.DID, + DID, + signer, // bindings METRICS: diff --git a/packages/access-api/src/utils/context.js b/packages/access-api/src/utils/context.js index 2e11e7744..d9e5c9490 100644 --- a/packages/access-api/src/utils/context.js +++ b/packages/access-api/src/utils/context.js @@ -1,7 +1,7 @@ import { Logging } from '@web3-storage/worker-utils/logging' import Toucan from 'toucan-js' import pkg from '../../package.json' -import { configureSigner, loadConfig } from '../config.js' +import { loadConfig } from '../config.js' import { Spaces } from '../kvs/spaces.js' import { Validations } from '../kvs/validations.js' import { Email } from './email.js' @@ -40,13 +40,11 @@ export function getContext(request, env, ctx) { commit: config.COMMITHASH, env: config.ENV, }) - - const signer = configureSigner(config) const url = new URL(request.url) const db = new D1QB(config.DB) return { log, - signer, + signer: config.signer, config, url, kvs: {