Skip to content

Commit c0bea97

Browse files
author
jaxoncreed
committed
TLS test has parsable webID
1 parent 53c063b commit c0bea97

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

lib/acl-checker.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class ACLChecker {
3131
// Returns a fulfilled promise when the user can access the resource
3232
// in the given mode, or rejects with an HTTP error otherwise
3333
async can (user, mode) {
34+
console.log('THIS IS THE USER!!!!!!!!!')
35+
console.log(user)
3436
const cacheKey = `${mode}-${user}`
3537
if (this.aclCached[cacheKey]) {
3638
return this.aclCached[cacheKey]
@@ -73,6 +75,7 @@ class ACLChecker {
7375
if (accessDenied && user) {
7476
this.messagesCached[cacheKey].push(HTTPError(403, accessDenied))
7577
} else if (accessDenied) {
78+
console.log('OH DEAR WE GOT HERE')
7679
this.messagesCached[cacheKey].push(HTTPError(401, 'Unauthenticated'))
7780
}
7881
this.aclCached[cacheKey] = Promise.resolve(!accessDenied)

lib/api/authn/webid-tls.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ function handler (req, res, next) {
1515

1616
// No certificate? skip
1717
const certificate = getCertificateViaTLS(req)
18+
console.log(req.method)
19+
console.log(req.headers)
20+
console.log(req.body)
21+
console.log('CERTIFICATE')
22+
console.log(certificate)
1823
if (!certificate) {
1924
setEmptySession(req)
2025
return next()
@@ -38,6 +43,8 @@ function handler (req, res, next) {
3843
function getCertificateViaTLS (req) {
3944
const certificate = req.connection.getPeerCertificate &&
4045
req.connection.getPeerCertificate()
46+
console.log('IN CERT')
47+
console.log(certificate)
4148
if (certificate && Object.keys(certificate).length > 0) {
4249
return certificate
4350
}

test/resources/acl-tls/tim.localhost/profile/card$.ttl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
@prefix n0: <http://xmlns.com/foaf/0.1/>.
33
@prefix n: <http://www.w3.org/2006/vcard/ns#>.
44
@prefix cert: <http://www.w3.org/ns/auth/cert#>.
5+
@prefix schem: <http://schema.org/>.
6+
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
57

68
:me
79
a schem:Person, n0:Person;

0 commit comments

Comments
 (0)