-
Notifications
You must be signed in to change notification settings - Fork 35
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
feat: inject moduleConfig read from tegg-config app.moduleConfigs config #169
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #169 +/- ##
=======================================
Coverage 92.48% 92.48%
=======================================
Files 235 235
Lines 5017 5019 +2
Branches 538 538
=======================================
+ Hits 4640 4642 +2
Misses 377 377 ☔ View full report in Codecov by Sentry. |
@killagu 看看,配置加载这块我不太熟悉 |
813a8e9
to
8e1f05a
Compare
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.
LGTM
@killagu 发布卡住了 |
@@ -37,4 +37,18 @@ describe('test/ModuleConfig.test.ts', () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
it('should work with overwrite', async () => { | |||
mm(app.moduleConfigs.simple.config, 'features', { dynamic: { foo: 'bar', bar: 'overwrite foo' } }); |
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.
@nightink 这个 mock 干扰比较大,是不是删除掉?
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.
哦哦 这个忘记删了 这个 case 里没用
|
Checklist
npm test
passesAffected core subsystem(s)
@eggjs/tegg-plugin
@eggjs/tegg-config
Description of change
module.yml/json 存放一些敏感配置 例如 db password(kms:encodepassword....),我们需要在应用启动前将其配置解密还原成明文数据字段
目前看到的注入点 app.moduleConfigs,所以需要 inject moduleConfig 优先读取 app.moduleConfigs 数据对象,确保服务在注入的时候拿到的是解密后配置