Skip to content

Commit

Permalink
remove user resolver related dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoshani committed Nov 18, 2022
1 parent 3fe9ee2 commit 265b1ca
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,6 @@
<artifactId>org.jacoco.agent</artifactId>
<classifier>runtime</classifier>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.multi.attribute.login.mgt</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.organization.management.core</groupId>
<artifactId>org.wso2.carbon.identity.organization.management.service</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.base</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
Expand All @@ -122,15 +110,10 @@
version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.event.*;
version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.base;version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.governance; version="${identity.governance.imp.pkg.version.range}",
org.wso2.carbon.utils.multitenancy; version="${carbon.kernel.imp.pkg.version.range}",
org.wso2.carbon.user.core.service; version="${carbon.kernel.package.import.version.range}",
org.wso2.carbon.user.api; version="${carbon.user.api.imp.pkg.version.range}",
org.wso2.carbon.user.core.*; version="${carbon.kernel.package.import.version.range}",
org.wso2.carbon.identity.multi.attribute.login.mgt.*; version="${carbon.identity.framework.imp.pkg.version.range}",
org.wso2.carbon.identity.organization.management.service;version="${org.wso2.carbon.identity.organization.management.core.version.range}",
org.wso2.carbon.identity.organization.management.service.exception;version="${org.wso2.carbon.identity.organization.management.core.version.range}",
</Import-Package>
<Private-Package>
org.wso2.carbon.identity.application.authenticator.magiclink.internal,
Expand Down Expand Up @@ -210,4 +193,3 @@
</build>
</project>


Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
Expand Down Expand Up @@ -30,8 +30,6 @@
import org.wso2.carbon.identity.application.authenticator.magiclink.MagicLinkAuthenticator;
import org.wso2.carbon.identity.event.services.IdentityEventService;
import org.wso2.carbon.identity.governance.IdentityGovernanceService;
import org.wso2.carbon.identity.multi.attribute.login.mgt.MultiAttributeLoginService;
import org.wso2.carbon.identity.organization.management.service.OrganizationUserResidentResolverService;
import org.wso2.carbon.user.core.service.RealmService;

/**
Expand Down Expand Up @@ -115,47 +113,4 @@ protected void unsetIdentityEventService(IdentityEventService eventService) {

MagicLinkServiceDataHolder.getInstance().setIdentityEventService(null);
}

@Reference(
name = "MultiAttributeLoginService",
service = MultiAttributeLoginService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetMultiAttributeLoginService")
protected void setMultiAttributeLoginService(MultiAttributeLoginService multiAttributeLogin) {

MagicLinkServiceDataHolder.getInstance().setMultiAttributeLoginService(multiAttributeLogin);
}

protected void unsetMultiAttributeLoginService(MultiAttributeLoginService multiAttributeLogin) {

MagicLinkServiceDataHolder.getInstance().setMultiAttributeLoginService(null);

}

@Reference(
name = "organization.user.resident.resolver.service",
service = OrganizationUserResidentResolverService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetOrganizationUserResidentResolverService"
)
protected void setOrganizationUserResidentResolverService(
OrganizationUserResidentResolverService organizationUserResidentResolverService) {

if (log.isDebugEnabled()) {
log.debug("Setting the organization user resident resolver service.");
}
MagicLinkServiceDataHolder.getInstance().setOrganizationUserResidentResolverService(organizationUserResidentResolverService);
}

protected void unsetOrganizationUserResidentResolverService(
OrganizationUserResidentResolverService organizationUserResidentResolverService) {

if (log.isDebugEnabled()) {
log.debug("Unset organization user resident resolver service.");
}
MagicLinkServiceDataHolder.getInstance().setOrganizationUserResidentResolverService(null);
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -19,8 +19,6 @@

import org.wso2.carbon.identity.event.services.IdentityEventService;
import org.wso2.carbon.identity.governance.IdentityGovernanceService;
import org.wso2.carbon.identity.multi.attribute.login.mgt.MultiAttributeLoginService;
import org.wso2.carbon.identity.organization.management.service.OrganizationUserResidentResolverService;
import org.wso2.carbon.user.core.service.RealmService;

/**
Expand All @@ -33,8 +31,6 @@ public class MagicLinkServiceDataHolder {
private IdentityEventService identityEventService;
private RealmService realmService;
private IdentityGovernanceService identityGovernanceService;
private MultiAttributeLoginService multiAttributeLoginService;
private OrganizationUserResidentResolverService organizationUserResidentResolverService;

private MagicLinkServiceDataHolder() {

Expand Down Expand Up @@ -65,47 +61,6 @@ public void setRealmService(RealmService realmService) {
this.realmService = realmService;
}

/**
* Get MultiAttribute Login Service.
*
* @return MultiAttribute Login Service.
*/
public MultiAttributeLoginService getMultiAttributeLoginService() {

return multiAttributeLoginService;
}

/**
* Set MultiAttribute Login Service.
*
* @param multiAttributeLoginService MultiAttribute Login Service.
*/
public void setMultiAttributeLoginService(MultiAttributeLoginService multiAttributeLoginService) {

this.multiAttributeLoginService = multiAttributeLoginService;
}

/**
* Get Organization User Resident Resolver Service.
*
* @return Organization User Resident Resolver Service.
*/
public OrganizationUserResidentResolverService getOrganizationUserResidentResolverService() {

return organizationUserResidentResolverService;
}

/**
* Set Organization User Resident Resolver Service.
*
* @param organizationUserResidentResolverService Organization User Resident Resolver Service.
*/
public void setOrganizationUserResidentResolverService
(OrganizationUserResidentResolverService organizationUserResidentResolverService) {

this.organizationUserResidentResolverService = organizationUserResidentResolverService;
}

/**
* Get Identity Governance Service.
*
Expand All @@ -126,4 +81,3 @@ public void setIdentityGovernanceService(IdentityGovernanceService identityGover
this.identityGovernanceService = identityGovernanceService;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
/*
* Copyright (c) 2022, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.identity.application.authenticator.magiclink.util;

/**
* Authentication error constants of MagicLink Authenticator.
*/
public class MagicLinkAuthErrorConstants {

/**
Expand All @@ -13,24 +33,8 @@ public enum ErrorMessages {
EMPTY_USERNAME("BAS-60002", "Username is empty."),

// IO related Error codes
SYSTEM_ERROR_WHILE_AUTHENTICATING("BAS-65001", "System error while authenticating"),
SYSTEM_ERROR_WHILE_AUTHENTICATING("BAS-65001", "System error while authenticating");

// Tenant related Error codes.
INVALID_TENANT_ID_OF_THE_USER("BAS-65011",
"Failed while trying to get the tenant ID of the user %s"),
CANNOT_FIND_THE_USER_REALM_FOR_THE_GIVEN_TENANT("BAS-65012",
"Cannot find the user realm for the given tenant: %s"),
// UserStore related Exceptions.
USER_STORE_EXCEPTION_WHILE_TRYING_TO_AUTHENTICATE("BAS-65021",
"UserStoreException while trying to authenticate"),
// Organization management exception while resolving user's resident org.
ORGANIZATION_MGT_EXCEPTION_WHILE_TRYING_TO_RESOLVE_RESIDENT_ORG("BAS-65022",
"Organization mgt exception while authenticating"),
// UserStore Error codes.
USER_DOES_NOT_EXISTS("17001", "User does not exists"),

// User identification failure in organization hierarchy.
USER_NOT_IDENTIFIED_IN_HIERARCHY("17003", "User is not identified");
private final String code;
private final String message;

Expand Down
37 changes: 0 additions & 37 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@
<artifactId>org.wso2.carbon.user.api</artifactId>
<version>${carbon.kernel.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.multi.attribute.login.mgt</artifactId>
<version>${carbon.identity.framework.version}</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
Expand Down Expand Up @@ -115,30 +110,6 @@
<classifier>runtime</classifier>
<version>${jacoco.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.organization.management.core</groupId>
<artifactId>org.wso2.carbon.identity.organization.management.service</artifactId>
<version>${org.wso2.carbon.identity.organization.management.core.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.base</artifactId>
<version>${carbon.identity.framework.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
<build>
Expand Down Expand Up @@ -223,7 +194,6 @@
<identity.application.authenticator.magiclink.exp.pkg.version>${project.version}
</identity.application.authenticator.magiclink.exp.pkg.version>
<carbon.kernel.version>4.7.0</carbon.kernel.version>
<carbon.kernel.imp.pkg.version.range>[4.5.0, 5.0.0)</carbon.kernel.imp.pkg.version.range>
<carbon.identity.framework.version>5.23.18</carbon.identity.framework.version>
<apache.felix.scr.ds.annotations.version>1.2.10</apache.felix.scr.ds.annotations.version>
<identity.event.handler.notification.version>1.3.14</identity.event.handler.notification.version>
Expand Down Expand Up @@ -253,13 +223,6 @@
<findbugs-maven-plugin.version>3.0.5</findbugs-maven-plugin.version>
<maven.bundle.plugin.version>3.2.0</maven.bundle.plugin.version>
<maven.buildnumber.plugin.version>1.4</maven.buildnumber.plugin.version>

<!-- Organization management Version -->
<org.wso2.carbon.identity.organization.management.core.version>1.0.0
</org.wso2.carbon.identity.organization.management.core.version>
<org.wso2.carbon.identity.organization.management.core.version.range>[1.0.0, 2.0.0)
</org.wso2.carbon.identity.organization.management.core.version.range>
</properties>
</project>


0 comments on commit 265b1ca

Please sign in to comment.