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

Refactor application-mgt component to utilize certificate-mgt component for certificate management #6087

Merged
merged 23 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
067ac3b
Add certificate-mgt dependency to application-mgt component
ashanthamara Oct 29, 2024
5ed786b
Merge remote-tracking branch 'upstream/master' into aplication-cert-r…
ashanthamara Oct 30, 2024
9380fa1
Merge remote-tracking branch 'upstream/master' into aplication-cert-r…
ashanthamara Oct 31, 2024
ef25295
Merge remote-tracking branch 'upstream/master' into aplication-cert-r…
ashanthamara Oct 31, 2024
04f1709
Merge remote-tracking branch 'upstream/master' into aplication-cert-r…
ashanthamara Oct 31, 2024
13d40af
Refactor application-mgt to untilize certificate-mgt component for ap…
ashanthamara Oct 31, 2024
a8a2c74
Add sonarcloud suggestions
ashanthamara Oct 31, 2024
3df2972
Remove unused imports
ashanthamara Oct 31, 2024
087fa31
Merge remote-tracking branch 'upstream/master' into aplication-cert-r…
ashanthamara Oct 31, 2024
cb77832
Merge remote-tracking branch 'upstream/master' into aplication-cert-r…
ashanthamara Oct 31, 2024
8d1f6c8
Add unit tests for application certificate management
ashanthamara Oct 31, 2024
ba5690a
Modify unit tests
ashanthamara Oct 31, 2024
03eb962
Refactor application-certificate unit tests
ashanthamara Oct 31, 2024
9e2b77a
Merge remote-tracking branch 'upstream/master' into aplication-cert-r…
ashanthamara Oct 31, 2024
2cb3660
Improve line coverage
ashanthamara Nov 1, 2024
1e209e8
Add sonarCloud suggestion to reduce method complexity
ashanthamara Nov 1, 2024
06df9f3
Change CERTIFICATE property name to the defined constant variable
ashanthamara Nov 1, 2024
9a2dc88
address comments
ashanthamara Nov 1, 2024
75731fd
Merge remote-tracking branch 'upstream/master' into aplication-cert-r…
ashanthamara Nov 1, 2024
d0b0159
Remove schema change
ashanthamara Nov 2, 2024
bd6bd85
Add comments to the test methods
ashanthamara Nov 2, 2024
d3a1043
Improve assertions
ashanthamara Nov 2, 2024
116694b
Minor improvement
ashanthamara Nov 2, 2024
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
Original file line number Diff line number Diff line change
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 @@ -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 @@ -3023,7 +3022,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 +3043,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
Loading
Loading