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

Load default values from file config (services.php / .env) #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matteotrubini
Copy link
Contributor

No description provided.

@LukeTowers
Copy link
Member

Why is this required? It could represent unintentional disclosure of secrets and shouldn't be required with how the mail configuration flow works.

@matteotrubini
Copy link
Contributor Author

This replicates the behavior of the SMTP configuration where auth fields are initially populated and shown from config.
As auth details are required fields, pre-populate them prevent to re-insert credential any time you change only sender data.

I agree on the disclosure problem, but in that case I think also SMTP password should be hidden.

A solution could be to populate the username field (to show which auth data is currently configured on the system), but not the password, skipping blank password on save.

@LukeTowers
Copy link
Member

Hmm, fair points. I suppose the settings are already protected behind system.manage_mail_settings assigned to the Developer role only by default so it should be fine to allow this. Does setting the defaults like this PR does work currently? I know default values aren't used if you aren't in a create context or if the form's record already exists.

@matteotrubini
Copy link
Contributor Author

Based on my usage if record in table doesn't exists (like when you "reset to default") default values are loaded, else current ones saved on DB are shown.

You can accept this PR and plan to implement the "skip on blank" strategy for passwords / keys (maybe via filterFields() ?)

@LukeTowers
Copy link
Member

@bennothommo any thoughts?

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

Successfully merging this pull request may close these issues.

2 participants