Skip to content

Remove debug overhead on ACL - #566

Merged
RubenVerborgh merged 1 commit into
dz_oidcfrom
fix/acl-less-debug
Aug 31, 2017
Merged

Remove debug overhead on ACL#566
RubenVerborgh merged 1 commit into
dz_oidcfrom
fix/acl-less-debug

Conversation

@RubenVerborgh

Copy link
Copy Markdown
Contributor

Fixes#558, the debug output for the same action is now:

 solid:ACL Check if ACL exists: https://localhost:8443/profile/card.acl +6s
solid:ACL Permissions for (none): read +28ms
solid:ACL Permissions for public: read +0ms
solid:get /profile/card on localhost +1ms
solid:get HEAD only +1ms

Comment threadlib/acl-checker.js
debug('Authentication required')
throw new HTTPError(401, `Access to ${this.resource} requires authorization`)
} else {
debug(`${mode} access denied for ${user}`)

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment threadlib/handlers/allow.js
.then(() => next(), next)
const userId = req.session.userId
req.acl.can(userId, mode)
.then(() => next(), err => {

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
ContributorAuthor

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️ 🤦‍♀️

@dan-fdan-f left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!!

@RubenVerborgh
RubenVerborgh merged commit e7d7ec3 into dz_oidcAug 31, 2017
@RubenVerborgh
RubenVerborgh deleted the fix/acl-less-debug branch August 31, 2017 20:23
RubenVerborgh added a commit that referenced this pull request Sep 3, 2017
* 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.
...
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@RubenVerborgh@dan-f