Policy Registration Factory
![Maven Central](https://camo.githubusercontent.com/d58ef30a20b947f939e0bd9418cf88bcbc6b48e5fe21f13fa048247106c150c7/68747470733a2f2f6d6176656e2d6261646765732e6865726f6b756170702e636f6d2f6d6176656e2d63656e7472616c2f636f6d2e6769746875622e6d6172736368616c6c2f706f6c6963792d726567697374726174696f6e2d666163746f72792f62616467652e737667)
A JNDI ObjectFactory for a PolicyRegistration. This is a work around for SECURITY-864.
This uses deprecated API that is likely going away with Elytron.
Two classes are offered
- com.github.marschall.policyregistrationfactory.EmptyPolicyRegistrationObjectFactory
-
Creates a PolicyRegistration that always throws an UnsupportedOperationException. Useful for cases when a
PolicyRegistration
is not needed but a lookup happens anyway. - com.github.marschall.policyregistrationfactory.JBossPolicyRegistrationObjectFactory
- Creates a new JBossPolicyRegistration.
Installation
You need to create a JBoss module
- put the jar in a
${JBOSS_HOME}/modules/system/layers/base/com/github/marschall/policyregistrationfactory/main
folder (or whatever your distribution layer is) - add a module.xml to the folder into which you put the jar, you can take the one from the root of the JAR
- configure the object factory and bind it to a name
For EmptyPolicyRegistrationObjectFactory
add the following to your server configuration (eg. standalone.xml
)
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<object-factory
name="java:/policyRegistration"
module="com.github.marschall.policyregistrationfactory"
class="com.github.marschall.policyregistrationfactory.EmptyPolicyRegistrationObjectFactory"/>
</bindings>
</subsystem>
For JBossPolicyRegistrationObjectFactory
add the following to your server configuration (eg. standalone.xml
)
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<object-factory
name="java:/policyRegistration"
module="com.github.marschall.policyregistrationfactory"
class="com.github.marschall.policyregistrationfactory.JBossPolicyRegistrationObjectFactory"/>
</bindings>
</subsystem>