-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix overriding null configuration options in default.yml.
Null values in default.yml were being treated as a special null type by lyaml, which was preventing overrides from actually overriding the null type. This prevented the omniauth-ldap and omniauth-cas options from being set (see #278 (comment))
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
require('../test_helper'); | ||
|
||
var fs = require('fs'), | ||
path = require('path'), | ||
yaml = require('js-yaml'); | ||
|
||
describe('config', function() { | ||
describe('overriding null values', function() { | ||
shared.runServer({ | ||
web: { | ||
admin: { | ||
auth_strategies: { | ||
ldap: { | ||
options: { | ||
host: 'example.com', | ||
} | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
it('overrides a default null value', function() { | ||
var defaultConfig = yaml.safeLoad(fs.readFileSync(path.resolve(__dirname, '../../config/default.yml')).toString()); | ||
var runtimeConfig = yaml.safeLoad(fs.readFileSync('/tmp/api-umbrella-test/var/run/runtime_config.yml').toString()); | ||
|
||
should.not.exist(defaultConfig.web.admin.auth_strategies.ldap.options); | ||
runtimeConfig.web.admin.auth_strategies.ldap.options.should.eql({ | ||
host: 'example.com', | ||
}); | ||
}); | ||
}); | ||
}); |