Skip to content

Commit 0bb707e

Browse files
authored
Merge pull request #990 from solid/feature/acl-check-logger
Made use of aclCheck.configureLogger
2 parents 7488835 + f2e7d3b commit 0bb707e

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

lib/create-app.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ const errorPages = require('./handlers/error-pages')
2020
const config = require('./server-config')
2121
const defaults = require('../config/defaults')
2222
const options = require('./handlers/options')
23-
const debug = require('./debug').authentication
23+
const debug = require('./debug')
2424
const path = require('path')
2525
const { routeResolvedFile } = require('./utils')
2626
const ResourceMapper = require('./resource-mapper')
27+
const aclCheck = require('@solid/acl-check')
2728

2829
const corsSettings = cors({
2930
methods: [
@@ -59,6 +60,7 @@ function createApp (argv = {}) {
5960
initAppLocals(app, argv, ldp)
6061
initHeaders(app)
6162
initViews(app, configPath)
63+
initLoggers()
6264

6365
// Serve the public 'common' directory (for shared CSS files, etc)
6466
app.use('/common', express.static(path.join(__dirname, '../common')))
@@ -209,7 +211,7 @@ function initWebId (argv, app, ldp) {
209211
// use Bearer token to authenticate instead of cookie
210212
// (https://github.com/solid/node-solid-server/pull/835#issuecomment-426429003)
211213
if (!argv.host.allowsSessionFor(userId, origin, trustedOrigins) && !isLogoutRequest(req)) {
212-
debug(`Rejecting session for ${userId} from ${origin}`)
214+
debug.authentication(`Rejecting session for ${userId} from ${origin}`)
213215
// Destroy session data
214216
delete req.session.userId
215217
// Ensure this modified session is not saved
@@ -240,6 +242,10 @@ function initWebId (argv, app, ldp) {
240242
}
241243
}
242244

245+
function initLoggers () {
246+
aclCheck.configureLogger(debug.ACL)
247+
}
248+
243249
/**
244250
* Determines whether the given request is a logout request
245251
*/

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"bugs": "https://github.com/solid/node-solid-server/issues",
4040
"dependencies": {
4141
"@solid/oidc-auth-manager": "^0.17.1",
42-
"@solid/acl-check": "^0.1.0",
42+
"@solid/acl-check": "^0.1.1",
4343
"body-parser": "^1.18.3",
4444
"bootstrap": "^3.3.7",
4545
"busboy": "^0.2.12",

0 commit comments

Comments
 (0)