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

Add certificate-mgt component to manage trusted certificates in IAM #6043

Merged
merged 38 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
74bfe7a
Add certificate-mgt component
ashanthamara Oct 21, 2024
f8b2297
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 21, 2024
69dfdc8
Update version
ashanthamara Oct 21, 2024
4af17e4
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 21, 2024
4b44799
Refactor few classes
ashanthamara Oct 21, 2024
b216abc
Add certificate.management.server.feature
ashanthamara Oct 21, 2024
0b2f4b6
Refactor debug logs by removing isDebugEnabled check
ashanthamara Oct 21, 2024
35e940a
Add CertificateMgtExceptionHandler for handling exceptions
ashanthamara Oct 21, 2024
d53d972
Address comments
ashanthamara Oct 21, 2024
965a413
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 21, 2024
a60b87f
Update version
ashanthamara Oct 21, 2024
865201e
Make the methods inside CertificateValidator to be static as it is a …
ashanthamara Oct 22, 2024
7a7a224
Add missing new lines
ashanthamara Oct 22, 2024
4362011
Fix daoImpl reference in serviceImpl classes
ashanthamara Oct 22, 2024
45c4907
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 22, 2024
1e9e867
Improve deprecated class description
ashanthamara Oct 22, 2024
925a77c
Add sonarcloud suggestions
ashanthamara Oct 22, 2024
b84da9a
Fix checkstyle issue
ashanthamara Oct 22, 2024
440c3e2
Remove full certificate update and keep updatecertificatecontent() me…
ashanthamara Oct 22, 2024
589ee13
Add caching layer in certificate-mgt with tests
ashanthamara Oct 23, 2024
faab1ef
Rename module to remove 'core' name
ashanthamara Oct 23, 2024
f872436
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 23, 2024
f33815e
Address comments
ashanthamara Oct 23, 2024
b79d59e
Refactor service interfaces into a separate package
ashanthamara Oct 24, 2024
5241203
Address comments
ashanthamara Oct 24, 2024
9db29dc
Refactor serviceimpl unit tests
ashanthamara Oct 24, 2024
1125d3b
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 24, 2024
4de2723
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 24, 2024
2954616
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 24, 2024
335b418
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 24, 2024
30fe7ef
Refactor daoimpl tests
ashanthamara Oct 24, 2024
cb43788
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 24, 2024
a83ea7f
Update db scripts
ashanthamara Oct 24, 2024
abbace0
Fix sonarcloud issues
ashanthamara Oct 24, 2024
91410cf
Remove redundant name
ashanthamara Oct 24, 2024
418e4bc
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 25, 2024
90bb253
Merge remote-tracking branch 'upstream/master' into certificate-mgt
ashanthamara Oct 25, 2024
a44e16c
Change mvn version
ashanthamara Oct 25, 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
@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>certificate-mgt</artifactId>
<version>7.5.80-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.identity.certificate.management</artifactId>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Certificate Management Core</name>
<description>Identity Certificate Management Core</description>

<dependencies>
<dependency>
<groupId>org.wso2.carbon.utils</groupId>
<artifactId>org.wso2.carbon.database.utils</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.core</artifactId>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.testutil</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>
${project.artifactId}
</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>
org.wso2.carbon.identity.certificate.management.dao,
org.wso2.carbon.identity.certificate.management.internal,
org.wso2.carbon.identity.certificate.management.util,
</Private-Package>
<Export-Package>
!org.wso2.carbon.identity.certificate.management.dao,
!org.wso2.carbon.identity.certificate.management.internal,
!org.wso2.carbon.identity.certificate.management.util,
org.wso2.carbon.identity.certificate.management.*;
version="${carbon.identity.package.export.version}"
</Export-Package>
<Import-Package>
org.apache.axiom.om.util; version="${axiom.osgi.version.range}",
org.apache.commons.lang; version="${commons-lang.wso2.osgi.version.range}",
org.apache.commons.logging; version="${import.package.version.commons.logging}",
org.osgi.framework; version="${osgi.framework.imp.pkg.version.range}",
org.osgi.service.component; version="${osgi.service.component.imp.pkg.version.range}",
org.wso2.carbon.database.utils.jdbc;version="${org.wso2.carbon.database.utils.version.range}",
org.wso2.carbon.database.utils.jdbc.exceptions;version="${org.wso2.carbon.database.utils.version.range}",
org.wso2.carbon.identity.core.util; version="${carbon.identity.package.import.version.range}",
</Import-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-report-integration</id>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule implementation="org.jacoco.maven.RuleConfiguration">
<element>BUNDLE</element>
<limits>
<limit implementation="org.jacoco.report.check.Limit">
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.80</minimum>
</limit>
<limit implementation="org.jacoco.report.check.Limit">
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<excludeFilterFile>../../../spotbugs-exclude.xml</excludeFilterFile>
<effort>Max</effort>
<threshold>High</threshold>
<xmlOutput>true</xmlOutput>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
*
* 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.certificate.management;

import org.wso2.carbon.identity.certificate.management.exception.CertificateMgtException;
import org.wso2.carbon.identity.certificate.management.model.Certificate;

/**
* Interface for managing trusted certificates of applications of a tenant.
* This service supports using auto-incremented IDs for certificate management operations in application-mgt.
*
* @deprecated It is recommended to use {@link CertificateManagementService}, which supports operations with UUID.
*/
@Deprecated
public interface ApplicationCertificateManagementService {

/**
* Add a certificate.
*
* @param certificate Certificate information.
* @param tenantDomain Tenant domain.
* @return Auto incremented integer id of the Certificate.
* @throws CertificateMgtException If an error occurs while adding the certificate.
*/
@Deprecated
int addCertificate(Certificate certificate, String tenantDomain) throws CertificateMgtException;

/**
* Get certificate information with given id.
*
* @param certificateId Certificate ID.
* @param tenantDomain Tenant domain.
* @return Certificate information.
* @throws CertificateMgtException If an error occurs while getting the certificate.
*/
@Deprecated
Certificate getCertificate(int certificateId, String tenantDomain) throws CertificateMgtException;

/**
* Get certificate information with given name.
*
* @param certificateName Certificate name.
* @param tenantDomain Tenant domain.
* @return Certificate information.
* @throws CertificateMgtException If an error occurs while getting the certificate by name.
*/
@Deprecated
Certificate getCertificateByName(String certificateName, String tenantDomain) throws CertificateMgtException;

/**
* Update a certificate with given id.
*
* @param certificateId Certificate ID.
* @param certificateContent Certificate content.
* @param tenantDomain Tenant domain.
* @throws CertificateMgtException If an error occurs while updating the certificate.
*/
@Deprecated
void updateCertificateContent(int certificateId, String certificateContent, String tenantDomain)
throws CertificateMgtException;

/**
* Delete a certificate with given id.
*
* @param certificateId Certificate ID.
* @param tenantDomain Tenant domain.
* @throws CertificateMgtException If an error occurs while deleting the certificate.
*/
@Deprecated
void deleteCertificate(int certificateId, String tenantDomain) throws CertificateMgtException;
}
Loading
Loading