<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 18 July 2016 at 22:35, Dmitry Telegin <span dir="ltr">&lt;<a href="mailto:mitya@cargosoft.ru" target="_blank">mitya@cargosoft.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Stian,</div><div><br></div><div>Here we go: <a href="https://issues.jboss.org/browse/KEYCLOAK-3327" target="_blank">https://issues.jboss.org/browse/KEYCLOAK-3327</a></div><div><br></div><div>If the fix is somewhat trivial (i.e. a matter of adding fields and getters/setters) I think I could work on a PR as well.</div></div></blockquote><div><br></div><div>As the attributes are already available in the underlying entities it&#39;s just a matter of exposing through RealmModel and add tests for it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br></div><div>BTW, does this mean that all the custom entities provided via Entity SPI are not by default cache-enabled (and won&#39;t be synchronized between the nodes in clustered environment)?</div><div>If so, will it be easy to cache-enable them? Is this just a matter of providing Infinispan adapters similar to existing ones for Realm/User/Role/Client etc.?</div></div></blockquote><div><br></div><div>There&#39;s no caching for custom entities. I&#39;d recommend using Hibernate 2nd level cache for it as it&#39;s rather tricky to create a custom one. We have our custom one because we need to support Mongo as well as users from different sources (user federation and identity brokering).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br></div><div>Ideally, I&#39;d like to see a current domain-extension example augmented with Infinispan cache functionality. I&#39;ve got some ideas on a detailed walkthrough tutorial for building complete, full-featured KeyCloak extensions (it&#39;s a big topic I&#39;ll elaborate on a bit later); I think Infinispan-enabled entities could be covered there, too.</div></div></blockquote><div><br></div><div>No chance we&#39;re adding cache for custom entities. It&#39;s just to hard to get right. For custom entities you should use Hibernate 2nd level cache.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br></div><div>Regards,</div><div>Dmitry</div><div><br></div><div>В Пн, 18/07/2016 в 07:39 +0200, Stian Thorgersen пишет:</div><div><div class="h5"><blockquote type="cite"><div dir="ltr">Forgot that attributes are not exposed through RealmModel. You can&#39;t access the JPA RealmAdapter directly as you&#39;ll break the cache functionality. You can create a JIRA to request attributes added to RealmModel though.</div><div class="gmail_extra"><br><div class="gmail_quote">On 15 July 2016 at 20:28, Mitya <span dir="ltr">&lt;<a href="mailto:mitya@cargosoft.ru" target="_blank">mitya@cargosoft.ru</a>&gt;</span> wrote:<br><blockquote type="cite"><div><div>Stian,</div><div><br></div><div>In my provider, session.getContext().getRealm() returns an instance of org.keycloak.models.cache.infinispan.RealmAdapter. But in order to be able to manage attributes, we need an org.keycloak.models.jpa.RealmAdapter. What&#39;s the best way to obtain it?</div><div><br></div><div>I&#39;ve yet come up with the following:</div><div><br></div><div>RealmModel realm = session.getContext().getRealm();</div><div>RealmAdapter adapter = (RealmAdapter) session.getProvider(RealmProvider.class).getRealm(realm.getId());</div><div><div><div><br></div><div><br></div><blockquote type="cite"><div dir="ltr">Realm attributes should be perfect for that</div><div class="gmail_extra"><br><div class="gmail_quote">On 12 July 2016 at 13:42, Mitya <span dir="ltr">&lt;<a href="mailto:mitya@cargosoft.ru" target="_blank">mitya@cargosoft.ru</a>&gt;</span> wrote:<br><blockquote type="cite"><div><div>Hi,</div><div><br></div><div>I&#39;m developing a KeyCloak extension, and I want some custom (per-realm) parameters to be tuned via the GUI form. Speaking of the storage mechanism for my settings, are realm attributes suitable for that? or should I create a dedicated custom entity instead?</div><div><br></div><div>Thx,</div><div>Mitya</div></div><br>_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br></blockquote></div><br></div>
</blockquote></div></div></div><br></blockquote></div><br></div>
</blockquote></div></div></div></blockquote></div><br></div></div>