Skip to content

Commit

Permalink
Merge pull request #187 from sadilchamishka/remove-obsolete-code
Browse files Browse the repository at this point in the history
Remove the obsolete logic of building organization perspective service URLs
  • Loading branch information
sadilchamishka authored Nov 15, 2023
2 parents c603b6e + 32642a4 commit d085b29
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
5 changes: 0 additions & 5 deletions components/org.wso2.carbon.identity.api.user.common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,5 @@
<groupId>commons-lang.wso2</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.organization.management.core</groupId>
<artifactId>org.wso2.carbon.identity.organization.management.service</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class Constants {
public static final String ERROR_CODE_DELIMITER = "-";
public static final String CORRELATION_ID_MDC = "Correlation-ID";
public static final String TENANT_CONTEXT_PATH_COMPONENT = "/t/%s";
public static final String ORGANIZATION_CONTEXT_PATH_COMPONENT = "/o";
public static final String USER_API_PATH_COMPONENT = "/api/users";
public static final String SERVER_API_PATH_COMPONENT = "/api/server";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.wso2.carbon.identity.core.URLBuilderException;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants;
import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.UserStoreConfigConstants;
Expand All @@ -40,7 +39,6 @@

import static org.wso2.carbon.identity.api.user.common.Constants.ErrorMessage.ERROR_CODE_INVALID_USERNAME;
import static org.wso2.carbon.identity.api.user.common.Constants.ErrorMessage.ERROR_CODE_SERVER_ERROR;
import static org.wso2.carbon.identity.api.user.common.Constants.ORGANIZATION_CONTEXT_PATH_COMPONENT;
import static org.wso2.carbon.identity.api.user.common.Constants.SERVER_API_PATH_COMPONENT;
import static org.wso2.carbon.identity.api.user.common.Constants.TENANT_CONTEXT_PATH_COMPONENT;
import static org.wso2.carbon.identity.api.user.common.Constants.TENANT_NAME_FROM_CONTEXT;
Expand Down Expand Up @@ -237,19 +235,12 @@ public static URI buildURIForHeader(String endpoint) {
private static String getContext(String endpoint, boolean isServerResource) {

String context;
String organizationId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getOrganizationId();
if (IdentityTenantUtil.isTenantQualifiedUrlsEnabled()) {
if (isServerResource) {
context = SERVER_API_PATH_COMPONENT + endpoint;
} else {
context = USER_API_PATH_COMPONENT + endpoint;
}
if (StringUtils.isNotEmpty(organizationId)) {
String tenantDomain = (String) IdentityUtil.threadLocalProperties.get()
.get(OrganizationManagementConstants.ROOT_TENANT_DOMAIN);
context = String.format(TENANT_CONTEXT_PATH_COMPONENT, tenantDomain) +
ORGANIZATION_CONTEXT_PATH_COMPONENT + context;
}
} else {
context = String.format(TENANT_CONTEXT_PATH_COMPONENT, IdentityTenantUtil.resolveTenantDomain()) +
USER_API_PATH_COMPONENT + endpoint;
Expand Down

0 comments on commit d085b29

Please sign in to comment.