Skip to content

Commit

Permalink
Don't insert ou=pairwiseIdentifiers tree node into persistence which …
Browse files Browse the repository at this point in the history
…not supports tree model #1233
  • Loading branch information
yuriyz committed Jan 22, 2020
1 parent d4a9dda commit 0c0a179
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
@@ -1,12 +1,5 @@
package org.gluu.oxauth.service;

import java.net.URI;
import java.util.List;

import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.inject.Named;

import org.gluu.oxauth.model.common.PairwiseIdType;
import org.gluu.oxauth.model.configuration.AppConfiguration;
import org.gluu.oxauth.model.util.SubjectIdentifierGenerator;
Expand All @@ -16,7 +9,12 @@
import org.gluu.util.StringHelper;
import org.oxauth.persistence.model.PairwiseIdentifier;
import org.slf4j.Logger;
import org.gluu.oxauth.service.UserService;

import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.inject.Named;
import java.net.URI;
import java.util.List;

/**
* @author Javier Rojas Blum
Expand Down Expand Up @@ -51,6 +49,10 @@ public boolean containsBranch(final String userInum) {
}

public void prepareBranch(final String userInum) {
if (!ldapEntryManager.hasBranchesSupport(userService.getDnForUser(userInum))) {
return;
}

// Create pairwise identifier branch if needed
if (!containsBranch(userInum)) {
addBranch(userInum);
Expand Down
Expand Up @@ -147,6 +147,10 @@ public void remove(List<UmaPCT> pctList) {
}

private void prepareBranch() {
if (!ldapEntryManager.hasBranchesSupport(branchBaseDn())) {
return;
}

if (!ldapEntryManager.contains(branchBaseDn(), SimpleBranch.class)) {
addBranch();
}
Expand Down
Expand Up @@ -182,6 +182,10 @@ public Set<String> getResourceScopes(Set<String> resourceIds) {
}

private void prepareBranch() {
if (!ldapEntryManager.hasBranchesSupport(getDnForResource(null))) {
return;
}

// Create resource description branch if needed
if (!ldapEntryManager.contains(getDnForResource(null), SimpleBranch.class)) {
addBranch();
Expand Down

0 comments on commit 0c0a179

Please sign in to comment.