Skip to content

Commit 690a7fb

Browse files
authored
Defect OpenId configuration issue (#24)
* Mask the keys from OpenId configuration * Incremented version and added to change log. * Update package-lock
1 parent 9c52c38 commit 690a7fb

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.9.0
2+
- Fix to mask properties that should not be part of the OIDC configuration.
3+
14
## v0.6.0 - 2019-11-08
25

36
### Changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solid/oidc-op",
3-
"version": "0.8.0",
3+
"version": "0.9.0",
44
"engines": {
55
"node": ">=10.0"
66
},

src/Provider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class Provider {
211211
* openidConfiguration
212212
*/
213213
get openidConfiguration () {
214-
return JSON.stringify(this)
214+
return JSON.stringify(this, (key, value) => key !== "keys" ? value : undefined)
215215
}
216216

217217
/**

test/handlers/OpenIDConfigurationRequestSpec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('OpenIDConfigurationRequest', () => {
3131
res = HttpMocks.createResponse()
3232

3333
provider = new Provider({ issuer: providerUri })
34+
provider.initializeKeyChain();
3435
})
3536

3637
it('should respond with the provider configuration in JSON format', () => {
@@ -42,4 +43,14 @@ describe('OpenIDConfigurationRequest', () => {
4243

4344
expect(config['authorization_endpoint']).to.equal('https://example.com/authorize')
4445
})
46+
47+
it('should mask properties that are not part of OIDC', () => {
48+
OpenIDConfigurationRequest.handle(req, res, provider)
49+
50+
expect(res._isJSON()).to.be.true()
51+
52+
let config = JSON.parse(res._getData())
53+
54+
expect(config['keys']).to.be.undefined()
55+
})
4556
})

0 commit comments

Comments
 (0)