Skip to content

Commit 1ee78db

Browse files
kjetilkrubensworks
authored andcommitted
Add reordered origin tests
1 parent e50b8bc commit 1ee78db

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/integration/authentication-oidc-test.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,41 @@ describe('Authentication API (OIDC)', () => {
283283
expect(response).to.have.property('status', 403)
284284
})
285285
})
286+
287+
// Fail 403 Origin Unauthorized
288+
describe('without that cookie and a matching origin', () => {
289+
let response
290+
before(done => {
291+
alice.get('/')
292+
.set('Origin', bobServerUri)
293+
.end((err, res) => {
294+
response = res
295+
done(err)
296+
})
297+
})
298+
299+
it('should return a 403', () => {
300+
expect(response).to.have.property('status', 403)
301+
})
302+
})
303+
304+
// TODO Does this really make sense?
305+
describe('with that cookie and a non-matching origin', () => {
306+
let response
307+
before(done => {
308+
alice.get('/')
309+
.set('Cookie', cookie)
310+
.set('Origin', bobServerUri)
311+
.end((err, res) => {
312+
response = res
313+
done(err)
314+
})
315+
})
316+
317+
it('should return a 403', () => {
318+
expect(response).to.have.property('status', 403)
319+
})
320+
})
286321
})
287322
})
288323

0 commit comments

Comments
 (0)