Skip to content

Commit 2bfe697

Browse files
committed
Added test
1 parent c10da3d commit 2bfe697

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

lib/api/authn/webid-oidc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function initialize (app, argv) {
3737
// to access a public resource
3838
if (err) {
3939
req.authError = err
40+
res.status(200)
4041
}
4142
next()
4243
})

test/integration/errors-oidc-test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ describe('OIDC error handling', function () {
9494
.expect('WWW-Authenticate', 'Bearer realm="https://localhost:3457", scope="openid webid", error="invalid_token", error_description="Access token is expired"')
9595
.expect(401)
9696
})
97+
98+
it('should return a 200 if the resource is public', () => {
99+
return server.get('/public/')
100+
.set('Authorization', 'Bearer ' + expiredToken)
101+
.expect(200)
102+
})
97103
})
98104
})
99105
})
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ACL resource for the public folder
2+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
3+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
4+
5+
# The owner has all permissions
6+
<#owner>
7+
a acl:Authorization;
8+
acl:agent <https://localhost:3457/profile/card#me>;
9+
acl:accessTo <./>;
10+
acl:default <./>;
11+
acl:mode acl:Read, acl:Write, acl:Control.
12+
13+
# The public has read permissions
14+
<#public>
15+
a acl:Authorization;
16+
acl:agentClass foaf:Agent;
17+
acl:accessTo <./>;
18+
acl:default <./>;
19+
acl:mode acl:Read.

0 commit comments

Comments
 (0)