Skip to content

Commit

Permalink
MOSIP-34075 removed secret keys
Browse files Browse the repository at this point in the history
Signed-off-by: Sohan Kumar Dey <[email protected]>
  • Loading branch information
Sohandey committed Jul 11, 2024
2 parents a788c74 + a0340cb commit dd91731
Show file tree
Hide file tree
Showing 33 changed files with 2,866 additions and 444 deletions.
135 changes: 101 additions & 34 deletions apitest-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<!-- kernel versions -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kernel-websubclient-api.version>1.2.0.1-SNAPSHOT</kernel-websubclient-api.version>

<!-- maven -->
<maven.compiler.target>11</maven.compiler.target>
Expand Down Expand Up @@ -190,11 +191,10 @@
<rest.assured.version>3.0.7</rest.assured.version>
<testng.version>6.11</testng.version>
<zt.zip.version>1.13</zt.zip.version>
<fileName>apitest-commons-1.2.0.1-SNAPSHOT-jar-with-dependencies</fileName>
<fileName>apitest-commons-1.2.1-SNAPSHOT-jar-with-dependencies</fileName>

</properties>
<dependencies>

<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
Expand Down Expand Up @@ -294,20 +294,21 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.1</version>
<version>2.12.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.5</version>
<version>2.12.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
Expand Down Expand Up @@ -410,11 +411,7 @@
</dependency>

<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
</dependency>

<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
<dependency>
<groupId>commons-codec</groupId>
Expand Down Expand Up @@ -481,21 +478,6 @@
</dependency>
<!-- Encryption Decryption Util Jar -->

<dependency>
<groupId>io.mosip.testrig.authentication.demo</groupId>
<artifactId>authentication-demo-service</artifactId>
<version>1.2.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-core</artifactId>
Expand Down Expand Up @@ -532,9 +514,86 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>compile</scope>
</dependency>
<version>1.18.32</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>io.mosip.authentication</groupId>
<artifactId>authentication-core</artifactId>
<version>1.2.0.1-B3</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-core</artifactId>
<version>1.2.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</exclusion>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-websubclient-api</artifactId>
<version>${kernel-websubclient-api.version}</version>
</dependency>

<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-templatemanager-velocity</artifactId>
<version>1.2.0.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-keymanager-service</artifactId>
<version>1.2.0.1-SNAPSHOT</version>
<classifier>lib</classifier>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>

</dependencies>
<dependencyManagement>
<dependencies>
Expand All @@ -555,6 +614,14 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -784,4 +851,4 @@
</build>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.mosip.testrig.apirig.admin.fw.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import io.mosip.kernel.crypto.jce.core.CryptoCore;

@Configuration
@Import({ CryptoCore.class })
@ComponentScan(basePackages = { "io.mosip.testrig.apirig", "io.mosip.testrig.dslrig"})
public class BeanConfig {
int i = 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.mosip.testrig.apirig.dto;

import lombok.Data;

import java.util.Map;

@Data
public class EncryptionRequestDto {

private Map<String, Object> identityRequest;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.mosip.testrig.apirig.dto;

import lombok.Data;

@Data
public class EncryptionResponseDto {
String encryptedSessionKey;
String encryptedIdentity;
String requestHMAC;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ public class TestCaseDTO {
private boolean checkErrorsOnlyInResponse;
private String allowedErrorCodes;
private String[] kycFields;
private String description;
}
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ protected void writeSuiteSummary() {

// Left column: "Tested Component Details" with central alignment
writer.print("<th style=\"text-align: center; vertical-align: middle;\" colspan=\"2\"><span class=\"not-bold\"><pre>");
writer.print(Utils.escapeHtml("Tested Components & End Points"));
writer.print(Utils.escapeHtml("End Points used"));
writer.print("</span></th>");

// Right column: Details from AdminTestUtil.getServerComponentsDetails() without bold formatting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.apache.log4j.PropertyConfigurator;
import org.json.JSONArray;
import org.json.simple.JSONObject;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.ITestContext;
import org.testng.annotations.AfterSuite;

Expand All @@ -29,6 +31,7 @@
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.nimbusds.jose.jwk.RSAKey;

import io.mosip.testrig.apirig.admin.fw.config.BeanConfig;
import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthTestsUtil;
Expand All @@ -48,8 +51,8 @@
* All suite level before and after tests will be completed here.
*
*/

public class BaseTestCase {
@ContextConfiguration(classes = {BeanConfig.class})
public class BaseTestCase extends AbstractTestNGSpringContextTests {

protected static Logger logger = Logger.getLogger(BaseTestCase.class);
protected static MockSMTPListener mockSMTPListener = null;
Expand Down Expand Up @@ -95,7 +98,7 @@ public class BaseTestCase {
public String mobileAuthCookie = null;
public String autoTstUsrCkie = null;
public static String currentModule = GlobalConstants.MASTERDATA;
public static String certsForModule = "DSL-IDA";
public static String certsForModule = "DSL";
public static List<String> listOfModules = null;
public static List<String> languageList = new ArrayList<>();
public static String languageCode = null;
Expand All @@ -114,7 +117,7 @@ public class BaseTestCase {
public static Map<?, ?> residentQueries;
public static Map<?, ?> partnerQueries;
public static boolean insertDevicedata = false;
public static boolean proxy = false;
public static boolean proxy = true;

public static String ApplnURI;
public static String ApplnURIForKeyCloak;
Expand Down Expand Up @@ -266,8 +269,8 @@ public static void suiteSetup() {
BaseTestCase.certsForModule = "IDA";
AuthTestsUtil.initiateAuthTest();

mockSMTPListener = new MockSMTPListener();
mockSMTPListener.run();
// mockSMTPListener = new MockSMTPListener();
// mockSMTPListener.run();
}
if (listOfModules.contains("idrepo")) {
setReportName("idrepo");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.EncryptionDecrptionUtil;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.GlobalMethods;
import io.mosip.testrig.apirig.utils.JWKKeyUtil;
import io.mosip.testrig.apirig.utils.KeyCloakUserAndAPIKeyGeneration;
import io.mosip.testrig.apirig.utils.KeycloakUserManager;
Expand Down Expand Up @@ -71,15 +72,14 @@ public static void main(String[] arg) {
ConfigManager.init();
BaseTestCase.suiteSetup();
setLogLevels();
AdminTestUtil.encryptDecryptUtil = new EncryptionDecrptionUtil();

// For now we are not doing health check for qa-115.
if (BaseTestCase.isTargetEnvLTS()) {
HealthChecker healthcheck = new HealthChecker();
healthcheck.setCurrentRunningModule(BaseTestCase.currentModule);
Thread trigger = new Thread(healthcheck);
trigger.start();
}
// if (BaseTestCase.isTargetEnvLTS()) {
// HealthChecker healthcheck = new HealthChecker();
// healthcheck.setCurrentRunningModule(BaseTestCase.currentModule);
// Thread trigger = new Thread(healthcheck);
// trigger.start();
// }
KeycloakUserManager.removeUser();
KeycloakUserManager.createUsers();
KeycloakUserManager.closeKeycloakInstance();
Expand Down Expand Up @@ -150,7 +150,6 @@ public static void main(String[] arg) {
DBManager.clearKeyManagerDbData();
}


System.exit(0);

}
Expand Down
Loading

0 comments on commit dd91731

Please sign in to comment.