Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the obsolete logic of building organization perspective service URLs #187

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading