-
Notifications
You must be signed in to change notification settings - Fork 141
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
Merge seperate config schemas #57
Changes from 4 commits
268a907
5b274f4
44894ce
7deb960
323a67d
c88a5d4
a709b2d
44cc859
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,20 @@ describe('config', function() { | |
}); | ||
}); | ||
|
||
describe('when authorizationParams response_type fuzzy matches issuer', function() { | ||
const customConfig = Object.assign({}, defaultConfig, { | ||
clientSecret: '__test_client_secret__', | ||
authorizationParams: { | ||
response_type: 'token id_token code' | ||
} | ||
}); | ||
const config = getConfig(customConfig); | ||
|
||
it('should keep token code', function() { | ||
assert.equal(config.authorizationParams.response_type, 'token id_token code'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not exactly match metadata fixture so this would have thrown before. |
||
}); | ||
}); | ||
|
||
describe('with auth0Logout', function() { | ||
const config = getConfig(Object.assign({}, defaultConfig, {auth0Logout: true})); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,7 @@ describe('invalid parameters', function() { | |
httpOnly: '__invalid_httponly__' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error message changes only in this file. |
||
} | ||
})); | ||
}, '"httpOnly" must be a boolean'); | ||
}, '"appSessionCookie.httpOnly" must be a boolean'); | ||
}); | ||
|
||
it('should fail when app session cookie secure is not a boolean', function() { | ||
|
@@ -114,7 +114,7 @@ describe('invalid parameters', function() { | |
secure: '__invalid_secure__' | ||
} | ||
})); | ||
}, '"secure" must be a boolean'); | ||
}, '"appSessionCookie.secure" must be a boolean'); | ||
}); | ||
|
||
it('should fail when app session cookie sameSite is invalid', function() { | ||
|
@@ -124,7 +124,7 @@ describe('invalid parameters', function() { | |
sameSite: '__invalid_samesite__' | ||
} | ||
})); | ||
}, '"sameSite" must be one of [Lax, Strict, None]'); | ||
}, '"appSessionCookie.sameSite" must be one of [Lax, Strict, None]'); | ||
}); | ||
|
||
it('should fail when app session cookie domain is invalid', function() { | ||
|
@@ -134,7 +134,7 @@ describe('invalid parameters', function() { | |
domain: false | ||
} | ||
})); | ||
}, '"domain" must be a string'); | ||
}, '"appSessionCookie.domain" must be a string'); | ||
}); | ||
|
||
it('should fail when app session cookie sameSite is an invalid value', function() { | ||
|
@@ -144,6 +144,6 @@ describe('invalid parameters', function() { | |
path: 123 | ||
} | ||
})); | ||
}, '"path" must be a string'); | ||
}, '"appSessionCookie.path" must be a string'); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
const { assert } = require('chai'); | ||
const url = require('url'); | ||
const server = require('./fixture/server'); | ||
const { auth } = require('./..'); | ||
|
||
|
@@ -44,7 +43,7 @@ describe('logout route', function() { | |
|
||
it('should redirect to the base url', function() { | ||
assert.equal(logoutResponse.statusCode, 302); | ||
assert.equal(logoutResponse.headers.location, 'https://example.org/'); | ||
assert.equal(logoutResponse.headers.location, 'https://example.org'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}); | ||
}); | ||
|
||
|
@@ -83,7 +82,7 @@ describe('logout route', function() { | |
|
||
it('should redirect to the base url', function() { | ||
assert.equal(logoutResponse.statusCode, 302); | ||
assert.equal(logoutResponse.headers.location, 'https://example.org/'); | ||
assert.equal(logoutResponse.headers.location, 'https://example.org'); | ||
}); | ||
}); | ||
|
||
|
@@ -92,7 +91,7 @@ describe('logout route', function() { | |
describe('should allow relative paths, and prepend with baseURL', () => { | ||
let baseUrl; | ||
const jar = request.jar(); | ||
|
||
before(async function() { | ||
const middleware = auth({ | ||
idpLogout: false, | ||
|
@@ -114,12 +113,12 @@ describe('logout route', function() { | |
baseUrl, jar | ||
}); | ||
}); | ||
|
||
it('should redirect to postLogoutRedirectUri in auth() config', async function() { | ||
const logoutResponse = await request.get({uri: '/logout', baseUrl, jar, followRedirect: false}); | ||
assert.equal(logoutResponse.headers.location, 'https://example.org/after-logout-in-auth-config'); | ||
}); | ||
|
||
it('should redirect to returnTo in logout query', async function() { | ||
const logoutResponse = await request.get({uri: '/logout', qs: {returnTo: '/after-logout-in-logout-query'}, baseUrl, jar, followRedirect: false}); | ||
assert.equal(logoutResponse.headers.location, 'https://example.org/after-logout-in-logout-query'); | ||
|
@@ -129,7 +128,7 @@ describe('logout route', function() { | |
describe('should allow absolute paths', () => { | ||
let baseUrl; | ||
const jar = request.jar(); | ||
|
||
before(async function() { | ||
const middleware = auth({ | ||
idpLogout: false, | ||
|
@@ -151,12 +150,12 @@ describe('logout route', function() { | |
baseUrl, jar | ||
}); | ||
}); | ||
|
||
it('should redirect to postLogoutRedirectUri in auth() config', async function() { | ||
const logoutResponse = await request.get({uri: '/logout', baseUrl, jar, followRedirect: false}); | ||
assert.equal(logoutResponse.headers.location, 'https://external-domain.com/after-logout-in-auth-config'); | ||
}); | ||
|
||
it('should redirect to returnTo in logout query', async function() { | ||
const logoutResponse = await request.get({uri: '/logout', qs: {returnTo: 'https://external-domain.com/after-logout-in-logout-query'}, baseUrl, jar, followRedirect: false}); | ||
assert.equal(logoutResponse.headers.location, 'https://external-domain.com/after-logout-in-logout-query'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a remnant of
fragment
support.id_token
with an undefinedresponse_mode
defaults tofragment
which is not supported in this SDK.