Skip to content
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

Check read access in websocket-pubsub #1484

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v13.2.0
v14
2 changes: 1 addition & 1 deletion lib/acl-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ACL = rdf.Namespace('http://www.w3.org/ns/auth/acl#')

// TODO: expunge-on-write so that we can increase the caching time
// For now this cache is a big performance gain but very simple
const EXPIRY_MS = 10000 // 10 seconds
const EXPIRY_MS = 10 // 10 milliseconds
let temporaryCache = {}

// An ACLChecker exposes the permissions on a specific resource
Expand Down
8 changes: 7 additions & 1 deletion lib/create-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function createServer (argv, app) {
server = https.createServer(credentials, app)
}

console.log(argv)
// Look for port or list of ports to redirect to argv.port
if ('redirectHttpFrom' in argv) {
const redirectHttpFroms = argv.redirectHttpFrom.constructor === Array
Expand All @@ -97,9 +98,14 @@ function createServer (argv, app) {
})
}

function checkReadAccess (iri, authToken, dpopToken) {
console.log('checking read access', iri, authToken, dpopToken)
return true
}

// Setup Express app
if (ldp.live) {
const solidWs = SolidWs(server, ldpApp)
const solidWs = SolidWs(server, ldpApp, { checkReadAccess })
ldpApp.locals.ldp.live = solidWs.publish.bind(solidWs)
}

Expand Down