Skip to content
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

RFC: Allow setting safeTld, ignoreAuthorization and forceEnable by ENV variables #997

Closed
ajibarra opened this issue Apr 5, 2024 · 4 comments

Comments

@ajibarra
Copy link
Member

ajibarra commented Apr 5, 2024

Description

Currently DebugKit settings (via Configure) need to be added when you setup each application. It would be great to be able to add them via environment.

Probably the best place to do it would be here https://github.com/cakephp/app/blob/5.x/config/bootstrap.php#L101 adding:

Configure::write('DebugKit.forceEnable', filter_var(env('DEBUG_KIT_FORCE_ENABLE', false), FILTER_VALIDATE_BOOLEAN);
Configure::write('DebugKit.safeTld', env('DEBUG_KIT_SAFE_TLD', null));
Configure::write('DebugKit.ignoreAuthorization', env('DEBUG_KIT_IGNORE_AUTHORIZATION', false));

Another place could be https://github.com/cakephp/app/blob/effe937b3b76faa8872a0a895d6287a8d32f9fc3/config/app.php#L414

However I am open to suggestions. I am creating the RFC here because it is related to DebugKit but I am not sure it can be done in a clean way inside this plugin.

@ADmad
Copy link
Member

ADmad commented Apr 5, 2024

I fail to see what change is required in the app skeleton or the plugin. What you have shown already works, so just set those configs as desired.

@ajibarra
Copy link
Member Author

ajibarra commented Apr 5, 2024

ah no, I meant in app.php we could add 'DebugKit' key to configure but I think the best place is bootstrap if debug is enabled as shown..

so you agree with including this in cakephp/app skeleton? I can prepare a quick MR

@ADmad
Copy link
Member

ADmad commented Apr 5, 2024

I would keep it in app.php along with other configs.

@dereuromark
Copy link
Member

Prs will be opened on skeleton. Closing then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants