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

Merge from release-1.5.x to develop #1059

Merged
merged 108 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
15d8242
[DSD-6382] updated chart version in helm and deployment scripts
ckm007 Oct 4, 2024
1013b06
[DSD-6382] updated changes as reported during dev round
ckm007 Oct 4, 2024
4fa1c67
Merge pull request #932 from mosip/DSD-6382
ckm007 Oct 4, 2024
576292d
[DSD-6382] adding fixes for issues reported during dev round
ckm007 Oct 4, 2024
7a751a0
[DSD-6382] removing swp file added by mistake
ckm007 Oct 4, 2024
20e7552
Merge pull request #933 from mosip/DSD-6382
ckm007 Oct 4, 2024
db488a1
[DSD-6382] increased initialDelaySeconds in esignet helm
ckm007 Oct 4, 2024
3c3e3ad
[DSD-6382] updated healthcheck configurations
ckm007 Oct 4, 2024
8d373b4
[DSD-6382] removed unused clusterrolebinding
ckm007 Oct 4, 2024
e2c2b5c
Merge pull request #935 from mosip/DSD-6382
ckm007 Oct 4, 2024
e0461c8
Updated readme, pom.xml. Added NoOpKeyBinder default implementation
ase-101 Oct 6, 2024
80a65e8
Merge pull request #936 from ase-101/release-1.5.x
ckm007 Oct 6, 2024
f0640fa
[DSD-6382] updated correct onboarder chart version
ckm007 Oct 7, 2024
8f4233e
[DSD-6382] removed not required enabled params from realm attribute
ckm007 Oct 7, 2024
68fd2fb
[DSD-6382] added misp key update part
ckm007 Oct 7, 2024
8b96f25
[DSD-6382] updated message
ckm007 Oct 7, 2024
1ae3f87
Merge pull request #938 from ckm007/release-1.5.x
ckm007 Oct 7, 2024
d60c127
MOSIP-36454 - fixed build issue by adding suite setup in runner file …
mohanachandran-s Oct 9, 2024
264c510
[DSD-6382] added captcha secret update part to initialisation script …
ckm007 Oct 15, 2024
0120dcf
[ES-842] Updated the stoplight (#944) (#945)
ase-101 Oct 15, 2024
2988440
ES-842 Using mulitple profiles to avoid duplicate configuration
ase-101 Oct 15, 2024
b82cffd
Merge pull request #957 from ase-101/release-1.5.x
ckm007 Oct 16, 2024
e1d9b82
Delete .github/workflows/codeql-analysis.yml (#965)
rajapandi1234 Oct 18, 2024
0c670bf
ES-1807 & updated postman collection (#964)
ase-101 Oct 18, 2024
dbeb9d7
[DSD-6445] (#974)
ckm007 Oct 23, 2024
3391008
[DSD-6445] Updated esignet-global-cm.yaml.sample
abhishek8shankar Oct 25, 2024
acb8ca7
[DSD-6445] Updated esignet-global-cm.yaml.sample (#977)
abhishek8shankar Oct 28, 2024
317ddfd
Merge branch 'mosip:release-1.5.x' into release-1.5.x
abhishek8shankar Oct 28, 2024
267d23e
[DSD-6445] Updated install.sh scripts for softhsm .
abhishek8shankar Oct 28, 2024
933ce96
Merge pull request #981 from abhishek8shankar/release-1.5.x
ckm007 Oct 28, 2024
d33db4f
[DSD-6445]Updated application-default.properties
Rakshitha650 Oct 30, 2024
7ff5b1c
Merge pull request #982 from Rakshitha650/patch-1
ckm007 Oct 30, 2024
4e7e59a
[ES-1892] [ES-1358] i18n translation changes and minor UI changes. (#…
gk-4VII Nov 4, 2024
6a2503f
ES-842
ase-101 Nov 3, 2024
3acb544
Merge pull request #985 from ase-101/release-1.5.x
ckm007 Nov 6, 2024
b4d66f7
MOSIP-37214
nandhu-kumar Nov 6, 2024
bdea2d4
Merge pull request #989 from nandhu-kumar/release-1.5.x
ckm007 Nov 6, 2024
f5d82e8
MOSIP-37214
nandhu-kumar Nov 11, 2024
e5dcf40
Merge remote-tracking branch 'upstream/release-1.5.x' into release-1.5.x
nandhu-kumar Nov 11, 2024
ce928f1
MOSIP-37214
nandhu-kumar Nov 11, 2024
bc6e8f8
Merge pull request #994 from nandhu-kumar/release-1.5.x
ckm007 Nov 11, 2024
f7bff95
MOSIP-37214 | Syncing changes from develop to Release 1.5.x
nandhu-kumar Nov 12, 2024
18ad7d7
Merge pull request #996 from nandhu-kumar/release-1.5.x
ckm007 Nov 13, 2024
580c7c7
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
d83bc1f
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
a1b823b
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
85ffb1e
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
35fbef0
MOSIP-37214
nandhu-kumar Nov 13, 2024
47547a2
Merge remote-tracking branch 'upstream/release-1.5.x' into release-1.5.x
nandhu-kumar Nov 13, 2024
c4ce474
MOSIP-37214
nandhu-kumar Nov 13, 2024
6ecfe85
[MOSIP-37447] restructured postgres
bhumi46 Nov 13, 2024
4c1d0c0
MOSIP-37214
nandhu-kumar Nov 13, 2024
0ce6bdd
MOSIP-37214
nandhu-kumar Nov 14, 2024
6891001
MOSIP-37476 - updated the docker file for jdk version
mohanachandran-s Nov 14, 2024
e186562
MOSIP-37214
nandhu-kumar Nov 14, 2024
159390b
MOSIP-37214
nandhu-kumar Nov 14, 2024
147ad04
Merge pull request #1002 from mohanachandran-s/patch-2
ckm007 Nov 14, 2024
6cbb5b4
Merge remote-tracking branch 'upstream/release-1.5.x' into release-1.5.x
nandhu-kumar Nov 14, 2024
29ab4fc
[DSD-6445] Updated install.sh for opting plugings
abhishek8shankar Nov 14, 2024
bb78dd7
MOSIP-37214
nandhu-kumar Nov 14, 2024
4b9cb29
[MOSIP-37447] added nfs helm changes for apitestrig
bhumi46 Nov 14, 2024
09d83d2
MOSIP-37214
nandhu-kumar Nov 15, 2024
1c841ed
Merge pull request #998 from nandhu-kumar/release-1.5.x
ckm007 Nov 15, 2024
6d5c3cf
Merge pull request #1004 from abhishek8shankar/release-1.5.x
ckm007 Nov 15, 2024
7e63ff6
[ES-1553] Hidden the language dropdown in the claim-details screen. (…
gk-4VII Nov 18, 2024
a71d5ef
ES-1929 (#1007)
ase-101 Nov 18, 2024
25f3b48
[MOSIP-37447] restructured postgres
bhumi46 Nov 19, 2024
4e69170
[MOSIP-37447] restructured postgres
bhumi46 Nov 19, 2024
f442fb7
[MOSIP-37447] restructured postgres
bhumi46 Nov 20, 2024
a51b904
[MOSIP-37447] restructured postgres
bhumi46 Nov 20, 2024
a4d0f56
[MOSIP-37447] restructured postgres
bhumi46 Nov 25, 2024
f8d1c21
Merge pull request #997 from bhumi46/release-1.5.x
ckm007 Nov 27, 2024
81e5a59
MOSIP-37793 - Updated the Readme file
mohanachandran-s Nov 28, 2024
08d9be8
Merge pull request #1019 from mohanachandran-s/patch-2
ckm007 Nov 29, 2024
32df861
[MOSIP-37815] Added Unique Config as User input (#1017)
VSIVAKALYAN Nov 29, 2024
409fc2e
[DSD-6742] updated/restructured install scripts for fixes
ckm007 Nov 29, 2024
54980e2
Merge pull request #1022 from shubham17998/release-1.5.x
ckm007 Nov 29, 2024
63bf6a4
Merge pull request #1020 from VSIVAKALYAN/release-1.5.x
ckm007 Nov 29, 2024
ca8db25
MOSIP-36485
nandhu-kumar Dec 4, 2024
fbe159f
MOSIP-36485
nandhu-kumar Dec 4, 2024
a93b85d
ES-1987
nandhu-kumar Dec 4, 2024
d11f9a8
Merge pull request #1025 from nandhu-kumar/release-1.5.x
ckm007 Dec 5, 2024
0435933
MOSIP-36485 (#1028)
nandhu-kumar Dec 5, 2024
cefe1a8
MOSIP-36485 | changes validation message (#1031)
nandhu-kumar Dec 6, 2024
2781a9b
ES-1856 updated Readme file as per review comments (#1023)
ase-101 Dec 10, 2024
053bf8d
[DSD-6742] Updated values.yaml
shubham17998 Dec 11, 2024
9a02050
[DSD-6742] Updated install.sh replaced global cm as esignet-global
shubham17998 Dec 11, 2024
85f1cd8
[DSD-6742] Updated apitestrig README
ckm007 Dec 11, 2024
15724e8
[DSD-6742] Updated Env variables in values.yaml
ckm007 Dec 11, 2024
74aba18
Merge pull request #1039 from shubham17998/release-1.5.x
ckm007 Dec 11, 2024
bb62027
[DSD-6742] removed unwanted Env variables in values.yaml
ckm007 Dec 11, 2024
cc8cc32
Merge pull request #1041 from shubham17998/release-1.5.x
ckm007 Dec 11, 2024
500f8d8
[DSD-6742] updated README
ckm007 Dec 12, 2024
ec90140
ES-842 (#1046)
ase-101 Dec 12, 2024
d51fea5
Merge pull request #1043 from shubham17998/release-1.5.x
ckm007 Dec 12, 2024
8a72bdf
Updated postman collection & docker compose (#1048)
ase-101 Dec 13, 2024
9d8c405
ES-842 Update esignet-openapi.yaml
ase-101 Dec 16, 2024
02d18f8
Merge pull request #1050 from mosip/ase-101-patch-4
ckm007 Dec 16, 2024
7aab66a
[DSD-6888]Update push-trigger.yml to check results for release. (#1051)
Mahesh-Binayak Dec 17, 2024
835a3f3
[DSD-6888]Update push-trigger.yml reverting changes for sonar test (#…
Mahesh-Binayak Dec 17, 2024
ef0ae97
Update README.md
Rakshitha650 Dec 17, 2024
0978270
Merge pull request #1053 from Rakshitha650/patch-2
ckm007 Dec 17, 2024
c1ed8e5
Update Dockerfile (#1057)
Prafulrakhade Dec 18, 2024
06e992d
MOSIP-36485 | Updated the commons released version in pom.xml (#1056)
nandhu-kumar Dec 18, 2024
dec7af1
[MOSIP-36849]updated README.md (#1055)
Rakshitha650 Dec 18, 2024
b54a11c
Merged release-1.5.x to develop
ase-101 Dec 18, 2024
db23cfd
Updated develop branch name
ase-101 Dec 18, 2024
8025a91
Updated api-test pom.xml
ase-101 Dec 18, 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
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mosip_esignet&id=mosip_esignet&metric=alert_status)](https://sonarcloud.io/dashboard?id=mosip_esignet)
# eSignet Project
## Overview

eSignet offers a seamless and straightforward solution for incorporating an existing trusted identity database into the digital realm via plugins.

This repository contains limited OpenId protocol implementation with:
* OAuth 2.0 RFC 6749 - Authorization code flow support
* OAuth 2.0 RFC 7636 - PKCE security extension
* OAuth 2.0 RFC 7523 - JWT profile for client authentication
* RFC 7519 - ID token and access token as JWT
* OpenID Connect Discovery 1.0 - /.well-known/openid-configuration
* RFC 5785 - Followed for both openid and oauth well-knowns
* Identity assurance 1.0
* Identity Assurance 1.0

## High level overview of eSignet with external systems

![esignet-architecture-overview.png](docs/esignet-architecture-overview.png)
![esignet-overview.png](docs/esignet-overview.png)

`Note: Kindly refer `[eSignet signup repository](https://github.com/mosip/esignet-signup)` for more details on eSignet signup module.`

eSignet repository contains following:

Expand Down Expand Up @@ -43,7 +45,7 @@ Refer to [SQL scripts](db_scripts).
The project requires JDK 11.
1. Build:
```
$ mvn clean install -Dgpg.skip=true
$ mvn clean install -Dgpg.skip=true -Dmaven.gitcommitid.skip=true
```
## [Deployment in K8 cluster](deploy/README.md)

Expand Down
8 changes: 4 additions & 4 deletions api-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<name>apitest-esignet</name>
<description>Parent project of MOSIP Esignet apitests</description>
<url>https://github.com/mosip/esignet</url>
<version>1.2.1-SNAPSHOT</version>
<version>1.5.1-SNAPSHOT</version>

<licenses>
<license>
Expand Down Expand Up @@ -49,14 +49,14 @@
<maven.source.plugin.version>2.2.1</maven.source.plugin.version>

<git.commit.id.plugin.version>3.0.1</git.commit.id.plugin.version>
<fileName>apitest-esignet-1.2.1-SNAPSHOT-jar-with-dependencies</fileName>
<fileName>apitest-esignet-1.5.1-SNAPSHOT-jar-with-dependencies</fileName>
</properties>

<dependencies>
<dependency>
<groupId>io.mosip.testrig.apirig.apitest.commons</groupId>
<groupId>io.mosip.testrig.apitest.commons</groupId>
<artifactId>apitest-commons</artifactId>
<version>1.2.2-SNAPSHOT</version>
<version>1.3.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ public static void suiteSetup(String runType) {
BaseTestCase.certsForModule = GlobalConstants.ESIGNET;
DBManager.executeDBQueries(EsignetConfigManager.getKMDbUrl(), EsignetConfigManager.getKMDbUser(),
EsignetConfigManager.getKMDbPass(), EsignetConfigManager.getKMDbSchema(),
getGlobalResourcePath() + "/" + "config/keyManagerCertDataDeleteQueries.txt");
getGlobalResourcePath() + "/" + "config/keyManagerDataDeleteQueriesForEsignet.txt");
DBManager.executeDBQueries(EsignetConfigManager.getIdaDbUrl(), EsignetConfigManager.getIdaDbUser(),
EsignetConfigManager.getPMSDbPass(), EsignetConfigManager.getIdaDbSchema(),
getGlobalResourcePath() + "/" + "config/idaCertDataDeleteQueries.txt");
getGlobalResourcePath() + "/" + "config/idaDeleteQueriesForEsignet.txt");
DBManager.executeDBQueries(EsignetConfigManager.getMASTERDbUrl(), EsignetConfigManager.getMasterDbUser(),
EsignetConfigManager.getMasterDbPass(), EsignetConfigManager.getMasterDbSchema(),
getGlobalResourcePath() + "/" + "config/masterDataCertDataDeleteQueries.txt");
getGlobalResourcePath() + "/" + "config/masterDataDeleteQueriesForEsignet.txt");
AdminTestUtil.initiateesignetTest();
BaseTestCase.otpListener = new OTPListener();
BaseTestCase.otpListener.run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,12 @@ public void test(TestCaseDTO testCaseDTO)


if (testCaseDTO.getTestCaseName().contains("VID") || testCaseDTO.getTestCaseName().contains("Vid")) {





if (!BaseTestCase.getSupportedIdTypesValue().contains("VID")
&& !BaseTestCase.getSupportedIdTypesValue().contains("vid")) {
throw new SkipException(GlobalConstants.VID_FEATURE_NOT_SUPPORTED);
}
}

String inputJson = testCaseDTO.getInput().toString();
JSONObject req = new JSONObject(testCaseDTO.getInput());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ public static String isTestCaseValidForExecution(TestCaseDTO testCaseDTO) {
// Let run test cases eSignet & MOSIP API calls --- both UIN and VID

// BaseTestCase.setSupportedIdTypes(Arrays.asList("UIN", "VID"));

getSupportedIdTypesValueFromActuator();

logger.info("supportedIdType = " + supportedIdType);

String endpoint = testCaseDTO.getEndPoint();
Expand Down Expand Up @@ -251,4 +250,4 @@ public static String replaceKeywordValue(String jsonString, String keyword, Stri
throw new SkipException("Marking testcase as skipped as required fields are empty " + keyword);
}

}
}
6 changes: 3 additions & 3 deletions api-test/src/main/resources/config/esignet.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ tokenEndpoint=/v1/esignet/oauth/token
validateBindingEndpoint=ida-binding
esignetWellKnownEndPoint=/v1/esignet/oidc/.well-known/openid-configuration
signupSettingsEndPoint=/v1/signup/settings
esignetActuatorPropertySection=application-default.properties
esignetActuatorPropertySection=classpath:/application-default.properties
# uncomment below property while executing on camdgc env locally
servicesNotDeployed=resident,ridgenerator,admin,hotlist,preregistration,registrationprocessor,hub,print,packetcreator,packetmanager,mock-abis-service,mockmv,sunbirdrc
servicesNotDeployed=sunbirdrc
# uncomment below property while executing on non camdgc env locally
#servicesNotDeployed=
esignetMockBaseURL=esignet-insurance.
Expand All @@ -17,4 +17,4 @@ sunBirdBaseURL=https://registry.dev1.mosip.net

#------------------------- Need to check if these are used or not ------------------------#
OTPTimeOut = 181
attempt = 10
attempt = 10
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ WalletBinding:
"errors": [
{
"errorCode": "IDA-MLC-009",
"errorMessage": "request.individualId: invalid_individual_id"
"errorMessage": "$IGNORE$"
}
],
"sendOtpResp": {
Expand Down Expand Up @@ -2789,4 +2789,4 @@ WalletBinding:
"sendOtpResTemplate":"esignet/SendBindingOtp/SendBindingOtpResult",
"maskedEmail": "$IGNORE$"
}
}'
}'
6 changes: 3 additions & 3 deletions api-test/testNgXmlFiles/esignetSuite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<listeners>
<listener class-name="io.mosip.testrig.apirig.report.EmailableReport"/>
</listeners>

<test name="OIDCClientV2">
<parameter name="ymlFile"
value="esignet/OIDCClientV2/OIDCClientV2.yml" />
Expand Down Expand Up @@ -494,6 +495,5 @@
<classes>
<class name="io.mosip.testrig.apirig.esignet.testscripts.PostWithAutogenIdWithOtpGenerate" />
</classes>
</test> -->

</suite>
</test> -->
</suite>
1 change: 1 addition & 0 deletions deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
esignet-global-cm.yaml
44 changes: 38 additions & 6 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,51 @@
* __Logging__ : Setup logging as per [steps](https://github.com/mosip/k8s-infra/tree/v1.2.0.2/logging).
* __Monitoring__ : Setup monitoring consisting elasticsearch, kibana, grafana using [steps](https://github.com/mosip/k8s-infra/tree/v1.2.0.2/monitoring).
### Install Pre-requisites
```
./install-prereq.sh
```
* `esignet-global` configmap: For eSignet K8's env, `esignet-global` configmap in `esignet` namespace contains Domain related information. Follow below steps to add domain details for `esignet-global` configmap.
* Copy `esignet-global-cm.yaml.sample` to `esignet-global-cm.yaml`.
* Update the domain names in `esignet-global-cm.yaml` correctly for your environment.
* Create a google recaptcha v2 ("I am not a Robot") from Google with required domain name ex:[sandbox.mosip.net] [Recaptcha Admin](https://www.google.com/recaptcha/about/) and set esignet captcha.
* Install pre-requisites
```
./install-prereq.sh
```
### Initialise pre-requisites
* Update values file for postgres init [here](postgres/init_values.yaml).
* Execute `initialise-prereq.sh` script to initialise postgres and keycloak and set esignet captcha.
* Execute `initialise-prereq.sh` script to initialise postgres and keycloak.
```
./initialise-prereq.sh
```
### Install esignet, oidc and captcha service
### Install esignet and oidc
During deployment, the system will prompt for user input to select the appropriate plugin. The available options are listed below:
1. esignet-mock-plugin.jar
2. mosip-identity-plugin.jar

For current scope of deployment, as it is limited to mock functionality,
select option 1 (esignet-mock-plugin.jar).
```
./install-esignet.sh
```
## Onboarder
* If Esignet is getting deployed with MOSIP than we need to execute the onboarder for MISP partner.
* There are two ways to proceed, either with mosip identity plugin or with mock plugin.
### MOSIP Identity Plugin
* If Esignet is getting deployed with MOSIP then we need to execute the onboarder for MISP partner and mock-rp oidc clientId.
* Onboarder [scripts](../partner-onboarder/).

### MOCK Plugin
* Download postman collection from [here](../postman-collection)
* Fetch auth token from esignet keycloak. Update the "client_secret" in the request body.
* Run the request under "OIDC Client Mgmt" -> "Mock" -> "Get Auth token"
* Run the requests under

a. "OIDC Client Mgmt" -> "Mock" -> "Get CSRF token"

b. "OIDC Client Mgmt" -> "Mock" -> "Create OIDC client"

### NOTE:
This deployment is limited to mock
Below section related to configuring IDA is not tested. Still it can be tried out

### CONFIGURE IDA for Esignet :
Onboard eSignet as MISP partner in MOSIP PMS using our onboarder script
We should override properties defined [here](https://github.com/mosip/esignet-plugins/blob/release-1.3.x/mosip-identity-plugin/src/main/resources/application.properties) if there is any change in the MOSIP IDA domain names.
Update the 'MOSIP_ESIGNET_AUTHENTICATOR_IDA_SECRET_KEY' property with MOSIP IDA keycloak client secret.
63 changes: 55 additions & 8 deletions deploy/captcha/install.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
#!/bin/bash
## Installing captcha validation server.
## Combined Script: Installing Captcha Validation Server and Initializing Prerequisites
## Usage: ./install.sh [kubeconfig]

if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

ROOT_DIR=`pwd`
NS=captcha
CHART_VERSION=0.1.0-develop

echo Create $NS namespace
kubectl create ns $NS

function installing_captcha() {
echo Istio label
while true; do
read -p "Do you want to continue installing captcha validation service? (y/n): " ans
if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then
break
elif [ "$ans" = "N" ] || [ "$ans" = "n" ]; then
exit 1
else
echo "Please provide a correct option (Y or N)"
fi
done

echo "Creating $NS namespace"
kubectl create ns $NS || true

echo "Applying Istio label to namespace"
kubectl label ns $NS istio-injection=disabled --overwrite
helm repo update

Expand All @@ -31,11 +42,47 @@ function installing_captcha() {
fi
done

echo Installing captcha
echo "Installing captcha"
helm -n $NS install captcha mosip/captcha --version $CHART_VERSION --set metrics.serviceMonitor.enabled=$servicemonitorflag --wait

echo Installed captcha service
return 0
echo "Installed captcha service"

# Set up Captcha secrets for eSignet
while true; do
read -p "Do you want to continue configuring Captcha secrets for esignet? (y/n): " ans
if [[ "$ans" == "Y" || "$ans" == "y" ]]; then
ESIGNET_HOST=$(kubectl -n esignet get cm esignet-global -o jsonpath={.data.mosip-esignet-host})
echo "Please create captcha site and secret key for esignet domain: $ESIGNET_HOST"

echo "Please enter the reCAPTCHA admin site key for domain $ESIGNET_HOST:"
read ESITE_KEY
echo "Please enter the reCAPTCHA admin secret key for domain $ESIGNET_HOST:"
read ESECRET_KEY

echo "Setting up Captcha secrets"
kubectl -n esignet create secret generic esignet-captcha --from-literal=esignet-captcha-site-key=$ESITE_KEY --from-literal=esignet-captcha-secret-key=$ESECRET_KEY --dry-run=client -o yaml | kubectl apply -f -
echo "Captcha secrets for esignet configured successfully"

../copy_cm_func.sh secret esignet-captcha esignet $NS

# Update or add environment variable
ENV_VAR_EXISTS=$(kubectl -n $NS get deployment captcha -o jsonpath="{.spec.template.spec.containers[0].env[?(@.name=='MOSIP_CAPTCHA_SECRET_ESIGNET')].name}")
if [[ -z "$ENV_VAR_EXISTS" ]]; then
echo "Environment variable 'MOSIP_CAPTCHA_SECRET_ESIGNET' does not exist. Adding it..."
kubectl patch deployment -n $NS captcha --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/env/-", "value": {"name": "MOSIP_CAPTCHA_SECRET_ESIGNET", "valueFrom": {"secretKeyRef": {"name": "esignet-captcha", "key": "esignet-captcha-secret-key"}}}}]'
else
echo "Environment variable 'MOSIP_CAPTCHA_SECRET_ESIGNET' exists. Updating it..."
kubectl patch deployment -n $NS captcha --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/env[?(@.name==\"MOSIP_CAPTCHA_SECRET_ESIGNET\")]", "value": {"name": "MOSIP_CAPTCHA_SECRET_ESIGNET", "valueFrom": {"secretKeyRef": {"name": "esignet-captcha", "key": "esignet-captcha-secret-key"}}}}]'
fi

break
elif [[ "$ans" == "N" || "$ans" == "n" ]]; then
echo "Skipping Captcha secrets configuration."
break
else
echo "Please provide a correct option (Y or N)"
fi
done
}

# set commands for error handling.
Expand Down
15 changes: 8 additions & 7 deletions deploy/config-server/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi

# set commands for error handling.
set -e
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable
set -o errtrace # trace ERR through 'time command' and other functions
set -o pipefail # trace ERR through pipes

NS=esignet
CHART_VERSION=0.0.1-develop

echo Create $NS namespace
kubectl create ns $NS
# set commands for error handling.
set -e
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable
set -o errtrace # trace ERR through 'time command' and other functions
set -o pipefail # trace ERR through pipes
kubectl create ns $NS || true

echo Istio label
kubectl label ns $NS istio-injection=enabled --overwrite
Expand Down
20 changes: 16 additions & 4 deletions deploy/esignet-apitestrig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@

## Introduction
ApiTestRig will test the working of APIs of the MOSIP modules.

## Install
* Create a directory for apitestrig on the NFS server at `/srv/nfs/mosip/<sandbox>/apitestrig/`:
```
mkdir -p /srv/nfs/mosip/<sandbox>/apitestrig/
```
* Ensure the directory has 777 permissions:
```
chmod 777 /srv/nfs/mosip/<sandbox>/apitestrig
```
* Add the following entry to the /etc/exports file:
```
/srv/nfs/mosip/<sandbox>/apitestrig *(ro,sync,no_root_squash,no_all_squash,insecure,subtree_check)
```
* Review `values.yaml` and, Make sure to enable required modules for apitestrig operation.
* Install
```sh
* run `./install.sh`.
```
./install.sh
```

* During the execution of the `install.sh` script, a prompt appears requesting information regarding the presence of a public domain and a valid SSL certificate on the server.
* If the server lacks a public domain and a valid SSL certificate, it is advisable to select the `n` option. Opting it will enable the `init-container` with an `emptyDir` volume and include it in the deployment process.
* The init-container will proceed to download the server's self-signed SSL certificate and mount it to the specified location within the container's Java keystore (i.e., `cacerts`) file.
Expand Down Expand Up @@ -41,4 +53,4 @@ ApiTestRig will test the working of APIs of the MOSIP modules.
example:
```
kubectl --kubeconfig=/home/xxx/Downloads/qa4.config -n apitestrig create job --from=cronjob/cronjob-apitestrig-masterdata cronjob-apitestrig-masterdata
```
```
2 changes: 1 addition & 1 deletion deploy/esignet-apitestrig/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable
set -o errtrace # trace ERR through 'time command' and other functions
set -o pipefail # trace ERR through pipes
deleting_apitestrig # calling function
deleting_apitestrig # calling function
Loading
Loading