-
Notifications
You must be signed in to change notification settings - Fork 305
Remove debug overhead on ACL #566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
debug('Authentication required') | ||
throw new HTTPError(401, `Access to ${this.resource} requires authorization`) | ||
} else { | ||
debug(`${mode} access denied for ${user}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a useful message, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, just not 8 times 😉 That's why I moved it here: https://github.com/solid/node-solid-server/pull/566/files#diff-b11433f1fb19c85e170915d27502d490R43
.then(() => next(), next) | ||
const userId = req.session.userId | ||
req.acl.can(userId, mode) | ||
.then(() => next(), err => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: can replace () => next()
with next
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't: the promise resolves to a non-falsy value (true
), and the first parameter of next
being truthy is interpreted as an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️ 🤦♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!!
* dz_oidc: (178 commits) Rename the idp option into multiuser (#570) Add a /public folder in new accounts (#569) Update Data Browser html file Remove debug overhead on ACL (#566) Fix requirement for additional verification logging in with WebID-TLS Add bootstrap.min.css.map to common/css/ Add current hash to redirect. (#562) Disable rejectUnauthorized on the WebID-TLS endpoint. (#561) Serve static common/ dir relative to __dirname Tweak account index page phrasing Remove solid:inbox from template Add support for external WebIDs registering with username & password Move RS options to oidc-auth-manager initialization Do not check for user header in oidc test Log whole error in error handler Expand error message for unverified web id Bump oidc-auth-manager dep to 0.12.0 Verify presence of test DNS entries. (#549) Expose WAC-Allow to browser clients. Remove async dependency. ...
Fixes #558, the debug output for the same action is now: