Beispiel #1
0
 @Override
 public ProtocolMapperModel getProtocolMapperById(String id) {
   for (ProtocolMapperModel mapping : cached.getProtocolMappers()) {
     if (mapping.getId().equals(id)) return mapping;
   }
   return null;
 }
Beispiel #2
0
 @Override
 public Map<String, String> getAttributes() {
   if (updated != null) return updated.getAttributes();
   Map<String, String> copy = new HashMap<String, String>();
   copy.putAll(cached.getAttributes());
   return copy;
 }
Beispiel #3
0
 @Override
 public RoleModel getRole(String name) {
   if (updated != null) return updated.getRole(name);
   String id = cached.getRoles().get(name);
   if (id == null) return null;
   return cacheSession.getRoleById(id, cachedRealm);
 }
Beispiel #4
0
 @Override
 public ProtocolMapperModel getProtocolMapperByName(String protocol, String name) {
   for (ProtocolMapperModel mapping : cached.getProtocolMappers()) {
     if (mapping.getProtocol().equals(protocol) && mapping.getName().equals(name)) return mapping;
   }
   return null;
 }
Beispiel #5
0
 public Set<RoleModel> getScopeMappings() {
   if (updated != null) return updated.getScopeMappings();
   Set<RoleModel> roles = new HashSet<RoleModel>();
   for (String id : cached.getScope()) {
     roles.add(cacheSession.getRoleById(id, getRealm()));
   }
   return roles;
 }
Beispiel #6
0
  @Override
  public boolean hasScope(RoleModel role) {
    if (updated != null) return updated.hasScope(role);
    if (cached.isFullScopeAllowed() || cached.getScope().contains(role.getId())) return true;

    Set<RoleModel> roles = getScopeMappings();

    for (RoleModel mapping : roles) {
      if (mapping.hasRole(role)) return true;
    }

    roles = getRoles();
    if (roles.contains(role)) return true;

    for (RoleModel mapping : roles) {
      if (mapping.hasRole(role)) return true;
    }
    return false;
  }
Beispiel #7
0
  @Override
  public Set<RoleModel> getRoles() {
    if (updated != null) return updated.getRoles();

    Set<RoleModel> roles = new HashSet<RoleModel>();
    for (String id : cached.getRoles().values()) {
      RoleModel roleById = cacheSession.getRoleById(id, cachedRealm);
      if (roleById == null) continue;
      roles.add(roleById);
    }
    return roles;
  }
Beispiel #8
0
 @Override
 public boolean isImplicitFlowEnabled() {
   if (updated != null) return updated.isImplicitFlowEnabled();
   return cached.isImplicitFlowEnabled();
 }
Beispiel #9
0
 @Override
 public boolean isStandardFlowEnabled() {
   if (updated != null) return updated.isStandardFlowEnabled();
   return cached.isStandardFlowEnabled();
 }
Beispiel #10
0
 @Override
 public String getId() {
   if (updated != null) return updated.getId();
   return cached.getId();
 }
Beispiel #11
0
 @Override
 public boolean isConsentRequired() {
   if (updated != null) return updated.isConsentRequired();
   return cached.isConsentRequired();
 }
Beispiel #12
0
 public boolean isPublicClient() {
   if (updated != null) return updated.isPublicClient();
   return cached.isPublicClient();
 }
Beispiel #13
0
 @Override
 public ClientTemplateModel getClientTemplate() {
   if (updated != null) return updated.getClientTemplate();
   if (cached.getClientTemplate() == null) return null;
   return cacheSession.getClientTemplateById(cached.getClientTemplate(), cachedRealm);
 }
Beispiel #14
0
 @Override
 public Map<String, Integer> getRegisteredNodes() {
   if (updated != null) return updated.getRegisteredNodes();
   return cached.getRegisteredNodes();
 }
Beispiel #15
0
 public boolean isFrontchannelLogout() {
   if (updated != null) return updated.isPublicClient();
   return cached.isFrontchannelLogout();
 }
Beispiel #16
0
 @Override
 public boolean isDirectAccessGrantsEnabled() {
   if (updated != null) return updated.isDirectAccessGrantsEnabled();
   return cached.isDirectAccessGrantsEnabled();
 }
Beispiel #17
0
 @Override
 public boolean isFullScopeAllowed() {
   if (updated != null) return updated.isFullScopeAllowed();
   return cached.isFullScopeAllowed();
 }
Beispiel #18
0
 @Override
 public Set<ProtocolMapperModel> getProtocolMappers() {
   if (updated != null) return updated.getProtocolMappers();
   return cached.getProtocolMappers();
 }
Beispiel #19
0
 public int getNotBefore() {
   if (updated != null) return updated.getNotBefore();
   return cached.getNotBefore();
 }
Beispiel #20
0
 @Override
 public String getAttribute(String name) {
   if (updated != null) return updated.getAttribute(name);
   return cached.getAttributes().get(name);
 }
Beispiel #21
0
 @Override
 public boolean isServiceAccountsEnabled() {
   if (updated != null) return updated.isServiceAccountsEnabled();
   return cached.isServiceAccountsEnabled();
 }
Beispiel #22
0
 @Override
 public String getDescription() {
   if (updated != null) return updated.getDescription();
   return cached.getDescription();
 }
Beispiel #23
0
 public Set<String> getWebOrigins() {
   if (updated != null) return updated.getWebOrigins();
   return cached.getWebOrigins();
 }
Beispiel #24
0
 @Override
 public boolean isSurrogateAuthRequired() {
   if (updated != null) return updated.isSurrogateAuthRequired();
   return cached.isSurrogateAuthRequired();
 }
Beispiel #25
0
 @Override
 public int getNodeReRegistrationTimeout() {
   if (updated != null) return updated.getNodeReRegistrationTimeout();
   return cached.getNodeReRegistrationTimeout();
 }
Beispiel #26
0
 @Override
 public String getManagementUrl() {
   if (updated != null) return updated.getManagementUrl();
   return cached.getManagementUrl();
 }
Beispiel #27
0
 @Override
 public List<String> getDefaultRoles() {
   if (updated != null) return updated.getDefaultRoles();
   return cached.getDefaultRoles();
 }
Beispiel #28
0
 @Override
 public boolean isBearerOnly() {
   if (updated != null) return updated.isBearerOnly();
   return cached.isBearerOnly();
 }
Beispiel #29
0
 public Set<String> getRedirectUris() {
   if (updated != null) return updated.getRedirectUris();
   return cached.getRedirectUris();
 }
Beispiel #30
0
 public String getRegistrationToken() {
   if (updated != null) return updated.getRegistrationToken();
   return cached.getRegistrationToken();
 }