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

ENHANCEMENT Validate against missing block division #27

Open
tractorcow opened this issue Dec 18, 2017 · 2 comments
Open

ENHANCEMENT Validate against missing block division #27

tractorcow opened this issue Dec 18, 2017 · 2 comments

Comments

@tractorcow
Copy link

E.g. in this config

---
Name: myemailconfig
After:
  - '#emailconfig'
SilverStripe\Core\Injector\Injector:
  Swift_Transport:
    class: Swift_SmtpTransport
    properties:
      Host: mail.example.com
      Port: 587
      Encryption: null
    calls:
      Username: [ setUsername, ['example@example.com'] ]
      Password: [ setPassword, ['123456'] ]
      AuthMode: [ setAuthMode, ['login'] ]

The missing --- on the block header groups this entire file inside the header (with no body) and thus acts as a blank config block. However, no error is raised.

We should raise a warning if an unsupported header key is presented, with a whitelist of allowed keys (e.g. name, only, after, before, except).

Noted in silverstripe/silverstripe-framework#7700 (comment)

@chillu
Copy link
Member

chillu commented Jan 18, 2021

Just noting that it's silently breaking on a missing start header division as well, which just cost me 30 mins of goose chasing :/ We need more explicit validation in the whole config layer, it's a massive dev time sink right now.

@chillu
Copy link
Member

chillu commented Jan 18, 2021

Marking as impact/high since those dev experience failures suck up lots of time (and willpower) across the ecosystem

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

No branches or pull requests

4 participants