-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
refactor configuration #92
Comments
Just recognized that this isn't runtime configuration but for build and server only. Due to this it should also be moved from |
is it possible to have more
I think we can replace
I think CSP - it's kinda do and forget configuration, and we able to add |
@rwjblue I'm willing to provide a PR for this but would like to know beforehand if you are willing to accept such a change of configuration API. Also the status of this addon is unclear to me. It has still a high weekly download numbers on NPM but PRs are open for a long time without feedback and it's missing any test coverage. 😞 Let me know if there is anything I could help with. This addon provides valuable feature for the ecosystem and could provide big value if known limitations (e.g. testing support) are addressed IMO. |
@jelhan Looks good overall! Some thoughts:
and basically only deliver via header or meta, but not both. I think that may avoid some confusion + some issues around the directives that can only be delivered via headers. // …
enabled: true,
delivery: 'meta', // or 'header'
// …
I know rwjblue still care about this repo and want to see it progress, but he's a busy person. So I'm certain it's not neglect, it's just a lack of bandwidth. Anyway, I have commit bits to this repo so I can help shepherd it through (though I'll try to get rwjblue to sign off on it first). |
I like that one but would additionally support
I like that proposal. Are these ones currently supported?
💯 Updated first post accordingly.
A change here would not only affect addons but also a lot of application. This addon has 24.758 weekly downloads. That's a lot for our ecosystem. For comparison |
// it would accept this (default, for backwards compatibility):
delivery: ['meta', 'header'],
// and also accept a single value
delivery: 'meta', (in case there would be some future mechanism for CSP delivery)
|
Most of the configuration refactoring discussed here has landed in #94. The policy object isn't refactored yet. @lifeart do you have time to work on that one as it was your suggestion? I'm totally in favor for it but like to focus on other parts of this addon. Would be great to change the configuration in one release only and not in several ones. |
@jelhan sorry, this week I have no time for it(. |
@lifeart Although I really appreciate that you'd like to help out improving this addon, I'm not convinced that we should move to something "dummers-frendly". Although I agree that CSP is complicated and sometimes confusing, there are also disadvantages to adding another layer of abstraction. Happy to discuss further though! I could certainly change my mind if there are good arguments in favor of dumbing it down. But just wanted to make this note so you don't start working on something that may not be merged in the end. cc: @jelhan |
I'll go ahead and close this issue. But feel free to open a new if you want to discuss more changes to the config format! 😄 Thanks @jelhan for landing the first refactor! |
The configuration of this addon doesn't feel inline with the rest of the ecosystem. This gets even worse if new configuration option are needed as it's the case for #91.
I like to suggest to refactor the configuration API as the following:
The values shown above are suggested defaults.
For a transition period we might want to support existing configuration API. In that case the defaults would look like:
If we consider disabling the addon by setting
ENV.contentSecurityPolicy === {}
as a public API as suggested in #77, we might want to change the default forenabled
to!ENV.contentSecurityPolicy || Object.keys(ENV.contentSecurityPolicy).length !== 0
. We should deprecate the old configuration API at the same time. In that case this wouldn't be a breaking change but add some additional maintenance costs.Please note that this API wouldn't require a change for #91. It would allow to disable throwing in tests by setting
enabled = environment !== 'test'
.metaTag
option would be forced totrue
if running tests.The text was updated successfully, but these errors were encountered: