Had a discussion with the team about using Filter vs Action Composition when doing authentication/authorisation in Play 2.4. (Our current code are using the way of action composition)
Although both Filter (using some regular expression or similar whitelist to bypass the requests don't need auth stuff. If you used Spring security before, you can imagine the code like pattern /* or similar) and Action Composition achieve the same requirements, but I still prefer the Action composition way of doing that.
They argue that using Action Composition need to put your customised Action instead of Play Action, and new developer who creates a new endpoint may make the mistake so will be having security hole. But my point is we can prevent this happen by doing some functional tests and automation tests.
Just want to know how you guys opinion on that and why?
Thanks