symfony/symfony — pull request #10404 by danez (2014-03-07 14:11:01+00:00)
Title: [Security] Match request based on HTTP methods in firewall config

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | (none yet)

For an api I had to work on, I was in the need to have different firewalls for different HTTP Methods. I started building my own ```RequestMatcher``` until I discovered, that the regular RequestMatcher is able to handle HTTP Methods. The only thing that is missing is the possibility to configure it in the firewall section of the configuration. (For access_control it is already possible)

With this PR it is possible to do things like this:
```yaml
security:
firewalls:
api_options:
pattern: ^/
methods: [OPTIONS]
security: false
api:
pattern: ^/
some_auth: true
```

I think this integrates quite nicely. Or is there any downside you can think of?

If it is good to go, I'll open a PR for the docs.