From 51b4a5687a82838a32af20cdf919ef543fc25349 Mon Sep 17 00:00:00 2001 From: Sergey Ukustov Date: Tue, 30 Jul 2024 03:18:31 +0300 Subject: [PATCH] Su/log2 (#1237) * Log statements * log more --- src/auth/auth.middleware.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/auth/auth.middleware.ts b/src/auth/auth.middleware.ts index 6512a960..81014702 100644 --- a/src/auth/auth.middleware.ts +++ b/src/auth/auth.middleware.ts @@ -40,7 +40,9 @@ export function parseAllowedDIDs(dids: string | undefined): Set { } export function auth(opts: AuthOpts): Handler { + console.log('opts.allowedDIDs.0', Array.from(opts.allowedDIDs)) const hasAllowedDIDsList = opts.allowedDIDs.size > 0 + console.log('opts.allowedDIDs.hasAllowedDIDsList', hasAllowedDIDsList) /** * @dev If the request has a did header, it means we have already confirmed the did @@ -61,6 +63,7 @@ export function auth(opts: AuthOpts): Handler { const digest = buildBodyDigest(req.header('Content-Type'), req.body) if (req.header('digest') === digest) { ServiceMetrics.count(METRIC_NAMES.AUTH_ALLOWED, 1, { did: didFromHeader }) + console.log(`Allowed: Auth lambda: ${didFromHeader}`) return next() } else { console.log(`Disallowed: Auth lambda: Invalid digest`)