Skip to content

Commit

Permalink
[INJICERT-434] fix integration test
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Vardhan <[email protected]>
  • Loading branch information
vharsh committed Oct 14, 2024
1 parent 520e6d8 commit eb90712
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void run(ApplicationArguments args) throws Exception {
// TODO: Generate an EC & ED key via K8s Job(INJICERT-469)
KeyPairGenerateRequestDto rsaKeyRequest = new KeyPairGenerateRequestDto();
rsaKeyRequest.setApplicationId(Constants.CERTIFY_MOCK_RSA);
rsaKeyRequest.setReferenceId(Constants.EMPTY_REF_ID);
rsaKeyRequest.setForce(false);
keymanagerService.generateMasterKey("certificate", rsaKeyRequest);
if(!StringUtils.isEmpty(cacheSecretKeyRefId)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.mosip.certify.services;

public class KeyManagerConstants {
public static final String VC_SIGN_ALGO = "VCsignAlgo";
public static final String PUBLIC_KEY_URL = "publicKeyURL";
public static final String KEY_APP_ID = "keyAppId";
public static final String KEY_REF_ID = "keyRefId";
public static final String KEYMGR_SIGN_ALGO = "KeyMgrSignAlgo";
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
mosip.certify.integration.scan-base-package=io.mosip.certify
mosip.certify.integration.audit-plugin=TestAuditPlugin
mosip.certify.integration.vci-plugin=TestVCIPluginImpl
mosip.certify.dataprovider.types={'MockVerifiableCredential','StudentCredential','UniversityCredential'}

## ------------------------------------------ Discovery openid-configuration -------------------------------------------
mosipbox.public.url=http://localhost:8090
mosip.certify.discovery.issuer-id=${mosipbox.public.url}${server.servlet.path}
mosip.certify.pub.key=http://localhost/pub.key.json

##---------------------------------------------------------------------------------------------------------------------
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration,org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration
Expand All @@ -23,6 +25,7 @@ mosip.certify.authn.filter-urls={ '${server.servlet.path}/issuance/credential' }
mosip.certify.authn.issuer-uri=${mosipbox.public.url}${server.servlet.path}
mosip.certify.authn.jwk-set-uri=${mosipbox.public.url}${server.servlet.path}/oauth/.well-known/jwks.json
mosip.certify.authn.allowed-audiences={ '${mosipbox.public.url}${server.servlet.path}/issuance/credential' }
mosip.certify.mock.authenticator.get-identity-url=http://localhost:8082/v1/mock-identity-system/identity

mosip.certify.supported.jwt-proof-alg={'RS256'}
mosip.certify.key-values={\
Expand Down Expand Up @@ -282,4 +285,4 @@ spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=test
spring.datasource.password=test

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
2 changes: 1 addition & 1 deletion certify-service/src/test/resources/data.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

MERGE INTO KEY_POLICY_DEF (APP_ID,KEY_VALIDITY_DURATION,PRE_EXPIRE_DAYS,ACCESS_ALLOWED,IS_ACTIVE,CR_BY,CR_DTIMES) KEY(APP_ID) VALUES ('ROOT', 1095, 50, 'NA', true, 'mosipadmin', now()), ('CERTIFY_SERVICE', 1095, 50, 'NA', true, 'mosipadmin', now()), ('CERTIFY_PARTNER', 1095, 50, 'NA', true, 'mosipadmin', now());
MERGE INTO KEY_POLICY_DEF (APP_ID,KEY_VALIDITY_DURATION,PRE_EXPIRE_DAYS,ACCESS_ALLOWED,IS_ACTIVE,CR_BY,CR_DTIMES) KEY(APP_ID) VALUES ('ROOT', 1095, 50, 'NA', true, 'mosipadmin', now()), ('CERTIFY_SERVICE', 1095, 50, 'NA', true, 'mosipadmin', now()), ('CERTIFY_PARTNER', 1095, 50, 'NA', true, 'mosipadmin', now()), ('CERTIFY_MOCK_RSA', 1095, 50, 'NA', true, 'mosipadmin', now());
7 changes: 7 additions & 0 deletions certify-service/src/test/resources/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ CREATE TABLE IF NOT EXISTS key_store(
del_dtimes timestamp,
CONSTRAINT pk_keystr_id PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS template_data(
context character varying(1024) NOT NULL,
credential_type character varying(512) NOT NULL,
template VARCHAR NOT NULL,
CONSTRAINT pk_template PRIMARY KEY (context, credential_type)
);
6 changes: 6 additions & 0 deletions db_scripts/mosip_certify/ddl/template_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE IF NOT EXISTS template_data(
context character varying(1024) NOT NULL,
credential_type character varying(512) NOT NULL,
template VARCHAR NOT NULL,
CONSTRAINT pk_template PRIMARY KEY (context, credential_type)
);

0 comments on commit eb90712

Please sign in to comment.