Skip to content

Commit

Permalink
Su/log2 (#1237)
Browse files Browse the repository at this point in the history
* Log statements

* log more
  • Loading branch information
ukstv authored Jul 30, 2024
1 parent 738839b commit 51b4a56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/auth/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export function parseAllowedDIDs(dids: string | undefined): Set<string> {
}

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
Expand All @@ -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`)
Expand Down

0 comments on commit 51b4a56

Please sign in to comment.