Skip to content

Commit

Permalink
Do not store RealmModel in cache entries
Browse files Browse the repository at this point in the history
Closes keycloak#33439

Signed-off-by: Pedro Igor <[email protected]>
  • Loading branch information
pedroigor committed Oct 1, 2024
1 parent 5218af1 commit 31391a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@

public class CachedIdentityProvider extends AbstractRevisioned implements InRealm {

private final RealmModel realm;
private final String realm;
private final IdentityProviderModel idp;

public CachedIdentityProvider(Long revision, RealmModel realm, String cacheKey, IdentityProviderModel idp) {
super(revision, cacheKey);
this.realm = realm;
this.realm = realm.getId();
this.idp = idp;
}

@Override
public String getRealm() {
return realm.getId();
return realm;
}

public IdentityProviderModel getIdentityProvider() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@

public class CachedIdentityProviderMapper extends AbstractRevisioned implements InRealm {

private final RealmModel realm;
private final String realm;
private final IdentityProviderMapperModel mapper;

public CachedIdentityProviderMapper(Long revision, RealmModel realm, String cacheKey, IdentityProviderMapperModel mapper) {
super(revision, cacheKey);
this.realm = realm;
this.realm = realm.getId();
this.mapper = mapper;
}

@Override
public String getRealm() {
return realm.getId();
return realm;
}

public IdentityProviderMapperModel getIdentityProviderMapper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class CachedOrganization extends AbstractRevisioned implements InRealm {

private final RealmModel realm;
private final String realm;
private final String name;
private final String alias;
private final String description;
Expand All @@ -43,7 +43,7 @@ public class CachedOrganization extends AbstractRevisioned implements InRealm {

public CachedOrganization(Long revision, RealmModel realm, OrganizationModel organization) {
super(revision, organization.getId());
this.realm = realm;
this.realm = realm.getId();
this.name = organization.getName();
this.alias = organization.getAlias();
this.description = organization.getDescription();
Expand All @@ -55,10 +55,10 @@ public CachedOrganization(Long revision, RealmModel realm, OrganizationModel org

@Override
public String getRealm() {
return realm.getId();
return realm;
}

public RealmModel getRealmModel() {
public String getRealmModel() {
return realm;
}

Expand Down

0 comments on commit 31391a7

Please sign in to comment.