Skip to content

Commit 83c6e66

Browse files
chore: add more authz logging
Signed-off-by: Andrew Lilley Brinker <abrinker@mitre.org>
1 parent bec43ec commit 83c6e66

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/middleware/authz.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ function authz (check, overrideError = null) {
176176

177177
const error = await check.run(req)
178178

179+
logger.info({
180+
message: 'completed check',
181+
uuid: req.ctx.uuid
182+
})
183+
179184
if (error) {
180185
// Log the original error if we're overriding it.
181186
if (overrideError) {
@@ -723,6 +728,7 @@ function orgHasRole (...roles) {
723728
})
724729

725730
if (orgRoles.intersection(allowedRoles).size === 0) {
731+
logger.debug({ message: 'no matching roles found', uuid: req.ctx.uuid })
726732
return mwError.orgLacksRoles(req.ctx.org, roles)
727733
}
728734
}

0 commit comments

Comments
 (0)