Skip to content

Commit

Permalink
Merge branch 'wso2:master' into add-cutsom-fed-auth-mgt-support
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla authored Nov 5, 2024
2 parents 35805c7 + 00ac18b commit 377dc85
Show file tree
Hide file tree
Showing 289 changed files with 1,550 additions and 839 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>action-mgt</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static class ActionIDs {
public static final String PROCESS_ACTION_REQUEST = "process-action-request";
public static final String SEND_ACTION_REQUEST = "send-action-request";
public static final String RECEIVE_ACTION_RESPONSE = "receive-action-response";
public static final String VALIDATE_ACTION_OPERATIONS = "validate-action-response";
public static final String EXECUTE_ACTION_OPERATIONS = "process-action-response";
public static final String VALIDATE_ACTION_RESPONSE = "validate-action-response";
public static final String PROCESS_ACTION_RESPONSE = "process-action-response";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void logPerformableOperations(Action action, List<String> allowedOps, Lis
return;
}
DiagnosticLog.DiagnosticLogBuilder diagnosticLogBuilder = initializeDiagnosticLogBuilder(
ActionExecutionLogConstants.ActionIDs.VALIDATE_ACTION_OPERATIONS,
ActionExecutionLogConstants.ActionIDs.VALIDATE_ACTION_RESPONSE,
"Validated operations to perform on " + action.getType().getDisplayName() + " action.",
DiagnosticLog.ResultStatus.SUCCESS);
triggerLogEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>action-mgt</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -55,6 +55,10 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.central.log.mgt</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR (
IS_ENABLED CHAR (1) DEFAULT '1',
DISPLAY_NAME VARCHAR(255),
DEFINED_BY VARCHAR(25) NOT NULL,
AUTHENTICATION_TYPE VARCHAR(25) NOT NULL,
PRIMARY KEY (ID),
UNIQUE (TENANT_ID, IDP_ID, NAME),
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
Expand Down
2 changes: 1 addition & 1 deletion components/action-mgt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>identity-framework</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>api-resource-mgt</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>api-resource-mgt</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.carbon.identity.api.resource.mgt</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR (
IS_ENABLED CHAR (1) DEFAULT '1',
DISPLAY_NAME VARCHAR(255),
DEFINED_BY VARCHAR(25) NOT NULL,
AUTHENTICATION_TYPE VARCHAR(25) NOT NULL,
PRIMARY KEY (ID),
UNIQUE (TENANT_ID, IDP_ID, NAME),
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
Expand Down
2 changes: 1 addition & 1 deletion components/api-resource-mgt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>identity-framework</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>application-mgt</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>application-mgt</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>application-mgt</artifactId>
<version>7.5.102-SNAPSHOT</version>
<version>7.5.115-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.carbon.identity.application.mgt</artifactId>
Expand Down Expand Up @@ -191,6 +191,10 @@
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.secret.mgt.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.certificate.management</artifactId>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -260,6 +264,9 @@
version="${org.wso2.carbon.identity.organization.management.core.version.range}",
org.wso2.carbon.identity.api.resource.mgt.model; version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.identity.api.resource.mgt.util; version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.identity.certificate.management.service; version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.identity.certificate.management.exception; version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.identity.certificate.management.model; version="${carbon.identity.package.import.version.range}",
</Import-Package>
<Export-Package>
!org.wso2.carbon.identity.application.mgt.internal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,21 @@ public ApplicationBasicInfo getApplicationBasicInfoByName(String name, String te
throw new NotImplementedException();
}


/**
* Retrieve application UUID using the application name.
*
* @param name Name of the application
* @param tenantDomain Tenant domain of the application
* @return Application UUID
* @throws IdentityApplicationManagementException
*/
public String getApplicationUUIDByName(String name, String tenantDomain)
throws IdentityApplicationManagementException {

throw new NotImplementedException();
}
/**
* Get custom inbound authenticator configurations.
*
* @return custom inbound authenticator configs maps.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
import static org.wso2.carbon.identity.application.mgt.inbound.InboundFunctions.updateOrInsertInbound;
import static org.wso2.carbon.identity.central.log.mgt.utils.LoggerUtils.triggerAuditLogEvent;
import static org.wso2.carbon.identity.core.util.IdentityUtil.getInitiatorId;
import static org.wso2.carbon.identity.core.util.IdentityUtil.isValidPEMCertificate;
import static org.wso2.carbon.identity.role.v2.mgt.core.RoleConstants.Error.ROLE_MANAGEMENT_ERROR_CODE_PREFIX;
import static org.wso2.carbon.identity.role.v2.mgt.core.RoleConstants.Error.ROLE_NOT_FOUND;
import static org.wso2.carbon.utils.multitenancy.MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
Expand Down Expand Up @@ -656,6 +655,19 @@ public ApplicationBasicInfo getApplicationBasicInfoByName(String name, String te
return basicAppInfo;
}

@Override
public String getApplicationUUIDByName(String name, String tenantDomain)
throws IdentityApplicationManagementException {

if (log.isDebugEnabled()) {
log.debug("Getting application UUID for name: " + name
+ " in tenantDomain: " + tenantDomain);
}

ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
return appDAO.getApplicationUUIDByName(name, tenantDomain);
}

/**
* Get count of all Application Basic Information.
*
Expand Down Expand Up @@ -3023,7 +3035,6 @@ private void doPreUpdateChecks(String storedAppName, ServiceProvider updatedApp,

validateAuthorization(updatedAppName, storedAppName, username, tenantDomain);
validateAppName(storedAppName, updatedApp, tenantDomain);
validateApplicationCertificate(updatedApp, tenantDomain);
boolean isValid = isAssociatedRolesConfigValid(updatedApp, tenantDomain);
if (!isValid) {
throw new IdentityApplicationManagementClientException(
Expand All @@ -3045,17 +3056,6 @@ private void updateApplicationPermissions(ServiceProvider updatedApp, String upd
}
}

private void validateApplicationCertificate(ServiceProvider updatedApp,
String tenantDomain) throws IdentityApplicationManagementException {

if (!isValidPEMCertificate(updatedApp.getCertificateContent())) {
String error = "Provided application certificate for application with name: %s in tenantDomain: %s " +
"is malformed.";
throw buildClientException(INVALID_REQUEST,
String.format(error, updatedApp.getApplicationName(), tenantDomain));
}
}

private void validateApplicationConfigurations(ServiceProvider application,
String tenantDomain,
String username) throws IdentityApplicationManagementException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ public class ApplicationMgtDBQueries {
"B.DISPLAY_NAME FROM IDP A JOIN IDP_AUTHENTICATOR B ON A.ID = B.IDP_ID WHERE B.ID =? AND ((A.TENANT_ID =?" +
" AND B.TENANT_ID =?) OR (A.TENANT_ID=? AND A.NAME LIKE 'SHARED_%' AND B.TENANT_ID=?))";
public static final String STORE_LOCAL_AUTHENTICATOR = "INSERT INTO IDP_AUTHENTICATOR (TENANT_ID, IDP_ID, NAME," +
"IS_ENABLED, DISPLAY_NAME, DEFINED_BY) " +
"VALUES (?, (SELECT ID FROM IDP WHERE IDP.NAME=? AND IDP.TENANT_ID =?), ?, ?, ?, ?)";
"IS_ENABLED, DISPLAY_NAME, DEFINED_BY, AUTHENTICATION_TYPE) " +
"VALUES (?, (SELECT ID FROM IDP WHERE IDP.NAME=? AND IDP.TENANT_ID =?), ?, ?, ?, ?, ?)";

public static final String GET_SP_METADATA_BY_SP_ID = "SELECT ID, NAME, VALUE, DISPLAY_NAME FROM SP_METADATA " +
"WHERE SP_ID = ?";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,20 @@ default ApplicationBasicInfo getApplicationBasicInfoByName(String name, String t
throw new NotImplementedException();
}

/**
* Retrieve application UUID using the application name.
*
* @param name Name of the application
* @param tenantDomain Tenant domain of the application
* @return Application UUID
* @throws IdentityApplicationManagementException
*/
default String getApplicationUUIDByName(String name, String tenantDomain)
throws IdentityApplicationManagementException {

throw new NotImplementedException();
}

default String addApplication(ServiceProvider application, String tenantDomain)
throws IdentityApplicationManagementException {

Expand Down
Loading

0 comments on commit 377dc85

Please sign in to comment.