use of org.killbill.billing.util.config.definition.RbacConfig in project killbill by killbill.
the class KillBillShiroWebModule method configureShiroForRBAC.
private void configureShiroForRBAC() {
final RbacConfig config = new ConfigurationObjectFactory(configSource).build(RbacConfig.class);
bind(RbacConfig.class).toInstance(config);
// Note: order matters (the first successful match will win, see below)
bindRealm().toProvider(IniRealmProvider.class).asEagerSingleton();
bindRealm().to(KillBillJdbcRealm.class).asEagerSingleton();
if (KillBillShiroModule.isLDAPEnabled()) {
bindRealm().to(KillBillJndiLdapRealm.class).asEagerSingleton();
}
bindListener(new AbstractMatcher<TypeLiteral<?>>() {
@Override
public boolean matches(final TypeLiteral<?> o) {
return Matchers.subclassesOf(WebSecurityManager.class).matches(o.getRawType());
}
}, new DefaultWebSecurityManagerTypeListener(getProvider(ShiroEhCacheInstrumentor.class)));
if (KillBillShiroModule.isRBACEnabled()) {
addFilterChain(JaxrsResource.PREFIX + "/**", Key.get(CorsBasicHttpAuthenticationFilter.class));
}
}
use of org.killbill.billing.util.config.definition.RbacConfig in project killbill by killbill.
the class KillBillShiroModule method configureShiro.
protected void configureShiro() {
final RbacConfig config = new ConfigurationObjectFactory(new ConfigSource() {
@Override
public String getString(final String propertyName) {
return configSource.getString(propertyName);
}
}).build(RbacConfig.class);
bind(RbacConfig.class).toInstance(config);
bindRealm().toProvider(IniRealmProvider.class).asEagerSingleton();
configureJDBCRealm();
configureLDAPRealm();
}
Aggregations