With Play 2.4, plugins are deprecated, and although modules are their replacement, there is no longer any support for plugin-ish behaviour (adhoc Play.current.plugin[MyPlugin]).
In addition, we have gone the compile-time DI route, which makes supporting runtime injected plugins difficult.
My proposal is the following:
Rename the plugins project to simply octo-auth, and remove all remnants of Plugin
Rename perhaps to AuthHandler
In AuthSupport, take def authHandler: Option[AuthHandler]
Add a AuthHandlerModule to the wiring package to hold a lazily instantiated Option[AuthHandler]
Add a val authHandler: Option[AuthHandler]``param toAdminController`, which will be wired by Macwire
If end users want to pass a custom AuthHandler, they just need to modify AuthHandlerModule
With Play 2.4, plugins are deprecated, and although modules are their replacement, there is no longer any support for plugin-ish behaviour (adhoc
Play.current.plugin[MyPlugin]
).In addition, we have gone the compile-time DI route, which makes supporting runtime injected plugins difficult.
My proposal is the following:
plugins
project to simplyocto-auth
, and remove all remnants ofPlugin
AuthHandler
AuthSupport
, takedef authHandler: Option[AuthHandler]
AuthHandlerModule
to the wiring package to hold a lazily instantiatedOption[AuthHandler]
val authHandler: Option[AuthHandler]``param to
AdminController`, which will be wired by MacwireIf end users want to pass a custom AuthHandler, they just need to modify
AuthHandlerModule