Skip to content

Commit

Permalink
Check for invalid organization IDs like empty string or null values p…
Browse files Browse the repository at this point in the history
…assed to resolve tenant domain function
  • Loading branch information
sadilchamishka committed Nov 18, 2024
1 parent 37555bb commit b41e218
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ public Organization updateOrganization(String organizationId, String currentOrga
@Override
public String resolveTenantDomain(String organizationId) throws OrganizationManagementException {

if (StringUtils.isEmpty(organizationId)) {
throw handleClientException(ERROR_CODE_INVALID_ORGANIZATION, organizationId);

Check warning on line 477 in components/org.wso2.carbon.identity.organization.management.service/src/main/java/org/wso2/carbon/identity/organization/management/service/OrganizationManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

components/org.wso2.carbon.identity.organization.management.service/src/main/java/org/wso2/carbon/identity/organization/management/service/OrganizationManagerImpl.java#L477

Added line #L477 was not covered by tests
}
if (StringUtils.equals(SUPER_ORG_ID, organizationId)) {
// super tenant domain will be returned.
return MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
Expand Down

0 comments on commit b41e218

Please sign in to comment.