Skip to content

Commit d935642

Browse files
Add acl-related OIDC integration tests
1 parent 04e6c9c commit d935642

File tree

46 files changed

+1733
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1733
-6
lines changed

lib/handlers/allow.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,15 @@ function fetchDocument (host, ldp, baseUri) {
9494
}
9595

9696
function getUserId (req, callback) {
97-
callback(null, req.session.userId)
97+
let userId
98+
99+
if (req.session.userId) {
100+
userId = req.session.userId
101+
} else if (req.claims) {
102+
userId = req.claims.sub
103+
}
104+
105+
callback(null, userId)
98106
// var onBehalfOf = req.get('On-Behalf-Of')
99107
// if (!onBehalfOf) {
100108
// return callback(null, req.session.userId)

lib/ldp-middleware.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ function LdpMiddleware (corsSettings) {
1717
// Add Link headers
1818
router.use(header.linksHandler)
1919

20-
// TODO edit cors
21-
// router.use((req, res, next) => {
22-
// edit cors according to ACL
23-
// })
2420
if (corsSettings) {
2521
router.use(corsSettings)
2622
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"node-forge": "^0.6.38",
5959
"nodemailer": "^3.1.4",
6060
"nomnom": "^1.8.1",
61-
"oidc-auth-manager": "^0.4.0",
61+
"oidc-auth-manager": "^0.4.1",
6262
"oidc-op-express": "^0.0.3",
6363
"rdflib": "^0.15.0",
6464
"recursive-readdir": "^2.1.0",

0 commit comments

Comments
 (0)