diff --git a/.github/ISSUE_TEMPLATE/mosip-bug-report.md b/.github/ISSUE_TEMPLATE/mosip-bug-report.md deleted file mode 100644 index fb1f3182..00000000 --- a/.github/ISSUE_TEMPLATE/mosip-bug-report.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: MOSIP Bug report -about: Create a report to help us improve -title: "[BUG] - $ docker build -f Dockerfile - ``` - -## Deploy -To deploy service on Kubernetes cluster using Dockers refer to [Sandbox Deployment](https://docs.mosip.io/1.2.0/deployment/sandbox-deployment). - -## Test -Automated functional tests available in [Functional Tests repo](https://github.com/mosip/mosip-functional-tests). - -## APIs -API documentation is available [here](https://mosip.github.io/documentation/). - -## License -This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE). diff --git a/db_scripts/README.md b/db_scripts/README.md deleted file mode 100644 index f6bfd1fc..00000000 --- a/db_scripts/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Databases - -## Overview -This folder containers various SQL scripts to create database and tables in postgres. The tables are described under `/ddl/`. Default data that's populated in the tables is present under `/dml` folder - -This folder containers various SQL scripts to create database and tables in postgres. These scripts are automatically run with as part of DB initialisation in [Sandbox Deployment](https://docs.mosip.io/1.2.0/deployment/sandbox-deployment) - -Developers may run the SQLs using `/deploy.sh` script. \ No newline at end of file diff --git a/db_scripts/mosip_audit/db.sql b/db_scripts/mosip_audit/db.sql deleted file mode 100644 index 1a4395e0..00000000 --- a/db_scripts/mosip_audit/db.sql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE DATABASE mosip_audit - ENCODING = 'UTF8' - LC_COLLATE = 'en_US.UTF-8' - LC_CTYPE = 'en_US.UTF-8' - TABLESPACE = pg_default - OWNER = postgres - TEMPLATE = template0; - -COMMENT ON DATABASE mosip_audit IS 'Audit related logs and the data is stored in this database'; - -\c mosip_audit postgres - -DROP SCHEMA IF EXISTS audit CASCADE; -CREATE SCHEMA audit; -ALTER SCHEMA audit OWNER TO postgres; -ALTER DATABASE mosip_audit SET search_path TO audit,pg_catalog,public; - diff --git a/db_scripts/mosip_audit/ddl.sql b/db_scripts/mosip_audit/ddl.sql deleted file mode 100644 index 08134fe0..00000000 --- a/db_scripts/mosip_audit/ddl.sql +++ /dev/null @@ -1,5 +0,0 @@ -\c mosip_audit postgres - -\ir ddl/audit-app_audit_log.sql - - diff --git a/db_scripts/mosip_audit/ddl/audit-app_audit_log.sql b/db_scripts/mosip_audit/ddl/audit-app_audit_log.sql deleted file mode 100644 index 1bb07334..00000000 --- a/db_scripts/mosip_audit/ddl/audit-app_audit_log.sql +++ /dev/null @@ -1,63 +0,0 @@ --- object: audit.app_audit_log | type: TABLE -- --- DROP TABLE IF EXISTS audit.app_audit_log CASCADE; -CREATE TABLE audit.app_audit_log( - log_id character varying(64) NOT NULL, - log_dtimes timestamp NOT NULL, - log_desc character varying(2048), - event_id character varying(64) NOT NULL, - event_type character varying(64) NOT NULL, - event_name character varying(128) NOT NULL, - action_dtimes timestamp NOT NULL, - host_name character varying(128) NOT NULL, - host_ip character varying(256) NOT NULL, - session_user_id character varying(256) NOT NULL, - session_user_name character varying(128), - app_id character varying(64) NOT NULL, - app_name character varying(128) NOT NULL, - module_id character varying(64), - module_name character varying(128), - ref_id character varying(64), - ref_id_type character varying(64), - cr_by character varying(256) NOT NULL, - CONSTRAINT pk_audlog_log_id PRIMARY KEY (log_id) - -); --- ddl-end -- -COMMENT ON TABLE audit.app_audit_log IS 'Application Audit Log : To track application related audit details for analysing, auditing and reporting purposes'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.log_id IS 'Log Id: Unique audit log id for each audit event log entry across the system.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.log_dtimes IS 'Log DateTimestamp: Audit Log Datetimestamp'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.log_desc IS 'Log Description: Detailed description of the audit event'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.event_id IS 'Event Id: Event ID that triggered for which the audit action happend'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.event_type IS 'Event Type: Type of event that triggered the audit log, like, SYSTEM, USER, APPLICATION, BATCH etc.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.event_name IS 'Event Name: Event Name of the Event Id captured'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.action_dtimes IS 'Action DateTimestamp: Timestamp of an application action happend.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.host_name IS 'Host Name: Host Name of the Host ID captured, if any.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.host_ip IS 'Host Ip: Machine or device host Ip address of audit action event that happend/triggered'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.session_user_id IS 'Session user Id: Active User ID of the person who is logged in to the system and performing any action that triggered the audit log.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.session_user_name IS 'Session user Name: User Name of the Session User ID.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.app_id IS 'Application Id: Application Id of audit action happened and logged.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.app_name IS 'Application Name: Application Name'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.module_id IS 'Module Id: Application Module ID that triggered audit trigger log.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.module_name IS 'Module Name: Application Module Name of the Module ID captured.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.ref_id IS 'Reference Id: Reference ID for any cross reference purpose relevant for audit tracking, user id, app id, app or module id, etc.'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.ref_id_type IS 'Reference Id Type: Type of reference id entered'; --- ddl-end -- -COMMENT ON COLUMN audit.app_audit_log.cr_by IS 'Created By : ID or name of the user who create / insert record'; --- ddl-end -- diff --git a/db_scripts/mosip_audit/deploy.properties b/db_scripts/mosip_audit/deploy.properties deleted file mode 100644 index bf369832..00000000 --- a/db_scripts/mosip_audit/deploy.properties +++ /dev/null @@ -1,6 +0,0 @@ -DB_SERVERIP= -DB_PORT= -SU_USER= -DEFAULT_DB_NAME=postgres -MOSIP_DB_NAME=mosip_audit -DML_FLAG=0 diff --git a/db_scripts/mosip_audit/deploy.sh b/db_scripts/mosip_audit/deploy.sh deleted file mode 100644 index 0119ebef..00000000 --- a/db_scripts/mosip_audit/deploy.sh +++ /dev/null @@ -1,45 +0,0 @@ - -## Properties file -set -e -properties_file="$1" -echo `date "+%m/%d/%Y %H:%M:%S"` ": $properties_file" -if [ -f "$properties_file" ] -then - echo `date "+%m/%d/%Y %H:%M:%S"` ": Property file \"$properties_file\" found." - while IFS='=' read -r key value - do - key=$(echo $key | tr '.' '_') - eval ${key}=\${value} - done < "$properties_file" -else - echo `date "+%m/%d/%Y %H:%M:%S"` ": Property file not found, Pass property file name as argument." -fi - -## Terminate existing connections -echo "Terminating active connections" -CONN=$(PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -t -c "SELECT count(pg_terminate_backend(pg_stat_activity.pid)) FROM pg_stat_activity WHERE datname = '$MOSIP_DB_NAME' AND pid <> pg_backend_pid()";exit;) -echo "Terminated connections" - -## Drop db and role -echo "Dropping DB" -PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f drop_db.sql -echo "Dropping user" -PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f drop_role.sql - -## Create DB -echo "Creating DB and tables" -PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f db.sql -PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f ddl.sql - -## Create users -echo `date "+%m/%d/%Y %H:%M:%S"` ": Creating database users" | tee -PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f role_dbuser.sql -v dbuserpwd=\'$DBUSER_PWD\' -PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -f grants.sql - -## Populate tables -if [ ${DML_FLAG} == 1 ] -then - echo `date "+%m/%d/%Y %H:%M:%S"` ": Deploying DML for ${MOSIP_DB_NAME} database" - PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -a -b -f dml.sql -fi - diff --git a/db_scripts/mosip_audit/drop_db.sql b/db_scripts/mosip_audit/drop_db.sql deleted file mode 100644 index 6286a20f..00000000 --- a/db_scripts/mosip_audit/drop_db.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP DATABASE IF EXISTS mosip_audit; - diff --git a/db_scripts/mosip_audit/drop_role.sql b/db_scripts/mosip_audit/drop_role.sql deleted file mode 100644 index 77677a3d..00000000 --- a/db_scripts/mosip_audit/drop_role.sql +++ /dev/null @@ -1 +0,0 @@ -drop role if exists audituser; diff --git a/db_scripts/mosip_audit/grants.sql b/db_scripts/mosip_audit/grants.sql deleted file mode 100644 index 1e328b71..00000000 --- a/db_scripts/mosip_audit/grants.sql +++ /dev/null @@ -1,17 +0,0 @@ -\c mosip_audit - -GRANT CONNECT - ON DATABASE mosip_audit - TO audituser; - -GRANT USAGE - ON SCHEMA audit - TO audituser; - -GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE,REFERENCES - ON ALL TABLES IN SCHEMA audit - TO audituser; - -ALTER DEFAULT PRIVILEGES IN SCHEMA audit - GRANT SELECT,INSERT,UPDATE,DELETE,REFERENCES ON TABLES TO audituser; - diff --git a/db_scripts/mosip_audit/role_dbuser.sql b/db_scripts/mosip_audit/role_dbuser.sql deleted file mode 100644 index 2eb77bea..00000000 --- a/db_scripts/mosip_audit/role_dbuser.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE ROLE audituser WITH - INHERIT - LOGIN - PASSWORD :dbuserpwd; diff --git a/db_upgrade_scripts/mosip_audit/sql/1.1.5.5_to_1.2.0.1-B1_rollback.sql b/db_upgrade_scripts/mosip_audit/sql/1.1.5.5_to_1.2.0.1-B1_rollback.sql deleted file mode 100644 index 233abec2..00000000 --- a/db_upgrade_scripts/mosip_audit/sql/1.1.5.5_to_1.2.0.1-B1_rollback.sql +++ /dev/null @@ -1,8 +0,0 @@ -\c mosip_audit - -REASSIGN OWNED BY postgres TO sysadmin; - -GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA audit TO sysadmin; - ---This only need to execute if no rows added after upgradescripts for host_ip column--------------- -ALTER TABLE audit.app_audit_log ALTER COLUMN host_ip TYPE varchar(50) USING host_ip::varchar; \ No newline at end of file diff --git a/db_upgrade_scripts/mosip_audit/sql/1.1.5.5_to_1.2.0.1-B1_upgrade.sql b/db_upgrade_scripts/mosip_audit/sql/1.1.5.5_to_1.2.0.1-B1_upgrade.sql deleted file mode 100644 index 9c323ada..00000000 --- a/db_upgrade_scripts/mosip_audit/sql/1.1.5.5_to_1.2.0.1-B1_upgrade.sql +++ /dev/null @@ -1,12 +0,0 @@ -\c mosip_audit - -REASSIGN OWNED BY sysadmin TO postgres; - -REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA audit FROM audituser; - -REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA audit FROM sysadmin; - -GRANT SELECT, INSERT, TRUNCATE, REFERENCES, UPDATE, DELETE ON ALL TABLES IN SCHEMA audit TO audituser; - -GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA audit TO postgres; -ALTER TABLE audit.app_audit_log ALTER COLUMN host_ip TYPE varchar(256) USING host_ip::varchar; \ No newline at end of file diff --git a/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B1_to_1.2.0.1-B2_rollback.sql b/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B1_to_1.2.0.1-B2_rollback.sql deleted file mode 100644 index 5548b94e..00000000 --- a/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B1_to_1.2.0.1-B2_rollback.sql +++ /dev/null @@ -1 +0,0 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' diff --git a/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B1_to_1.2.0.1-B2_upgrade.sql b/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B1_to_1.2.0.1-B2_upgrade.sql deleted file mode 100644 index 5548b94e..00000000 --- a/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B1_to_1.2.0.1-B2_upgrade.sql +++ /dev/null @@ -1 +0,0 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' diff --git a/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B2_to_1.2.0.1_rollback.sql b/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B2_to_1.2.0.1_rollback.sql deleted file mode 100644 index 5548b94e..00000000 --- a/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B2_to_1.2.0.1_rollback.sql +++ /dev/null @@ -1 +0,0 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' diff --git a/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B2_to_1.2.0.1_upgrade.sql b/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B2_to_1.2.0.1_upgrade.sql deleted file mode 100644 index 5548b94e..00000000 --- a/db_upgrade_scripts/mosip_audit/sql/1.2.0.1-B2_to_1.2.0.1_upgrade.sql +++ /dev/null @@ -1 +0,0 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' diff --git a/db_upgrade_scripts/mosip_audit/upgrade.properties b/db_upgrade_scripts/mosip_audit/upgrade.properties deleted file mode 100644 index 21aeb9bd..00000000 --- a/db_upgrade_scripts/mosip_audit/upgrade.properties +++ /dev/null @@ -1,12 +0,0 @@ -ACTION=upgrade -MOSIP_DB_NAME=mosip_audit -DB_SERVERIP= -DB_PORT= -SU_USER=postgres -SU_USER_PWD= -SYS_ADMIN_USER= -SYS_ADMIN_PWD= -DEFAULT_DB_NAME=postgres -DBUSER_PWD= -CURRENT_VERSION= -UPGRADE_VERSION= diff --git a/db_upgrade_scripts/mosip_audit/upgrade.sh b/db_upgrade_scripts/mosip_audit/upgrade.sh deleted file mode 100644 index a6fb0b1e..00000000 --- a/db_upgrade_scripts/mosip_audit/upgrade.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -set -e -properties_file="$1" -echo `date "+%m/%d/%Y %H:%M:%S"` ": $properties_file" -if [ -f "$properties_file" ] -then - echo `date "+%m/%d/%Y %H:%M:%S"` ": Property file \"$properties_file\" found." - while IFS='=' read -r key value - do - key=$(echo $key | tr '.' '_') - eval ${key}=\${value} - done < "$properties_file" -else - echo `date "+%m/%d/%Y %H:%M:%S"` ": Property file not found, Pass property file name as argument." -fi - -echo "Current version: "$CURRENT_VERSION -echo "UPGRADE version: "$UPGRADE_VERSION -echo "Action: "$ACTION - -# Terminate existing connections -echo "Terminating active connections" -CONN=$(PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -t -c "SELECT count(pg_terminate_backend(pg_stat_activity.pid)) FROM pg_stat_activity WHERE datname = '$MOSIP_DB_NAME' AND pid <> pg_backend_pid()";exit;) -echo "Terminated connections" - -# Execute upgrade or rollback -if [ $ACTION == "upgrade" ]; then - echo "Upgrading database from $CURRENT_VERSION to $UPGRADE_VERSION" - UPGRADE_SCRIPT_FILE="sql/${CURRENT_VERSION}_to_${UPGRADE_VERSION}_upgrade.sql" - if [ -f "$UPGRADE_SCRIPT_FILE" ]; then - echo "Executing upgrade script $UPGRADE_SCRIPT_FILE" - PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -a -b -f $UPGRADE_SCRIPT_FILE - else - echo "Upgrade script not found, exiting." - exit 1 - fi -elif [ $ACTION == "rollback" ]; then - echo "Rolling back database for $CURRENT_VERSION to $UPGRADE_VERSION" - REVOKE_SCRIPT_FILE="sql/${CURRENT_VERSION}_to_${UPGRADE_VERSION}_rollback.sql" - if [ -f "$REVOKE_SCRIPT_FILE" ]; then - echo "Executing rollback script $REVOKE_SCRIPT_FILE" - PGPASSWORD=$SU_USER_PWD psql -v ON_ERROR_STOP=1 --username=$SU_USER --host=$DB_SERVERIP --port=$DB_PORT --dbname=$DEFAULT_DB_NAME -a -b -f $REVOKE_SCRIPT_FILE - else - echo "rollback script not found, exiting." - exit 1 - fi -else - echo "Unknown action: $ACTION, must be 'upgrade' or 'rollback'." - exit 1 -fi \ No newline at end of file diff --git a/deploy/README.md b/deploy/README.md deleted file mode 100644 index dc0d28b2..00000000 --- a/deploy/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# auditmanager - -## Overview -Refer [Commons](https://docs.mosip.io/1.2.0/modules/commons). - -## Install -``` -./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. -* This particular functionality caters to scenarios where the script needs to be employed on a server utilizing self-signed SSL certificates. diff --git a/deploy/copy_cm.sh b/deploy/copy_cm.sh deleted file mode 100755 index d9e8fe48..00000000 --- a/deploy/copy_cm.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Copy configmaps from other namespaces -# DST_NS: Destination namespace - -function copying_cm() { - UTIL_URL=https://github.com/mosip/mosip-infra/blob/master/deployment/v3/utils/copy_cm_func.sh - COPY_UTIL=./copy_cm_func.sh - DST_NS=kernel - - wget -q $UTIL_URL -O copy_cm_func.sh && chmod +x copy_cm_func.sh - - $COPY_UTIL configmap global default $DST_NS - $COPY_UTIL configmap artifactory-share artifactory $DST_NS - $COPY_UTIL configmap config-server-share config-server $DST_NS - return 0 -} - -# 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 -copying_cm # calling function diff --git a/deploy/delete.sh b/deploy/delete.sh deleted file mode 100755 index 10dbd037..00000000 --- a/deploy/delete.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Uninstalls all auditmanager helm charts -## Usage: ./delete.sh [kubeconfig] - -if [ $# -ge 1 ] ; then - export KUBECONFIG=$1 -fi - - -function deleting_auditmanager() { - NS=kernel - while true; do - read -p "Are you sure you want to delete all auditmanager helm charts?(Y/n) " yn - if [ $yn = "Y" ] - then - helm -n $NS delete auditmanager - break - else - break - fi - done - return 0 -} - -# 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 -deleting_auditmanager # calling function diff --git a/deploy/install.sh b/deploy/install.sh deleted file mode 100755 index 09078316..00000000 --- a/deploy/install.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Installs all auditmanager helm charts -## Usage: ./install.sh [kubeconfig] - -if [ $# -ge 1 ] ; then - export KUBECONFIG=$1 -fi - -NS=kernel -CHART_VERSION=12.0.1-develop - -echo Create $NS namespace -kubectl create ns $NS - -function installing_auditmanager() { - echo Istio label - kubectl label ns $NS istio-injection=enabled --overwrite - helm repo update - - echo Copy configmaps - sed -i 's/\r$//' copy_cm.sh - ./copy_cm.sh - - echo "Do you have public domain & valid SSL? (Y/n) " - echo "Y: if you have public domain & valid ssl certificate" - echo "n: If you don't have a public domain and a valid SSL certificate. Note: It is recommended to use this option only in development environments." - read -p "" flag - - if [ -z "$flag" ]; then - echo "'flag' was provided; EXITING;" - exit 1; - fi - ENABLE_INSECURE='' - if [ "$flag" = "n" ]; then - ENABLE_INSECURE='--set enable_insecure=true'; - fi - - echo Installing auditmanager - helm -n $NS install auditmanager mosip/auditmanager --version $CHART_VERSION $ENABLE_INSECURE - - kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status - - echo Installed auditmanager services - return 0 -} - -# 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 -installing_auditmanager # calling function diff --git a/deploy/restart.sh b/deploy/restart.sh deleted file mode 100755 index 3138bcbe..00000000 --- a/deploy/restart.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Restart the auditmanager services - -if [ $# -ge 1 ] ; then - export KUBECONFIG=$1 -fi - -function Restarting_auditmanager() { - NS=kernel - kubectl -n $NS rollout restart deploy - - kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status - - echo Restarted auditmanager services - return 0 -} - -# 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 -Restarting_auditmanager # calling function diff --git a/helm/auditmanager/.gitignore b/helm/auditmanager/.gitignore deleted file mode 100644 index b3c94bf6..00000000 --- a/helm/auditmanager/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -charts/ -Charts.lock diff --git a/helm/auditmanager/.helmignore b/helm/auditmanager/.helmignore deleted file mode 100644 index f0c13194..00000000 --- a/helm/auditmanager/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/helm/auditmanager/Chart.yaml b/helm/auditmanager/Chart.yaml deleted file mode 100644 index f24aebca..00000000 --- a/helm/auditmanager/Chart.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v2 -name: auditmanager -description: A Helm chart for MOSIP Auditmanager module -type: application -version: 12.0.1-develop -appVersion: "" -dependencies: - - name: common - repository: https://charts.bitnami.com/bitnami - tags: - - bitnami-common - version: 1.x.x -home: https://mosip.io -keywords: - - mosip - - auditmanager - - kernel -maintainers: - - email: info@mosip.io - name: MOSIP diff --git a/helm/auditmanager/README.md b/helm/auditmanager/README.md deleted file mode 100644 index 71fefef1..00000000 --- a/helm/auditmanager/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Auditmanager - -Helm chart for installing Kernel module Auditmanager. - -## TL;DR - -```console -$ helm repo add mosip https://mosip.github.io -$ helm install my-release mosip/auditmanager -``` - -## Introduction - -Auditmanager is part of the kernel modules, but has a separate Helm chart so as to install and manage it in a completely indepedent namespace. - -## Prerequisites - -- Kubernetes 1.12+ -- Helm 3.1.0 -- PV provisioner support in the underlying infrastructure -- ReadWriteMany volumes for deployment scaling - -## Installing the Chart - -To install the chart with the release name `auditmanager`. - -```console -helm install my-release mosip/auditmanager -``` - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```console -helm delete my-release -``` - diff --git a/helm/auditmanager/templates/NOTES.txt b/helm/auditmanager/templates/NOTES.txt deleted file mode 100644 index 8b137891..00000000 --- a/helm/auditmanager/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/helm/auditmanager/templates/_helpers.tpl b/helm/auditmanager/templates/_helpers.tpl deleted file mode 100644 index 903f89b5..00000000 --- a/helm/auditmanager/templates/_helpers.tpl +++ /dev/null @@ -1,60 +0,0 @@ -{{/* -Return the proper image name -*/}} -{{- define "auditmanager.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container volume-permissions image) -*/}} -{{- define "auditmanager.volumePermissions.image" -}} -{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "auditmanager.imagePullSecrets" -}} -{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "auditmanager.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (printf "%s" (include "common.names.fullname" .)) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Compile all warnings into a single message. -*/}} -{{- define "auditmanager.validateValues" -}} -{{- $messages := list -}} -{{- $messages := append $messages (include "auditmanager.validateValues.foo" .) -}} -{{- $messages := append $messages (include "auditmanager.validateValues.bar" .) -}} -{{- $messages := without $messages "" -}} -{{- $message := join "\n" $messages -}} - -{{- if $message -}} -{{- printf "\nVALUES VALIDATION:\n%s" $message -}} -{{- end -}} -{{- end -}} - -{{/* -Return podAnnotations -*/}} -{{- define "auditmanager.podAnnotations" -}} -{{- if .Values.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) }} -{{- end }} -{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) }} -{{- end }} -{{- end -}} - - diff --git a/helm/auditmanager/templates/deployment.yaml b/helm/auditmanager/templates/deployment.yaml deleted file mode 100644 index 12cb524d..00000000 --- a/helm/auditmanager/templates/deployment.yaml +++ /dev/null @@ -1,135 +0,0 @@ -apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - replicas: {{ .Values.replicaCount }} - {{- if .Values.updateStrategy }} - strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} - {{- end }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - template: - metadata: - annotations: - {{- if or .Values.podAnnotations .Values.metrics.enabled }} - {{- include "auditmanager.podAnnotations" . | nindent 8 }} - {{- end }} - - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ template "auditmanager.serviceAccountName" . }} - {{- include "auditmanager.imagePullSecrets" . | nindent 6 }} - {{- if .Values.hostAliases }} - hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.affinity }} - affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} - {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName | quote }} - {{- end }} - {{- if .Values.podSecurityContext.enabled }} - securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - initContainers: - {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} - - name: volume-permissions - image: {{ include "auditmanager.volumePermissions.image" . }} - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} - command: - - %%commands%% - securityContext: - runAsUser: 0 - {{- if .Values.volumePermissions.resources }} - resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: foo - mountPath: bar - {{- end }} - {{- if .Values.initContainers }} - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} - {{- end }} - containers: - - name: auditmanager - image: {{ template "auditmanager.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.lifecycleHooks }} - lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} - {{- end }} - env: - - name: container_user - value: {{ .Values.containerSecurityContext.runAsUser }} - - name: JDK_JAVA_OPTIONS - value: {{ .Values.additionalResources.javaOpts }} - {{- if .Values.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} - {{- end }} - envFrom: - {{- if .Values.extraEnvVarsCM }} - {{- range .Values.extraEnvVarsCM }} - - configMapRef: - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} - {{- end }} - ports: - - name: spring-service - containerPort: {{ .Values.springServicePort }} - - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - {{- if .Values.startupProbe.enabled }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customStartupProbe }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.sidecars }} - {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} diff --git a/helm/auditmanager/templates/extra-list.yaml b/helm/auditmanager/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9e..00000000 --- a/helm/auditmanager/templates/extra-list.yaml +++ /dev/null @@ -1,4 +0,0 @@ -{{- range .Values.extraDeploy }} ---- -{{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} diff --git a/helm/auditmanager/templates/service-account.yaml b/helm/auditmanager/templates/service-account.yaml deleted file mode 100644 index a0ffa7e5..00000000 --- a/helm/auditmanager/templates/service-account.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "auditmanager.serviceAccountName" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} diff --git a/helm/auditmanager/templates/service.yaml b/helm/auditmanager/templates/service.yaml deleted file mode 100644 index 018e6985..00000000 --- a/helm/auditmanager/templates/service.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{ if eq .Values.service.type "LoadBalancer" }} - loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} - {{ end }} - {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - ports: - - port: {{ .Values.service.port }} - protocol: TCP - targetPort: {{ .Values.springServicePort }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/auditmanager/templates/servicemonitor.yaml b/helm/auditmanager/templates/servicemonitor.yaml deleted file mode 100644 index 15f48fde..00000000 --- a/helm/auditmanager/templates/servicemonitor.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ template "common.names.fullname" . }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- else }} - namespace: {{ .Release.Namespace | quote }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }} - {{- end }} -spec: - endpoints: - - targetPort: {{ .Values.springServicePort }} - path: {{ .Values.metrics.endpointPath }} - {{- if .Values.metrics.serviceMonitor.interval }} - interval: {{ .Values.metrics.serviceMonitor.interval }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.honorLabels }} - honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.relabellings }} - metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace | quote }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} -{{- end }} diff --git a/helm/auditmanager/templates/virtualservice.yaml b/helm/auditmanager/templates/virtualservice.yaml deleted file mode 100644 index 37c614d0..00000000 --- a/helm/auditmanager/templates/virtualservice.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.istio.enabled }} -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: {{ template "common.names.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - hosts: - - "*" - gateways: - - {{ .Values.istio.gateway }} - http: - - match: - - uri: - prefix: {{ .Values.istio.prefix }} - route: - - destination: - host: {{ template "common.names.fullname" . }} - port: - number: {{ .Values.service.port }} - headers: - request: - set: - x-forwarded-proto: https -{{- end }} diff --git a/helm/auditmanager/values.yaml b/helm/auditmanager/values.yaml deleted file mode 100644 index 7c3bd637..00000000 --- a/helm/auditmanager/values.yaml +++ /dev/null @@ -1,419 +0,0 @@ -## Global Docker image parameters -## Please, note that this will override the image parameters, including dependencies, configured to use the global value -## Current available global Docker image parameters: imageRegistry and imagePullSecrets -## -# global: -# imageRegistry: myRegistryName -# imagePullSecrets: -# - myRegistryKeySecretName -# storageClass: myStorageClass - -## Add labels to all the deployed resources -## -commonLabels: - app.kubernetes.io/component: mosip - -## Add annotations to all the deployed resources -## -commonAnnotations: {} - -## Kubernetes Cluster Domain -## -clusterDomain: cluster.local - -## Extra objects to deploy (value evaluated as a template) -## -extraDeploy: [] - -## Number of nodes -## -replicaCount: 1 - -service: - type: ClusterIP - port: 80 - ## loadBalancerIP for the SuiteCRM Service (optional, cloud specific) - ## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer - ## - ## loadBalancerIP: - ## - ## nodePorts: - ## http: - ## https: - ## - - nodePorts: - http: "" - https: "" - ## Enable client source IP preservation - ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - ## - externalTrafficPolicy: Cluster - -image: - registry: docker.io - repository: mosipid/kernel-auditmanager-service - tag: 1.2.0.1 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - # pullSecrets: - # - myRegistryKeySecretName - -## Port on which this particular spring service module is running. -springServicePort: 8081 - -## Configure extra options for liveness and readiness probes -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes -## -startupProbe: - enabled: true - httpGet: - path: /v1/auditmanager/actuator/health - port: 8081 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 30 - successThreshold: 1 - -livenessProbe: - enabled: true - httpGet: - path: /v1/auditmanager/actuator/health - port: 8081 - initialDelaySeconds: 20 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -readinessProbe: - enabled: true - httpGet: - path: /v1/auditmanager/actuator/health - port: 8081 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -## -# existingConfigmap: - -## Command and args for running the container (set to default if not set). Use array form -## -command: [] -args: [] - -## Deployment pod host aliases -## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ -## -hostAliases: [] - -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: - cpu: 1000m - memory: 2500Mi - requests: - cpu: 100m - memory: 1500Mi - -additionalResources: - ## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources - ## Example: java_opts: "-Xms500M -Xmx500M" - javaOpts: "-Xms1750M -Xmx1750M" - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container -## Clamav container already runs as 'mosip' user, so we may not need to enable this -containerSecurityContext: - enabled: false - runAsUser: mosip - runAsNonRoot: true - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -## -podSecurityContext: - enabled: false - fsGroup: 1001 - -## Pod affinity preset -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAffinityPreset: "" - -## Pod anti-affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAntiAffinityPreset: soft - -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## Allowed values: soft, hard -## -nodeAffinityPreset: - ## Node affinity type - ## Allowed values: soft, hard - ## - type: "" - ## Node label key to match - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## Node label values to match - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - -## Affinity for pod assignment. Evaluated as a template. -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## -affinity: {} - -## Node labels for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## Tolerations for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] - -## Pod extra labels -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -## -podLabels: {} - -## Annotations for server pods. -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -podAnnotations: {} - -## pods' priority. -## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ -## -# priorityClassName: "" - -## lifecycleHooks for the container to automate configuration before or after startup. -## -lifecycleHooks: {} - -## Custom Liveness probes for -## -customLivenessProbe: {} - -## Custom Rediness probes -## -customReadinessProbe: {} - -## Update strategy - only really applicable for deployments with RWO PVs attached -## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the -## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will -## terminate the single previous pod, so that the new, incoming pod can attach to the PV -## -updateStrategy: - type: RollingUpdate - -## Additional environment variables to set -## Example: -## extraEnvVars: -## - name: FOO -## value: "bar" -## -extraEnvVars: [] - -## ConfigMap with extra environment variables that used -## -extraEnvVarsCM: - - global - - config-server-share - - artifactory-share - -## Secret with extra environment variables -## -extraEnvVarsSecret: - -## Extra volumes to add to the deployment -## -extraVolumes: [] - -## Extra volume mounts to add to the container -## -extraVolumeMounts: [] - -## Add init containers to the pods. -## Example: -## initContainers: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -initContainers: {} - -## Add sidecars to the pods. -## Example: -## sidecars: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -sidecars: {} - -persistence: - enabled: false - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack). - ## - # storageClass: "-" - ## - ## If you want to reuse an existing claim, you can pass the name of the PVC using - ## the existingClaim variable - # existingClaim: your-claim - ## ReadWriteMany not supported by AWS gp2 - storageClass: - accessModes: - - ReadWriteOnce - size: 10M - existingClaim: - # Dir where config and keys are written inside container - mountDir: - -## Init containers parameters: -## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. -## -volumePermissions: - enabled: false - image: - registry: docker.io - repository: bitnami/bitnami-shell - tag: "10" - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - pullSecrets: [] - ## - myRegistryKeySecretName - ## Init containers' resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - ## We usually recommend not to specify default resources and to leave this as a conscious - ## choice for the user. This also increases chances charts run on environments with little - ## resources, such as Minikube. If you do want to specify resources, uncomment the following - ## lines, adjust them as necessary, and remove the curly braces after 'resources:'. - ## - limits: {} - ## cpu: 100m - ## memory: 128Mi - ## - requests: {} - ## cpu: 100m - ## memory: 128Mi - ## - -## Specifies whether RBAC resources should be created -## -rbac: - create: true - -## Specifies whether a ServiceAccount should be created -## -serviceAccount: - create: true - ## The name of the ServiceAccount to use. - ## If not set and create is true, a name is generated using the fullname template - ## - name: - -## Prometheus Metrics -## -metrics: - enabled: true - ## Prometheus pod annotations - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - ## - podAnnotations: - prometheus.io/scrape: "true" - - endpointPath: /v1/auditmanager/actuator/prometheus - - ## Prometheus Service Monitor - ## ref: https://github.com/coreos/prometheus-operator - ## - serviceMonitor: - ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry - ## - enabled: true - ## Specify the namespace in which the serviceMonitor resource will be created - ## - # namespace: "" - ## Specify the interval at which metrics should be scraped - ## - interval: 10s - ## Specify the timeout after which the scrape is ended - ## - # scrapeTimeout: 30s - ## Specify Metric Relabellings to add to the scrape endpoint - ## - # relabellings: - ## Specify honorLabels parameter to add the scrape endpoint - ## - honorLabels: false - ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec - ## - additionalLabels: {} - - ## Custom PrometheusRule to be defined - ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart - ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions - ## - prometheusRule: - enabled: false - additionalLabels: {} - namespace: '' - ## List of rules, used as template by Helm. - ## These are just examples rules inspired from https://awesome-prometheus-alerts.grep.to/rules.html - # rules: - # - alert: RabbitmqDown - # expr: rabbitmq_up{service="{{ template "rabbitmq.fullname" . }}"} == 0 - # for: 5m - # labels: - # severity: error - rules: [] - -## Only internal access -istio: - enabled: true - gateway: istio-system/internal - prefix: /v1/auditmanager diff --git a/kernel/kernel-auditmanager-api/.gitignore b/kernel/kernel-auditmanager-api/.gitignore deleted file mode 100644 index 6b70919d..00000000 --- a/kernel/kernel-auditmanager-api/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -*.class -.mtj.tmp/ -*.jar -*.war -*.ear -hs_err_pid* -target/ -.metadata -.classpath -.project -.settings/ -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.loadpath -.DS_Store \ No newline at end of file diff --git a/kernel/kernel-auditmanager-api/Readme.md b/kernel/kernel-auditmanager-api/Readme.md deleted file mode 100644 index d8072e32..00000000 --- a/kernel/kernel-auditmanager-api/Readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# Kernel Auditmanager Api - -## Overview -This library can be used to audit events and operations. \ No newline at end of file diff --git a/kernel/kernel-auditmanager-api/pom.xml b/kernel/kernel-auditmanager-api/pom.xml deleted file mode 100644 index 57135d5d..00000000 --- a/kernel/kernel-auditmanager-api/pom.xml +++ /dev/null @@ -1,346 +0,0 @@ - - - 4.0.0 - io.mosip.kernel - - kernel-auditmanager-api - 1.2.0.1 - - UTF-8 - - - 11 - 11 - 3.8.0 - - 3.0.2 - 3.1.0 - 3.2.0 - 2.3 - - - 2.0.2.RELEASE - 2.0.7.RELEASE - 5.0.5.RELEASE - 2.0.4.RELEASE - - - 2.0.7 - 1.5.21 - 2.9.2 - - - 3.6.2 - 3.7.0 - - - - 1.2 - 3.0.0 - 1.3 - 2.2 - 2.0.1.Final - 2.2.6 - - - 1.4.197 - 5.1.46 - 42.2.25 - 2.5.0 - 5.2.17.Final - 6.0.12.Final - - - 4.12 - 2.23.4 - 1.7.4 - 2.0.7 - - - 1.2.3 - 1.7.19 - 1.7.7 - 1.7.25 - - - 2.9.5 - 2.9.8 - 2.9.6 - 20180130 - 2.2.10 - 20180813 - 1.1.1 - - - 3.6.1 - 3.7 - 2.6 - 1.11 - 4.3 - 1.9.2 - 2.2 - 4.5.6 - 19.0 - 1.18.8 - 0.1.54 - 1.4.0 - 7.1.0 - 2.0.0 - 5.5.13 - 2.3.23 - 1.7 - 2.0 - 1.5.2 - 2.1.1 - 1.66 - 63.1 - 1.0.0 - 3.3.3 - 3.1.0 - 4.1.0-incubating - 1.11.368 - 0.2.4 - 2.3.0 - 3.0.1 - 1.9.12 - 0.6.0 - 2.0.0.AM2 - 1.8.12 - 1.4.2 - 1.4.2 - 1.2.0.1 - 1.2.0.1 - 0.8.5 - **/dto/**,**/constant/**,**/config/**,**/httpfilter/**,**/cache/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/request/**,**/spi/**,"**/proxy/**","**/AuditManagerBootApplication.java -" - **/dto/**,**/entity/**,**/config/** - - - - io.mosip.kernel - kernel-core - ${kernel.core.version} - - - org.springframework.boot - spring-boot-starter-data-jpa - ${spring.boot.version} - - - com.h2database - h2 - - - - - org.springframework.boot - spring-boot-starter-validation - ${spring.boot.version} - - - com.h2database - h2 - - - - - com.h2database - h2 - ${h2.version} - runtime - - - org.postgresql - postgresql - ${postgresql.version} - - - org.modelmapper - modelmapper - ${modelmapper.version} - - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - maven-deploy-plugin - 2.8.1 - - - default-deploy - deploy - - deploy - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - - default-deploy - deploy - - deploy - - - - - ossrh - https://oss.sonatype.org/ - false - - - - - org.apache.maven.plugins - maven-source-plugin - true - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.2.0 - - - attach-javadocs - - jar - - - - - none - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - pl.project13.maven - git-commit-id-plugin - 3.0.1 - - - get-the-git-infos - - revision - - validate - - - - true - ${project.build.outputDirectory}/git.properties - - ^git.build.(time|version)$ - ^git.commit.id.(abbrev|full)$ - - full - ${project.basedir}/.git - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.0 - - false - false - - ${argLine} --add-opens - java.xml/jdk.xml.internal=ALL-UNNAMED - --illegal-access=permit - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.maven.plugin.version} - - - - prepare-agent - - - - report - prepare-package - - report - - - - - - - - scm:git:git://github.com/mosip/commons.git - scm:git:ssh://github.com:mosip/commons.git - https://github.com/mosip/commons - HEAD - - - - MPL 2.0 - https://www.mozilla.org/en-US/MPL/2.0/ - - - - - Mosip - mosip.emailnotifier@gmail.com - io.mosip - https://github.com/mosip/commons - - - Audit manager api - Audit manager api for Mosip - https://github.com/mosip/commons - diff --git a/kernel/kernel-auditmanager-api/src/main/java/META-INF/MANIFEST.MF b/kernel/kernel-auditmanager-api/src/main/java/META-INF/MANIFEST.MF deleted file mode 100644 index 254272e1..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/builder/AuditRequestBuilder.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/builder/AuditRequestBuilder.java deleted file mode 100644 index e70d9290..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/builder/AuditRequestBuilder.java +++ /dev/null @@ -1,232 +0,0 @@ -package io.mosip.kernel.auditmanager.builder; - -import java.time.LocalDateTime; - -import org.springframework.stereotype.Service; - -import io.mosip.kernel.auditmanager.request.AuditRequestDto; - -/** - * The Audit request builder class is used to create new {@link AuditRequestDto} - * with all required fields - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@Service -public class AuditRequestBuilder { - - /** - * The {@link AuditRequestDto} instance - */ - private AuditRequestDto auditRequest = null; - - /** - * Instantiate a new {@link AuditRequestDto} - */ - public AuditRequestBuilder() { - auditRequest = new AuditRequestDto(); - } - - /** - * Add actionTimeStamp to this {@link AuditRequestBuilder} - * - * @param actionTimeStamp actionTimeStamp - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setActionTimeStamp(LocalDateTime actionTimeStamp) { - auditRequest.setActionTimeStamp(actionTimeStamp); - return this; - } - - /** - * Add applicationId to this {@link AuditRequestBuilder} - * - * @param applicationId applicationId - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setApplicationId(String applicationId) { - auditRequest.setApplicationId(applicationId); - return this; - } - - /** - * Add applicationName to this {@link AuditRequestBuilder} - * - * @param applicationName applicationName - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setApplicationName(String applicationName) { - auditRequest.setApplicationName(applicationName); - return this; - } - - /** - * Add createdBy to this {@link AuditRequestBuilder} - * - * @param createdBy createdBy - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setCreatedBy(String createdBy) { - auditRequest.setCreatedBy(createdBy); - return this; - } - - /** - * Add description to this {@link AuditRequestBuilder} - * - * @param description description - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setDescription(String description) { - auditRequest.setDescription(description); - return this; - } - - /** - * Add eventId to this {@link AuditRequestBuilder} - * - * @param eventId eventId - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setEventId(String eventId) { - auditRequest.setEventId(eventId); - return this; - } - - /** - * Add eventName to this {@link AuditRequestBuilder} - * - * @param eventName eventName - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setEventName(String eventName) { - auditRequest.setEventName(eventName); - return this; - } - - /** - * Add eventType to this {@link AuditRequestBuilder} - * - * @param eventType eventType - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setEventType(String eventType) { - auditRequest.setEventType(eventType); - return this; - } - - /** - * Add hostIp to this {@link AuditRequestBuilder} - * - * @param hostIp hostIp - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setHostIp(String hostIp) { - auditRequest.setHostIp(hostIp); - return this; - } - - /** - * Add hostName to this {@link AuditRequestBuilder} - * - * @param hostName hostName - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setHostName(String hostName) { - auditRequest.setHostName(hostName); - return this; - } - - /** - * Add id to this {@link AuditRequestBuilder} - * - * @param id id - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setId(String id) { - auditRequest.setId(id); - return this; - } - - /** - * Add idType to this {@link AuditRequestBuilder} - * - * @param idType idType - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setIdType(String idType) { - auditRequest.setIdType(idType); - return this; - } - - /** - * Add moduleId to this {@link AuditRequestBuilder} - * - * @param moduleId moduleId - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setModuleId(String moduleId) { - auditRequest.setModuleId(moduleId); - return this; - } - - /** - * Add moduleName to this {@link AuditRequestBuilder} - * - * @param moduleName moduleName - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setModuleName(String moduleName) { - auditRequest.setModuleName(moduleName); - return this; - } - - /** - * Add sessionUserId to this {@link AuditRequestBuilder} - * - * @param sessionUserId sessionUserId - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setSessionUserId(String sessionUserId) { - auditRequest.setSessionUserId(sessionUserId); - return this; - } - - /** - * Add sessionUserName to this {@link AuditRequestBuilder} - * - * @param sessionUserName sessionUserName - * - * @return {@link AuditRequestBuilder} - */ - public AuditRequestBuilder setSessionUserName(String sessionUserName) { - auditRequest.setSessionUserName(sessionUserName); - return this; - } - - /** - * Builds {@link AuditRequestDto} from {@link AuditRequestBuilder} - * - * @return The {@link AuditRequestDto} - */ - public AuditRequestDto build() { - return auditRequest; - } -} diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/config/AuditConfig.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/config/AuditConfig.java deleted file mode 100644 index 4de7a30b..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/config/AuditConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.mosip.kernel.auditmanager.config; - -import org.modelmapper.ModelMapper; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; - -/** - * The configuration class for Audit having package location to scan - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@Configuration -@EntityScan("io.mosip.kernel.auditmanager.entity") -@ComponentScan("io.mosip.kernel.auditmanager") -public class AuditConfig { - - /** - * Creates a new Modelmapper bean - * - * @return The {@link ModelMapper} - */ - @Bean - public ModelMapper modelMapper() { - return new ModelMapper(); - } - -} diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/constant/AuditErrorCodes.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/constant/AuditErrorCodes.java deleted file mode 100644 index b346b091..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/constant/AuditErrorCodes.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.mosip.kernel.auditmanager.constant; - -/** - * Constants for Audit Manager - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -public enum AuditErrorCodes { - HANDLEREXCEPTION("KER-AUD-001", "Invalid Audit Request. Required parameters must be present"), - - INVALIDFORMAT("KER-AUD-002", "Invalid Audit Request. Format is incorrect. (For timestamp, use UTC format)"); - - private final String errorCode; - private final String errorMessage; - - private AuditErrorCodes(final String errorCode, final String errorMessage) { - this.errorCode = errorCode; - this.errorMessage = errorMessage; - } - - public String getErrorCode() { - return errorCode; - } - - public String getErrorMessage() { - return errorMessage; - } - -} diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/entity/Audit.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/entity/Audit.java deleted file mode 100644 index c5b7209b..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/entity/Audit.java +++ /dev/null @@ -1,103 +0,0 @@ -package io.mosip.kernel.auditmanager.entity; - -import java.time.LocalDateTime; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Table; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -/** - * The Audit Entity class with required fields to be captured and recorded - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@Entity -@Table(name = "app_audit_log", schema = "audit") -@Data -@EqualsAndHashCode(callSuper = true) -@NoArgsConstructor -@AllArgsConstructor -public class Audit extends BaseAudit { - - @NotNull - @Size(min = 1, max = 64) - @Column(name = "event_id", nullable = false, updatable = false, length = 64) - private String eventId; - - @NotNull - @Size(min = 1, max = 128) - @Column(name = "event_name", nullable = false, updatable = false, length = 128) - private String eventName; - - @NotNull - @Size(min = 1, max = 64) - @Column(name = "event_type", nullable = false, updatable = false, length = 64) - private String eventType; - - @NotNull - @Column(name = "action_dtimes", nullable = false, updatable = false) - private LocalDateTime actionTimeStamp; - - @NotNull - @Size(min = 1, max = 128) - @Column(name = "host_name", nullable = false, updatable = false, length = 128) - private String hostName; - - @NotNull - @Size(min = 1, max = 256) - @Column(name = "host_ip", nullable = false, updatable = false, length = 256) - private String hostIp; - - @NotNull - @Size(min = 1, max = 64) - @Column(name = "app_id", nullable = false, updatable = false, length = 64) - private String applicationId; - - @NotNull - @Size(min = 1, max = 128) - @Column(name = "app_name", nullable = false, updatable = false, length = 128) - private String applicationName; - - @NotNull - @Size(min = 1, max = 256) - @Column(name = "session_user_id", nullable = false, updatable = false, length = 256) - private String sessionUserId; - - @Size(max = 128) - @Column(name = "session_user_name", updatable = false, length = 128) - private String sessionUserName; - - @Size( max = 64) - @Column(name = "ref_id", nullable = true, updatable = false, length = 64) - private String id; - - @Size(max = 64) - @Column(name = "ref_id_type", nullable = true, updatable = false, length = 64) - private String idType; - - @NotNull - @Size(min = 1, max = 256) - @Column(name = "cr_by", nullable = false, updatable = false, length = 256) - private String createdBy; - - @Size(max = 128) - @Column(name = "module_name", updatable = false, length = 128) - private String moduleName; - - @Size(max = 64) - @Column(name = "module_id", updatable = false, length = 64) - private String moduleId; - - @Size(max = 2048) - @Column(name = "log_desc", updatable = false, length = 2048) - private String description; -} diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/entity/BaseAudit.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/entity/BaseAudit.java deleted file mode 100644 index 81a223e1..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/entity/BaseAudit.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.mosip.kernel.auditmanager.entity; - -import java.time.LocalDateTime; -import java.util.UUID; - -import javax.persistence.Column; -import javax.persistence.Id; -import javax.persistence.MappedSuperclass; - -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * Base class for {@link Audit} with {@link #uuid} and {@link #createdAt} - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@MappedSuperclass -@Data -@AllArgsConstructor -public class BaseAudit { - - /** - * Field for immutable universally unique identifier (UUID) - */ - @Id - @Column(name = "log_id", nullable = false, updatable = false) - private String uuid; - - @Column(name = "log_dtimes", nullable = false, updatable = false) - private LocalDateTime createdAt; - - /** - * Constructor to initialize {@link BaseAudit} with uuid and timestamp - */ - public BaseAudit() { - uuid = UUID.randomUUID().toString(); - createdAt = LocalDateTime.now(); - } - -} diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/impl/AuditHandlerImpl.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/impl/AuditHandlerImpl.java deleted file mode 100644 index ef2a313f..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/impl/AuditHandlerImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package io.mosip.kernel.auditmanager.impl; - -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import io.mosip.kernel.auditmanager.entity.Audit; -import io.mosip.kernel.auditmanager.repository.AuditRepository; -import io.mosip.kernel.auditmanager.request.AuditRequestDto; -import io.mosip.kernel.auditmanager.util.AuditUtils; -import io.mosip.kernel.core.auditmanager.spi.AuditHandler; - -/** - * Implementation of {@link AuditHandler} with function to write - * {@link AuditRequestDto} - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@Service -public class AuditHandlerImpl implements AuditHandler { - - /** - * Field for {@link AuditRepository} having data access operations related to - * audit - */ - @Autowired - private AuditRepository auditRepository; - - /** - * Field for {@link ModelMapper} for performing object mapping - */ - @Autowired - private ModelMapper modelMapper; - - /* - * (non-Javadoc) - * - * @see - * io.mosip.kernel.core.audit.handler.AuditHandler#writeAudit(io.mosip.kernel. - * core.audit.dto.AuditRequest) - */ - @Override - public boolean addAudit(AuditRequestDto auditRequest) { - - AuditUtils.validateAuditRequest(auditRequest); - - Audit event = modelMapper.map(auditRequest, Audit.class); - auditRepository.save(event); - return true; - } - -} diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/repository/AuditRepository.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/repository/AuditRepository.java deleted file mode 100644 index 0196bb16..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/repository/AuditRepository.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - */ -package io.mosip.kernel.auditmanager.repository; - -import org.springframework.data.jpa.repository.JpaRepository; - -import io.mosip.kernel.auditmanager.entity.Audit; - -/** - * Repository interface with data access and data modification functions on - * {@link Audit} - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -public interface AuditRepository extends JpaRepository { - -} diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/request/AuditRequestDto.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/request/AuditRequestDto.java deleted file mode 100644 index a68560eb..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/request/AuditRequestDto.java +++ /dev/null @@ -1,86 +0,0 @@ -package io.mosip.kernel.auditmanager.request; - -import java.time.LocalDateTime; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import com.fasterxml.jackson.annotation.JsonFormat; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * The Audit Request class with required fields to be captured and recorded - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class AuditRequestDto { - - @NotNull - @Size(min = 1, max = 64) - private String eventId; - - @NotNull - @Size(min = 1, max = 128) - private String eventName; - - @NotNull - @Size(min = 1, max = 64) - private String eventType; - - @NotNull - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") - private LocalDateTime actionTimeStamp; - - @NotNull - @Size(min = 1, max = 128) - private String hostName; - - @NotNull - @Size(min = 1, max = 256) - private String hostIp; - - @NotNull - @Size(min = 1, max = 64) - private String applicationId; - - @NotNull - @Size(min = 1, max = 128) - private String applicationName; - - @NotNull - @Size(min = 1, max = 256) - private String sessionUserId; - - @Size(min = 1, max = 128) - private String sessionUserName; - - - @Size(max = 64) - private String id; - - - @Size(max = 64) - private String idType; - - @NotNull - @Size(min = 1, max = 256) - private String createdBy; - - @Size(max = 128) - private String moduleName; - - @Size(max = 64) - private String moduleId; - - @Size(max = 2048) - private String description; - -} diff --git a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/util/AuditUtils.java b/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/util/AuditUtils.java deleted file mode 100644 index 5cf83348..00000000 --- a/kernel/kernel-auditmanager-api/src/main/java/io/mosip/kernel/auditmanager/util/AuditUtils.java +++ /dev/null @@ -1,53 +0,0 @@ -package io.mosip.kernel.auditmanager.util; - -import java.util.Set; - -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; - -import io.mosip.kernel.auditmanager.constant.AuditErrorCodes; -import io.mosip.kernel.auditmanager.request.AuditRequestDto; -import io.mosip.kernel.core.auditmanager.exception.AuditManagerException; - -/** - * Utility class for Audit Manager - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ - -public class AuditUtils { - - private static Validator validator = null; - - static { - ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - validator = factory.getValidator(); - } - - /** - * Private constructor for AuditUtils - */ - private AuditUtils() { - - } - - /** - * Function to validate {@link AuditRequestDto} - * - * @param auditRequest The audit request - */ - public static void validateAuditRequest(AuditRequestDto auditRequest) { - - Set> violations = validator.validate(auditRequest); - - if (!violations.isEmpty()) { - throw new AuditManagerException(AuditErrorCodes.HANDLEREXCEPTION.getErrorCode(), - AuditErrorCodes.HANDLEREXCEPTION.getErrorMessage()); - } - - } -} \ No newline at end of file diff --git a/kernel/kernel-auditmanager-api/src/main/resources/META-INF/spring.factories b/kernel/kernel-auditmanager-api/src/main/resources/META-INF/spring.factories deleted file mode 100644 index e3a2f47e..00000000 --- a/kernel/kernel-auditmanager-api/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -io.mosip.kernel.auditmanager.config.AuditConfig \ No newline at end of file diff --git a/kernel/kernel-auditmanager-api/src/test/java/io/mosip/kernal/auditmanager/test/AuditEventTest.java b/kernel/kernel-auditmanager-api/src/test/java/io/mosip/kernal/auditmanager/test/AuditEventTest.java deleted file mode 100644 index 2317af7d..00000000 --- a/kernel/kernel-auditmanager-api/src/test/java/io/mosip/kernal/auditmanager/test/AuditEventTest.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.mosip.kernal.auditmanager.test; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.time.LocalDateTime; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentMatchers; -import org.mockito.Mockito; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.test.context.junit4.SpringRunner; - -import io.mosip.kernel.auditmanager.builder.AuditRequestBuilder; -import io.mosip.kernel.auditmanager.config.AuditConfig; -import io.mosip.kernel.auditmanager.entity.Audit; -import io.mosip.kernel.auditmanager.impl.AuditHandlerImpl; -import io.mosip.kernel.auditmanager.repository.AuditRepository; -import io.mosip.kernel.auditmanager.request.AuditRequestDto; -import io.mosip.kernel.core.auditmanager.exception.AuditManagerException; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = AuditConfig.class) -public class AuditEventTest { - - @Autowired - private AuditHandlerImpl auditHandlerImpl; - - @MockBean - private AuditRepository auditRepository; - - @Test - public void auditBuilderTest() { - - Mockito.when(auditRepository.save(ArgumentMatchers.any(Audit.class))).thenReturn(new Audit()); - - AuditRequestBuilder auditRequestBuilder = new AuditRequestBuilder(); - - auditRequestBuilder.setActionTimeStamp(LocalDateTime.now()).setApplicationId("applicationId") - .setApplicationName("applicationName").setCreatedBy("createdBy").setDescription("description") - .setEventId("eventId").setEventName("eventName").setEventType("eventType").setHostIp("hostIp") - .setHostName("hostName").setId("id").setIdType("idType").setModuleId("moduleId") - .setModuleName("moduleName").setSessionUserId("sessionUserId").setSessionUserName("sessionUserName"); - - AuditRequestDto auditRequest = auditRequestBuilder.build(); - auditHandlerImpl.addAudit(auditRequest); - - assertThat(auditHandlerImpl.addAudit(auditRequestBuilder.build()), is(true)); - } - - @Test(expected = AuditManagerException.class) - public void auditBuilderExceptionTest() { - - Mockito.when(auditRepository.save(ArgumentMatchers.any(Audit.class))).thenReturn(new Audit()); - - AuditRequestBuilder auditRequestBuilder = new AuditRequestBuilder(); - - auditRequestBuilder.setApplicationId("applicationId").setApplicationName("applicationName") - .setCreatedBy("createdBy").setDescription("description").setEventId("eventId").setEventName("eventName") - .setEventType("eventType").setHostIp("hostIp").setHostName("hostName").setId("id").setIdType("idType") - .setModuleId("moduleId").setModuleName("moduleName").setSessionUserId("sessionUserId") - .setSessionUserName("sessionUserName"); - - AuditRequestDto auditRequest = auditRequestBuilder.build(); - auditHandlerImpl.addAudit(auditRequest); - - } - -} \ No newline at end of file diff --git a/kernel/kernel-auditmanager-api/src/test/resources/application.properties b/kernel/kernel-auditmanager-api/src/test/resources/application.properties deleted file mode 100644 index d3f582da..00000000 --- a/kernel/kernel-auditmanager-api/src/test/resources/application.properties +++ /dev/null @@ -1,22 +0,0 @@ -# In Memory DB For Test : -#-------------------------------------- -#The Driver name for test DB. -spring.datasource.driver-class-name=org.h2.Driver -#The URL for test DB. -spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1 -#The username for test DB. -spring.datasource.username=sa -#The password for test DB. -spring.datasource.password=sa - -# Hibernate Properties : -#------------------------------------- -#It makes Hibernate to generate the appropriate SQL statements for the chosen database. -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect -#It automatically validates or exports schema DDL to the database when the SessionFactory is created. -spring.jpa.hibernate.ddl-auto=create - -## To disable the logging (spring boot) -logging.level.org.springframework=OFF -logging.level.root=OFF -spring.main.banner-mode=off diff --git a/kernel/kernel-auditmanager-api/src/test/resources/logback.xml b/kernel/kernel-auditmanager-api/src/test/resources/logback.xml deleted file mode 100644 index 7285a15d..00000000 --- a/kernel/kernel-auditmanager-api/src/test/resources/logback.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - %d [%t] %p [%C{1}].%M.%L : %m%n - - - - - - \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/.gitignore b/kernel/kernel-auditmanager-service/.gitignore deleted file mode 100644 index ff6f4831..00000000 --- a/kernel/kernel-auditmanager-service/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -*.class -.mtj.tmp/ -*.jar -*.war -*.ear -hs_err_pid* -target/ -.metadata -.classpath -.project -.settings/ -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.loadpath -.DS_Store -logs/* \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/Dockerfile b/kernel/kernel-auditmanager-service/Dockerfile index e8102636..b732d076 100644 --- a/kernel/kernel-auditmanager-service/Dockerfile +++ b/kernel/kernel-auditmanager-service/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11 +FROM eclipse-temurin:11-jre-jammy ARG SOURCE ARG COMMIT_HASH diff --git a/kernel/kernel-auditmanager-service/README.md b/kernel/kernel-auditmanager-service/README.md deleted file mode 100644 index 6ee5c812..00000000 --- a/kernel/kernel-auditmanager-service/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Kernel Auditmanager Service - -## Overview -This service is used to persist audits. - -## Default context-path and port -Refer [`bootstrap.properties`](src/main/resources/bootstrap.properties) \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/pom.xml b/kernel/kernel-auditmanager-service/pom.xml deleted file mode 100644 index 4dfb41a0..00000000 --- a/kernel/kernel-auditmanager-service/pom.xml +++ /dev/null @@ -1,564 +0,0 @@ - - 4.0.0 - io.mosip.kernel - - kernel-auditmanager-service - 1.2.0.1 - - UTF-8 - - - 11 - 11 - 3.8.0 - - 3.0.2 - 3.1.0 - 3.2.0 - 2.3 - - - 2.0.2.RELEASE - 2.0.7.RELEASE - 5.0.5.RELEASE - 2.0.4.RELEASE - - - 2.0.7 - 1.5.21 - 2.9.2 - - - 3.6.2 - 3.7.0 - - - - 1.2 - 3.0.0 - 1.3 - 2.2 - 2.0.1.Final - 2.2.6 - - - 1.4.197 - 5.1.46 - 42.2.25 - 2.5.0 - 5.2.17.Final - 6.0.12.Final - - - 4.12 - 2.23.4 - 1.7.4 - 2.0.7 - - - 1.2.3 - 1.7.19 - 1.7.7 - 1.7.25 - - - 2.9.5 - 2.9.8 - 2.9.6 - 20180130 - 2.2.10 - 20180813 - 1.1.1 - - - 3.6.1 - 3.7 - 2.6 - 1.11 - 4.3 - 1.9.2 - 2.2 - 4.5.6 - 19.0 - 1.18.8 - 0.1.54 - 1.4.0 - 7.1.0 - 2.0.0 - 5.5.13 - 2.3.23 - 1.7 - 2.0 - 1.5.2 - 2.1.1 - 1.66 - 63.1 - 1.0.0 - 3.3.3 - 3.1.0 - 4.1.0-incubating - 1.11.368 - 0.2.4 - 2.3.0 - 3.0.1 - 1.9.12 - 0.6.0 - 2.0.0.AM2 - 1.8.12 - 1.4.2 - 1.4.2 - UTF-8 - - - 11 - 11 - 3.8.0 - - 3.0.2 - 3.1.0 - 3.2.0 - 2.3 - - - 2.0.2.RELEASE - 2.0.7.RELEASE - 5.0.5.RELEASE - 2.0.4.RELEASE - - - 2.0.7 - 1.5.21 - 2.9.2 - - - 3.6.2 - 3.7.0 - - - - 1.2 - 3.0.0 - 1.3 - 2.2 - 2.0.1.Final - 2.2.6 - - - 1.4.197 - 5.1.46 - 42.2.25 - 2.5.0 - 5.2.17.Final - 6.0.12.Final - - - 4.12 - 2.23.4 - 1.7.4 - 2.0.7 - - - 1.2.3 - 1.7.19 - 1.7.7 - 1.7.25 - - - 2.9.5 - 2.9.8 - 2.9.6 - 20180130 - 2.2.10 - 20180813 - 1.1.1 - - - 3.6.1 - 3.7 - 2.6 - 1.11 - 4.3 - 1.9.2 - 2.2 - 4.5.6 - 19.0 - 1.18.8 - 0.1.54 - 1.4.0 - 7.1.0 - 2.0.0 - 5.5.13 - 2.3.23 - 1.7 - 2.0 - 1.5.2 - 2.1.1 - 1.66 - 63.1 - 1.0.0 - 3.3.3 - 3.1.0 - 4.1.0-incubating - 1.11.368 - 0.2.4 - 2.3.0 - 3.0.1 - 1.9.12 - 0.6.0 - 2.0.0.AM2 - 1.8.12 - 1.4.2 - 1.4.2 - 1.5.10 - 1.2.0.1 - 1.2.0.1 - 1.2.0.1 - 1.2.0.1 - 1.2.0.1 - 1.2.0.1 - 0.8.5 - **/dto/**,**/constant/**,**/config/**,**/httpfilter/**,**/cache/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/request/**,**/spi/**,"**/proxy/**","**/AuditManagerBootApplication.java" - **/dto/**,**/entity/**,**/config/** - 2.12.0 - - - - io.mosip.kernel - kernel-core - ${kernel.core.version} - - - org.postgresql - postgresql - ${postgresql.version} - - - io.mosip.kernel - kernel-auditmanager-api - ${kernel.audit-api.version} - - - io.mosip.kernel - kernel-logger-logback - ${kernel.logger.version} - - - org.springframework.boot - spring-boot-starter-security - ${spring.boot.version} - - - org.springframework.security - spring-security-test - ${spring.security.test.version} - - - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - com.googlecode.json-simple - json-simple - 1.1.1 - - - junit - junit - - - - - org.springdoc - springdoc-openapi-ui - ${springdoc.version} - - - org.springframework.boot - spring-boot-configuration-processor - true - ${spring.boot.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${fasterxml.jackson.module.jsr310.version} - - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - true - ZIP - - - - - build-info - repackage - - - - - - maven-deploy-plugin - 2.8.1 - - - default-deploy - deploy - - deploy - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - - default-deploy - deploy - - deploy - - - - - ossrh - https://oss.sonatype.org/ - false - - - - - org.apache.maven.plugins - maven-source-plugin - true - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.2.0 - - - attach-javadocs - - jar - - - - - none - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - pl.project13.maven - git-commit-id-plugin - 3.0.1 - - - get-the-git-infos - - revision - - validate - - - - true - ${project.build.outputDirectory}/git.properties - - ^git.build.(time|version)$ - ^git.commit.id.(abbrev|full)$ - - full - ${project.basedir}/.git - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.0 - - false - false - - ${argLine} --add-opens - java.xml/jdk.xml.internal=ALL-UNNAMED - --illegal-access=permit - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.maven.plugin.version} - - - - prepare-agent - - - - report - prepare-package - - report - - - - - - - - scm:git:git://github.com/mosip/commons.git - scm:git:ssh://github.com:mosip/commons.git - https://github.com/mosip/commons - HEAD - - - - MPL 2.0 - https://www.mozilla.org/en-US/MPL/2.0/ - - - - - Mosip - mosip.emailnotifier@gmail.com - io.mosip - https://github.com/mosip/commons - - - Auditmanager service - Independant Audit manager service - https://github.com/mosip/commons - - - openapi-doc-generate-profile - - - io.mosip.kernel - kernel-auth-adapter - 1.2.0.1 - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - true - ZIP - - - - pre-integration-test - - start - - - - src/test/resources - - - openapi-profile - - - --server.port=8090 - --server.servlet.path=/app/generic - - - - - - post-integration-test - - stop - - - - - build-info - repackage - - - - - - org.springdoc - springdoc-openapi-maven-plugin - 0.2 - - - integration-test - - generate - - - - - http://localhost:8090/app/generic/v3/api-docs - ${artifactId}-openapi.json - ${project.build.directory} - false - - - - - - - diff --git a/kernel/kernel-auditmanager-service/src/main/java/META-INF/MANIFEST.MF b/kernel/kernel-auditmanager-service/src/main/java/META-INF/MANIFEST.MF deleted file mode 100644 index 254272e1..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/AuditManagerBootApplication.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/AuditManagerBootApplication.java deleted file mode 100644 index e771319e..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/AuditManagerBootApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -package io.mosip.kernel.auditmanager; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Audit manager application - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@SpringBootApplication(scanBasePackages = { "io.mosip.kernel.auditmanager.*","${mosip.auth.adapter.impl.basepackage}" - ,"io.mosip.kernel.core.logger.config"}) -public class AuditManagerBootApplication { - - /** - * Main method to run spring boot application - * - * @param args args - */ - public static void main(String[] args) { - SpringApplication.run(AuditManagerBootApplication.class, args); - } -} diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/LoggerConfiguration.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/LoggerConfiguration.java deleted file mode 100644 index 6e69408b..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/LoggerConfiguration.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.mosip.kernel.auditmanager.config; - -import io.mosip.kernel.core.logger.spi.Logger; -import io.mosip.kernel.logger.logback.factory.Logfactory; - -/** - * Console Logger Configuration. - * - * @author Bal Vikash Sharma - * @since 1.0.0 - * - */ -public class LoggerConfiguration { - /** - * Private Constructor to prevent instantiation. - */ - private LoggerConfiguration() { - } - - /** - * This method sets the logger target, and returns appender. - * - * @param clazz the class. - * @return the appender. - */ - public static Logger logConfig(Class clazz) { - return Logfactory.getSlf4jLogger(clazz); - } -} diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/OpenApiProperties.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/OpenApiProperties.java deleted file mode 100644 index b246533d..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/OpenApiProperties.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.mosip.kernel.auditmanager.config; -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -import java.util.List; - -@Configuration -@ConfigurationProperties(prefix = "openapi") -@Data -public class OpenApiProperties { - private InfoProperty info; - private Service service; -} - -@Data -class InfoProperty { - private String title; - private String description; - private String version; - private LicenseProperty license; -} - -@Data -class LicenseProperty { - private String name; - private String url; -} - -@Data -class Service { - private List servers; -} - -@Data -class Server { - private String description; - private String url; -} diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/SwaggerConfig.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/SwaggerConfig.java deleted file mode 100644 index 87203609..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/config/SwaggerConfig.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.mosip.kernel.auditmanager.config; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.servers.Server; - -@Configuration -public class SwaggerConfig { - - - @Bean - public OpenAPI openApi(@Autowired OpenApiProperties openApiProperties) { - OpenAPI api = new OpenAPI().components(new Components()) - .info(new Info().title(openApiProperties.getInfo().getTitle()) - .version(openApiProperties.getInfo().getVersion()) - .description(openApiProperties.getInfo().getDescription()) - .license(new License().name(openApiProperties.getInfo().getLicense().getName()) - .url(openApiProperties.getInfo().getLicense().getUrl()))); - - openApiProperties.getService().getServers().forEach(server -> - api.addServersItem(new Server().description(server.getDescription()).url(server.getUrl())) - ); - return api; - } - -} \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/constant/AuditErrorCode.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/constant/AuditErrorCode.java deleted file mode 100644 index 510015eb..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/constant/AuditErrorCode.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.mosip.kernel.auditmanager.constant; - -/** - * Constants for Audit Manager - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -public enum AuditErrorCode { - HANDLEREXCEPTION("KER-AUD-001", "Invalid Audit Request. Required parameters must be present"), - INVALIDFORMAT("KER-AUD-002", "Invalid Audit Request. Format is incorrect."), - INTERNAL_SERVER_ERROR("KER-AUD-500", "Internal server error"); - - private final String errorCode; - private final String errorMessage; - - private AuditErrorCode(final String errorCode, final String errorMessage) { - this.errorCode = errorCode; - this.errorMessage = errorMessage; - } - - public String getErrorCode() { - return errorCode; - } - - public String getErrorMessage() { - return errorMessage; - } - -} diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/controller/AuditManagerController.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/controller/AuditManagerController.java deleted file mode 100644 index d5df5976..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/controller/AuditManagerController.java +++ /dev/null @@ -1,73 +0,0 @@ -package io.mosip.kernel.auditmanager.controller; - -import javax.validation.Valid; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import io.mosip.kernel.auditmanager.dto.AuditResponseDto; -import io.mosip.kernel.auditmanager.entity.Audit; -import io.mosip.kernel.auditmanager.request.AuditRequestDto; -import io.mosip.kernel.auditmanager.service.AuditManagerService; -import io.mosip.kernel.core.http.RequestWrapper; -import io.mosip.kernel.core.http.ResponseFilter; -import io.mosip.kernel.core.http.ResponseWrapper; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.tags.Tag; - -/** - * AuditManager controller with api to add new {@link Audit} - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@RestController -@Tag(name = "Audit manager controller", description = "Rest endpoints which consist of operations related to Audit Management") -public class AuditManagerController { - - @Value("${mosip.kernel.auditmanager.add-audit.api-id:mosip.kernel.auditmanager.addAudit}") - private String apiId; - - @Value("${mosip.kernel.auditmanager.add-audit.api-version:1.0}") - private String apiVersion; - - /** - * AuditManager Service field with functions related to auditing - */ - @Autowired - AuditManagerService service; - - /** - * Function to add new audit - * - * @param requestDto {@link AuditRequestDto} having required fields for auditing - * @return The {@link AuditResponseDto} having the status of audit - */ - @Operation(summary = "Persist a audit", description = "persist a audit", tags = { "auditmanager" }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Success or you may find errors in error array in response"), - @ApiResponse(responseCode = "401", description = "Unauthorized" ,content = @Content(schema = @Schema(hidden = true))), - @ApiResponse(responseCode = "403", description = "Forbidden" ,content = @Content(schema = @Schema(hidden = true))), - @ApiResponse(responseCode = "404", description = "Not Found" ,content = @Content(schema = @Schema(hidden = true)))}) - //@PreAuthorize("hasAnyRole(@authorizedRoles.getPostaudits())") - //@PreAuthorize("hasAnyRole('INDIVIDUAL','ID_AUTHENTICATION','TEST', 'REGISTRATION_ADMIN', 'REGISTRATION_SUPERVISOR', 'REGISTRATION_OFFICER', 'REGISTRATION_PROCESSOR','PRE_REGISTRATION','PRE_REGISTRATION_ADMIN','RESIDENT','ZONAL_ADMIN','GLOBAL_ADMIN')") - @ResponseFilter - @PostMapping(value = "/audits", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseWrapper addAudit(@RequestBody @Valid RequestWrapper requestDto) { - ResponseWrapper response = new ResponseWrapper<>(); - response.setResponse(service.addAudit(requestDto.getRequest())); - response.setId(apiId); - response.setVersion(apiVersion); - response.setErrors(null); - return response; - } -} diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/dto/AuditResponseDto.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/dto/AuditResponseDto.java deleted file mode 100644 index 525bf97c..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/dto/AuditResponseDto.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - */ -package io.mosip.kernel.auditmanager.dto; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Class for Audit Response having status of audit - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class AuditResponseDto { - - /** - * The boolean audit status - */ - private boolean status; - -} diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/dto/AuthorizedRolesDTO.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/dto/AuthorizedRolesDTO.java deleted file mode 100644 index cab0fce9..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/dto/AuthorizedRolesDTO.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.mosip.kernel.auditmanager.dto; -import java.util.List; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -import lombok.Getter; -import lombok.Setter; - - -@Component("authorizedRoles") -@ConfigurationProperties(prefix = "mosip.role.auditmanager") -@Getter -@Setter -public class AuthorizedRolesDTO { - - private Listpostaudits; - -} \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/exception/ApiExceptionHandler.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/exception/ApiExceptionHandler.java deleted file mode 100644 index 73540cf9..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/exception/ApiExceptionHandler.java +++ /dev/null @@ -1,110 +0,0 @@ -package io.mosip.kernel.auditmanager.exception; - -import java.io.IOException; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.util.ContentCachingRequestWrapper; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; - -import io.mosip.kernel.auditmanager.constant.AuditErrorCode; -import io.mosip.kernel.auditmanager.constant.AuditErrorCodes; -import io.mosip.kernel.core.exception.ExceptionUtils; -import io.mosip.kernel.core.exception.ServiceError; -import io.mosip.kernel.core.http.ResponseWrapper; -import io.mosip.kernel.core.util.EmptyCheckUtils; - -/** - * Class for handling API exceptions - * - * @author Dharmesh Khandelwal - * @author Bal Vikash Sharma - * @since 1.0.0 - * - */ -@RestControllerAdvice -public class ApiExceptionHandler { - - private static final String WHITESPACE = " "; - - @Autowired - private ObjectMapper objectMapper; - - /** - * This method handle MethodArgumentNotValidException. - * - * @param httpServletRequest the request - * @param e the exception - * @return the response entity. - * @throws IOException the IO Exception - */ - @ExceptionHandler(MethodArgumentNotValidException.class) - public ResponseEntity> methodArgumentNotValidException( - HttpServletRequest httpServletRequest, final MethodArgumentNotValidException e) throws IOException { - ResponseWrapper responseWrapper = setErrors(httpServletRequest); - BindingResult bindingResult = e.getBindingResult(); - final List fieldErrors = bindingResult.getFieldErrors(); - fieldErrors.forEach(x -> { - ServiceError error = new ServiceError(AuditErrorCodes.HANDLEREXCEPTION.getErrorCode(), - Character.toUpperCase(x.getField().charAt(0)) + x.getField().substring(1) + WHITESPACE - + x.getDefaultMessage()); - responseWrapper.getErrors().add(error); - }); - ExceptionUtils.logRootCause(e); - return new ResponseEntity<>(responseWrapper, HttpStatus.OK); - - } - - @ExceptionHandler(HttpMessageNotReadableException.class) - public ResponseEntity> onHttpMessageNotReadable(HttpServletRequest httpServletRequest, - final HttpMessageNotReadableException e) throws IOException { - ResponseWrapper responseWrapper = setErrors(httpServletRequest); - ServiceError error = new ServiceError(AuditErrorCode.INVALIDFORMAT.getErrorCode(), e.getMessage()); - responseWrapper.getErrors().add(error); - ExceptionUtils.logRootCause(e); - return new ResponseEntity<>(responseWrapper, HttpStatus.OK); - } - - @ExceptionHandler(value = { Exception.class, RuntimeException.class }) - public ResponseEntity> defaultErrorHandler(HttpServletRequest httpServletRequest, - Exception e) throws IOException { - ResponseWrapper responseWrapper = setErrors(httpServletRequest); - ServiceError error = new ServiceError(AuditErrorCode.INTERNAL_SERVER_ERROR.getErrorCode(), e.getMessage()); - responseWrapper.getErrors().add(error); - ExceptionUtils.logRootCause(e); - return new ResponseEntity<>(responseWrapper, HttpStatus.INTERNAL_SERVER_ERROR); - } - - private ResponseWrapper setErrors(HttpServletRequest httpServletRequest) throws IOException { - ResponseWrapper responseWrapper = new ResponseWrapper<>(); - responseWrapper.setResponsetime(LocalDateTime.now(ZoneId.of("UTC"))); - String requestBody = null; - if (httpServletRequest instanceof ContentCachingRequestWrapper) { - requestBody = new String(((ContentCachingRequestWrapper) httpServletRequest).getContentAsByteArray()); - } - if (EmptyCheckUtils.isNullEmpty(requestBody)) { - return responseWrapper; - } - objectMapper.registerModule(new JavaTimeModule()); - JsonNode reqNode = objectMapper.readTree(requestBody); - responseWrapper.setId(reqNode.path("id").asText()); - responseWrapper.setVersion(reqNode.path("version").asText()); - return responseWrapper; - } - -} \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/service/AuditManagerService.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/service/AuditManagerService.java deleted file mode 100644 index 9679bebe..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/service/AuditManagerService.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * - */ -package io.mosip.kernel.auditmanager.service; - -import io.mosip.kernel.auditmanager.dto.AuditResponseDto; -import io.mosip.kernel.auditmanager.entity.Audit; -import io.mosip.kernel.auditmanager.request.AuditRequestDto; - -/** - * Interface for AuditManager Serivce having function to add new {@link Audit} - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -public interface AuditManagerService { - - /** - * Function to add new audit - * - * @param auditRequestDto The {@link AuditRequestDto} having required field to - * audit - * @return The {@link AuditResponseDto} having status of audit - */ - AuditResponseDto addAudit(AuditRequestDto auditRequestDto); - -} \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/service/impl/AuditManagerServiceImpl.java b/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/service/impl/AuditManagerServiceImpl.java deleted file mode 100644 index 5cce13e1..00000000 --- a/kernel/kernel-auditmanager-service/src/main/java/io/mosip/kernel/auditmanager/service/impl/AuditManagerServiceImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.mosip.kernel.auditmanager.service.impl; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import io.mosip.kernel.auditmanager.dto.AuditResponseDto; -import io.mosip.kernel.auditmanager.entity.Audit; -import io.mosip.kernel.auditmanager.request.AuditRequestDto; -import io.mosip.kernel.auditmanager.service.AuditManagerService; -import io.mosip.kernel.core.auditmanager.spi.AuditHandler; - -/** - * AuditManager service implementation with function to add new {@link Audit} - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@Service -public class AuditManagerServiceImpl implements AuditManagerService { - - /** - * Field for audit handler - */ - @Autowired - private AuditHandler auditHandler; - - /* - * (non-Javadoc) - * - * @see - * io.mosip.kernel.core.audit.service.impl.AuditManagerService#addAudit(org. - * mosip.kernel.core.audit.dto.AuditRequestDto) - */ - @Override - public AuditResponseDto addAudit(AuditRequestDto auditRequestDto) { - AuditResponseDto auditResponseDto = new AuditResponseDto(); - auditHandler.addAudit(auditRequestDto); - auditResponseDto.setStatus(true); - return auditResponseDto; - } - -} diff --git a/kernel/kernel-auditmanager-service/src/main/resources/application-dev.properties b/kernel/kernel-auditmanager-service/src/main/resources/application-dev.properties deleted file mode 100644 index 80cd4cf8..00000000 --- a/kernel/kernel-auditmanager-service/src/main/resources/application-dev.properties +++ /dev/null @@ -1,23 +0,0 @@ -#logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=DEBUG - - -mosip.kernel.auditmanager-service-logs-location=logs/audit.log -spring.h2.console.enabled=true -spring.datasource.driver-class-name=org.postgresql.Driver -audit_database_url=jdbc:postgresql://dev.mosip.net:30090/mosip_audit -audit_database_username=postgres -audit_database_password=mosip123 - -spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect -spring.jpa.hibernate.ddl-auto=none -spring.datasource.testWhileIdle=true -spring.datasource.test-on-borrow=true - -auth.server.validate.url=https://dev.mosip.net/v1/authmanager/authorize/validateToken -auth.role.prefix=ROLE_ -auth.header.name=Authorization - -mosip.auth.adapter.impl.basepackage=io.mosip.kernel.auth.defaultadapter -auth.server.admin.validate.url=https://dev.mosip.net/v1/authmanager/authorize/admin/validateToken -spring.cloud.config.enabled=false \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/src/main/resources/application-local.properties b/kernel/kernel-auditmanager-service/src/main/resources/application-local.properties deleted file mode 100644 index 91e6e65d..00000000 --- a/kernel/kernel-auditmanager-service/src/main/resources/application-local.properties +++ /dev/null @@ -1,23 +0,0 @@ -#logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=DEBUG - - -mosip.kernel.auditmanager-service-logs-location=logs/audit.log - - -spring.h2.console.enabled=true -spring.h2.console.path=/admin/h2-console/ -spring.datasource.driver-class-name=org.h2.Driver -audit_database_url=jdbc:h2:mem:mosip_audit; -audit_database_username=audituser -audit_database_password=Mosip@dev123 - -spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation= true -spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.H2Dialect -spring.jpa.hibernate.ddl-auto= none -spring.datasource.testWhileIdle=true -spring.datasource.test-on-borrow=true - -auth.server.validate.url=http://localhost:8091/authmanager/authorize/validateToken -auth.role.prefix=ROLE_ -auth.header.name=Authorization -mosip.role.auditmanager.postaudits=INDIVIDUAL,ID_AUTHENTICATION,TEST,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,REGISTRATION_OFFICER,REGISTRATION_PROCESSOR,PRE_REGISTRATION,PRE_REGISTRATION_ADMIN,RESIDENT,ZONAL_ADMIN,GLOBAL_ADMIN diff --git a/kernel/kernel-auditmanager-service/src/main/resources/bootstrap.properties b/kernel/kernel-auditmanager-service/src/main/resources/bootstrap.properties deleted file mode 100644 index 24c97dc3..00000000 --- a/kernel/kernel-auditmanager-service/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,37 +0,0 @@ -#spring.cloud.config.uri=localhost -#spring.cloud.config.label=master -spring.profiles.active=dev -spring.cloud.config.name=kernel -spring.application.name=kernel-auditmanager-service -#management.security.enabled=false -#management.endpoint.health.show-details=when-authorized -#management.endpoints.web.exposure.include=* -management.endpoint.health.show-details=always -management.endpoints.web.exposure.include=info,health,refresh,mappings,prometheus -management.endpoint.metrics.enabled=true -management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true - - -server.port=8081 -server.servlet.path=/v1/auditmanager - - -spring.datasource.url=${audit_database_url} -spring.datasource.username=${audit_database_username} -spring.datasource.password=${audit_database_password} - -#disabling health check so that client doesnt try to load properties from sprint config server every -# 5 minutes (should not be done in production) -health.config.enabled=false - -openapi.info.title=Audit Manager Service -openapi.info.description=Rest Endpoints for operations related to audit -openapi.info.version=1.0 -openapi.info.license.name=Mosip -openapi.info.license.url=https://docs.mosip.io/platform/license -mosipbox.public.url=http://localhost:${server.port} -openapi.service.servers[0].url=${mosipbox.public.url}${server.servlet.path} -openapi.service.servers[0].description=Audit Manager Service -springdoc.swagger-ui.disable-swagger-default-url=true -spring.mvc.servlet.path=${server.servlet.path} diff --git a/kernel/kernel-auditmanager-service/src/main/resources/logback.xml b/kernel/kernel-auditmanager-service/src/main/resources/logback.xml deleted file mode 100644 index 150c6224..00000000 --- a/kernel/kernel-auditmanager-service/src/main/resources/logback.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/src/main/resources/schema.sql b/kernel/kernel-auditmanager-service/src/main/resources/schema.sql deleted file mode 100644 index 105136c5..00000000 --- a/kernel/kernel-auditmanager-service/src/main/resources/schema.sql +++ /dev/null @@ -1,12 +0,0 @@ --- create table section ------------------------------------------------- --- schema : audit - Audit database schema --- table : app_audit_log - Audit log --- table alias : adtl - --- schemas section ------------------------------------------------- - --- create schema if master schema for Identity Issuance tables is not exists -create schema if not exists audit; - -create schema if not exists kernel; - diff --git a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/auditmanager/test/AuditManagerTestBootApplication.java b/kernel/kernel-auditmanager-service/src/test/java/io/mosip/auditmanager/test/AuditManagerTestBootApplication.java deleted file mode 100644 index 91acb2e1..00000000 --- a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/auditmanager/test/AuditManagerTestBootApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.mosip.auditmanager.test; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Audit manager application - * - * @author Dharmesh Khandelwal - * @since 1.0.0 - * - */ -@SpringBootApplication(scanBasePackages = { "io.mosip.kernel.auditmanager.*" }) -public class AuditManagerTestBootApplication { - - /** - * Main method to run spring boot application - * - * @param args args - */ - public static void main(String[] args) { - SpringApplication.run(AuditManagerTestBootApplication.class, args); - } -} diff --git a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/config/TestSecurityConfig.java b/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/config/TestSecurityConfig.java deleted file mode 100644 index d2a37ccf..00000000 --- a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/config/TestSecurityConfig.java +++ /dev/null @@ -1,77 +0,0 @@ -package io.mosip.kernel.auditmanager.test.config; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.servlet.http.HttpServletResponse; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.config.http.SessionCreationPolicy; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.provisioning.InMemoryUserDetailsManager; -import org.springframework.security.web.AuthenticationEntryPoint; -import org.springframework.security.web.firewall.DefaultHttpFirewall; -import org.springframework.security.web.firewall.HttpFirewall; - -@Configuration -@EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) -public class TestSecurityConfig extends WebSecurityConfigurerAdapter { - - @Bean - public HttpFirewall defaultHttpFirewall() { - return new DefaultHttpFirewall(); - } - - @Override - public void configure(WebSecurity webSecurity) throws Exception { - webSecurity.ignoring().antMatchers(allowedEndPoints()); - super.configure(webSecurity); - webSecurity.httpFirewall(defaultHttpFirewall()); - } - - private String[] allowedEndPoints() { - return new String[] { "/assets/**", "/icons/**", "/screenshots/**", "/favicon**", "/**/favicon**", "/css/**", - "/js/**", "/*/error**", "/*/webjars/**", "/*/v2/api-docs", "/*/configuration/ui", - "/*/configuration/security", "/*/swagger-resources/**", "/*/swagger-ui.html" }; - } - - @Override - protected void configure(final HttpSecurity httpSecurity) throws Exception { - httpSecurity.csrf().disable(); - httpSecurity.httpBasic().and().authorizeRequests().anyRequest().authenticated().and().sessionManagement() - .sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().exceptionHandling() - .authenticationEntryPoint(unauthorizedEntryPoint()); - } - - @Bean - public AuthenticationEntryPoint unauthorizedEntryPoint() { - return (request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED); - } - - @Bean - public UserDetailsService userDetailsService() { - List users = new ArrayList<>(); - users.add(new User("reg-officer", "mosip", - Arrays.asList(new SimpleGrantedAuthority("ROLE_REGISTRATION_OFFICER")))); - users.add(new User("reg-supervisor", "mosip", - Arrays.asList(new SimpleGrantedAuthority("ROLE_REGISTRATION_SUPERVISOR")))); - users.add(new User("reg-admin", "mosip", Arrays.asList(new SimpleGrantedAuthority("ROLE_REGISTRATION_ADMIN")))); - users.add(new User("reg-processor", "mosip", - Arrays.asList(new SimpleGrantedAuthority("ROLE_REGISTRATION_PROCESSOR")))); - users.add(new User("id-auth", "mosip", Arrays.asList(new SimpleGrantedAuthority("ROLE_ID_AUTHENTICATION")))); - users.add(new User("individual", "mosip", Arrays.asList(new SimpleGrantedAuthority("ROLE_INDIVIDUAL")))); - users.add(new User("test", "mosip", Arrays.asList(new SimpleGrantedAuthority("ROLE_TEST")))); - return new InMemoryUserDetailsManager(users); - } -} \ No newline at end of file diff --git a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/controller/AuditControllerTest.java b/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/controller/AuditControllerTest.java deleted file mode 100644 index 36e0a0be..00000000 --- a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/controller/AuditControllerTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package io.mosip.kernel.auditmanager.test.controller; - -import static org.hamcrest.CoreMatchers.is; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.time.LocalDateTime; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentMatchers; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.http.MediaType; -import org.springframework.security.test.context.support.WithUserDetails; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.mosip.auditmanager.test.AuditManagerTestBootApplication; -import io.mosip.kernel.auditmanager.dto.AuditResponseDto; -import io.mosip.kernel.auditmanager.repository.AuditRepository; -import io.mosip.kernel.auditmanager.request.AuditRequestDto; -import io.mosip.kernel.auditmanager.service.impl.AuditManagerServiceImpl; -import io.mosip.kernel.core.http.RequestWrapper; - -@SpringBootTest(classes = { AuditManagerTestBootApplication.class }) -@RunWith(SpringRunner.class) -@AutoConfigureMockMvc - -public class AuditControllerTest { - - @MockBean - private AuditManagerServiceImpl service; - - @Autowired - private MockMvc mockMvc; - - @Autowired - private ObjectMapper objectMapper; - - @MockBean - private AuditRepository auditRepository; - - @WithUserDetails("reg-processor") - @Test - public void auditTest() throws Exception { - - AuditRequestDto auditRequestDto = new AuditRequestDto(); - auditRequestDto.setActionTimeStamp(LocalDateTime.now()); - auditRequestDto.setApplicationId("applicationId"); - auditRequestDto.setApplicationName("applicationName"); - auditRequestDto.setCreatedBy("createdBy"); - auditRequestDto.setDescription("description"); - auditRequestDto.setEventId("eventId"); - auditRequestDto.setEventName("eventName"); - auditRequestDto.setEventType("eventType"); - auditRequestDto.setHostIp("hostIp"); - auditRequestDto.setHostName("hostName"); - auditRequestDto.setId("id"); - auditRequestDto.setIdType("idType"); - auditRequestDto.setModuleId("moduleId"); - auditRequestDto.setModuleName("moduleName"); - auditRequestDto.setSessionUserId("sessionUserId"); - auditRequestDto.setSessionUserName("sessionUserName"); - - AuditResponseDto auditResponseDto = new AuditResponseDto(); - auditResponseDto.setStatus(true); - when(service.addAudit(ArgumentMatchers.any())).thenReturn(auditResponseDto); - - RequestWrapper request = new RequestWrapper<>(); - request.setRequest(auditRequestDto); - - mockMvc.perform(post("/audits").contentType(MediaType.APPLICATION_JSON) - .content(objectMapper.writeValueAsString(request))).andExpect(status().isOk()) - .andExpect(jsonPath("$.response.status", is(true))); - } - -} diff --git a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/exception/AuditExceptionTest.java b/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/exception/AuditExceptionTest.java deleted file mode 100644 index b33751fa..00000000 --- a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/exception/AuditExceptionTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package io.mosip.kernel.auditmanager.test.exception; - -import static org.hamcrest.CoreMatchers.is; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.http.MediaType; -import org.springframework.security.test.context.support.WithUserDetails; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; - -import io.mosip.auditmanager.test.AuditManagerTestBootApplication; -import io.mosip.kernel.auditmanager.repository.AuditRepository; -import io.mosip.kernel.auditmanager.service.impl.AuditManagerServiceImpl; - -@SpringBootTest(classes = { AuditManagerTestBootApplication.class }) -@RunWith(SpringRunner.class) -@AutoConfigureMockMvc -public class AuditExceptionTest { - @Autowired - private MockMvc mockMvc; - - @MockBean - private AuditManagerServiceImpl service; - - @MockBean - private AuditRepository auditRepository; - - @WithUserDetails("reg-processor") - @Test - public void auditInvalidRequestExceptionTest() throws Exception { - String json = "{\r\n" + " \"eventName\": \"string\",\r\n" + " \"eventType\": \"string\",\r\n" - + " \"actionTimeStamp\": \"2018-09-10T11:39:28.191Z\",\r\n" + " \"hostName\": \"string\",\r\n" - + " \"hostIp\": \"string\",\r\n" + " \"applicationId\": \"string\",\r\n" - + " \"applicationName\": \"string\",\r\n" + " \"sessionUserId\": \"string\",\r\n" - + " \"sessionUserName\": \"string\",\r\n" + " \"id\": \"string\",\r\n" - + " \"idType\": \"string\",\r\n" + " \"createdBy\": \"string\",\r\n" - + " \"moduleName\": \"string\",\r\n" + " \"moduleId\": \"string\",\r\n" - + " \"description\": \"string\"\r\n" + "}"; - mockMvc.perform(post("/audits").contentType(MediaType.APPLICATION_JSON).content(json)) - .andExpect(status().isOk()).andExpect(jsonPath("$.errors[0].errorCode", is("KER-AUD-001"))); - } - - @WithUserDetails("reg-processor") - @Test - public void auditConstraintExceptionTest() throws Exception { - - String json = "{\r\n" + " \"eventId\": \"\",\r\n" + " \"eventName\": \"string\",\r\n" - + " \"eventType\": \"string\",\r\n" + " \"actionTimeStamp\": \"2018-09-10T11:39:28.191Z\",\r\n" - + " \"hostName\": \"string\",\r\n" + " \"hostIp\": \"string\",\r\n" - + " \"applicationId\": \"string\",\r\n" + " \"applicationName\": \"string\",\r\n" - + " \"sessionUserId\": \"string\",\r\n" + " \"sessionUserName\": \"string\",\r\n" - + " \"id\": \"string\",\r\n" + " \"idType\": \"string\",\r\n" + " \"createdBy\": \"string\",\r\n" - + " \"moduleName\": \"string\",\r\n" + " \"moduleId\": \"string\",\r\n" - + " \"description\": \"string\"\r\n" + "}"; - mockMvc.perform(post("/audits").contentType(MediaType.APPLICATION_JSON).content(json)) - .andExpect(status().isOk()).andExpect(jsonPath("$.errors[0].errorCode", is("KER-AUD-001"))); - } - -} diff --git a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/service/AuditServiceTest.java b/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/service/AuditServiceTest.java deleted file mode 100644 index c64fd361..00000000 --- a/kernel/kernel-auditmanager-service/src/test/java/io/mosip/kernel/auditmanager/test/service/AuditServiceTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package io.mosip.kernel.auditmanager.test.service; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import java.time.LocalDateTime; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.test.context.junit4.SpringRunner; - -import io.mosip.auditmanager.test.AuditManagerTestBootApplication; -import io.mosip.kernel.auditmanager.dto.AuditResponseDto; -import io.mosip.kernel.auditmanager.repository.AuditRepository; -import io.mosip.kernel.auditmanager.request.AuditRequestDto; -import io.mosip.kernel.auditmanager.service.impl.AuditManagerServiceImpl; - -@SpringBootTest(classes = { AuditManagerTestBootApplication.class }) -@RunWith(SpringRunner.class) -public class AuditServiceTest { - - @Autowired - private AuditManagerServiceImpl service; - - @MockBean - private AuditRepository auditRepository; - - @Test - public void auditServiceTest() { - - AuditRequestDto auditRequestDto = new AuditRequestDto(); - auditRequestDto.setActionTimeStamp(LocalDateTime.now()); - auditRequestDto.setApplicationId("applicationId"); - auditRequestDto.setApplicationName("applicationName"); - auditRequestDto.setCreatedBy("createdBy"); - auditRequestDto.setDescription("description"); - auditRequestDto.setEventId("eventId"); - auditRequestDto.setEventName("eventName"); - auditRequestDto.setEventType("eventType"); - auditRequestDto.setHostIp("hostIp"); - auditRequestDto.setHostName("hostName"); - auditRequestDto.setId("id"); - auditRequestDto.setIdType("idType"); - auditRequestDto.setModuleId("moduleId"); - auditRequestDto.setModuleName("moduleName"); - auditRequestDto.setSessionUserId("sessionUserId"); - auditRequestDto.setSessionUserName("sessionUserName"); - - AuditResponseDto auditResponseDto = new AuditResponseDto(); - auditResponseDto.setStatus(true); - - assertThat(service.addAudit(auditRequestDto), is(auditResponseDto)); - } -} diff --git a/kernel/kernel-auditmanager-service/src/test/resources/application.properties b/kernel/kernel-auditmanager-service/src/test/resources/application.properties deleted file mode 100644 index 8bb409ca..00000000 --- a/kernel/kernel-auditmanager-service/src/test/resources/application.properties +++ /dev/null @@ -1,22 +0,0 @@ - -mosip.kernel.auditmanager-service-logs-location=src/test/resources - - -spring.datasource.driver-class-name=org.h2.Driver -spring.datasource.url=jdbc:h2\:mem\:testdb;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS AUDIT -spring.datasource.username=sa -spring.datasource.password=sa -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect -spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true -spring.jpa.hibernate.ddl-auto=none -spring.datasource.testWhileIdle=true -spring.datasource.test-on-borrow=true - -## To disable the logging (spring boot) -logging.level.org.springframework=OFF -logging.level.root=OFF -spring.main.banner-mode=off - -mosip.auth.adapter.impl.basepackage=io.mosip.kernel.auth.defaultadapter -auth.server.validate.url=http://localhost:8091/v1/authmanager/authorize/admin/validateToken -mosip.kernel.auth.appids.realm.map={prereg:'preregistration',ida:'mosip',registrationclient:'mosip',regproc:'mosip',partner:'mosip',resident:'mosip',admin:'mosip',crereq:'mosip',creser:'mosip',datsha:'mosip'} diff --git a/kernel/kernel-auditmanager-service/src/test/resources/bootstrap.properties b/kernel/kernel-auditmanager-service/src/test/resources/bootstrap.properties deleted file mode 100644 index 161a5018..00000000 --- a/kernel/kernel-auditmanager-service/src/test/resources/bootstrap.properties +++ /dev/null @@ -1,27 +0,0 @@ -spring.cloud.config.uri=localhost -spring.cloud.config.label=master -spring.cloud.config.name=kernel -spring.application.name=kernel-auditmanager-service -spring.profiles.active=test -management.endpoints.web.exposure.include=refresh -#management.security.enabled=false - -server.port=8081 -server.servlet.path=/v1/auditmanager -#disabling health check so that client doesnt try to load properties from sprint config server every -# 5 minutes (should not be done in production) -health.config.enabled=false - -openapi.info.title=Audit Manager Service -openapi.info.description=Rest Endpoints for operations related to audit -openapi.info.version=1.0 -openapi.info.license.name=Mosip -openapi.info.license.url=https://docs.mosip.io/platform/license -mosipbox.public.url=http://localhost:${server.port} -openapi.service.servers[0].url=${mosipbox.public.url}${server.servlet.path} -openapi.service.servers[0].description=Audit Manager Service -springdoc.swagger-ui.disable-swagger-default-url=true -spring.mvc.servlet.path=${server.servlet.path} - - - diff --git a/kernel/kernel-auditmanager-service/src/test/resources/logback.xml b/kernel/kernel-auditmanager-service/src/test/resources/logback.xml deleted file mode 100644 index 7285a15d..00000000 --- a/kernel/kernel-auditmanager-service/src/test/resources/logback.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - %d [%t] %p [%C{1}].%M.%L : %m%n - - - - - - \ No newline at end of file diff --git a/kernel/pom.xml b/kernel/pom.xml deleted file mode 100644 index 09dc38f1..00000000 --- a/kernel/pom.xml +++ /dev/null @@ -1,322 +0,0 @@ - - - 4.0.0 - - 1.2.0.1 - io.mosip.kernel - audit-manager - pom - audit-manager - Project of MOSIP audit manager - https://github.com/mosip/commons - - UTF-8 - - - 11 - 11 - 3.8.0 - 2.22.0 - 3.0.2 - 3.1.0 - 0.8.5 - 3.7.0.1746 - 3.2.0 - 2.3 - - **/constant/**,**/config/**,**/httpfilter/**,**/cache/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/verticle/**,**/spi/**,"**/proxy/**" - **/dto/**,**/entity/**,**/config/** - - - - kernel-auditmanager-api - kernel-auditmanager-service - - - - - ossrh - CentralRepository - https://oss.sonatype.org/content/repositories/snapshots - default - - true - - - - central - MavenCentral - default - https://repo1.maven.org/maven2 - - false - - - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven.surefire.plugin.version} - - ${skipTests} - false - - ${argLine} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --illegal-access=permit - - - - - org.jacoco - jacoco-maven-plugin - ${maven.jacoco.version} - - - - prepare-agent - - - - report - prepare-package - - report - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven.javadoc.version} - - none - - - - org.apache.maven.plugins - maven-jar-plugin - ${maven.jar.plugin.version} - - - - true - true - - - ${project.name} - ${project.version} - - - - - - org.apache.maven.plugins - maven-war-plugin - ${maven.war.plugin.version} - - - - true - true - - - ${project.name} - ${project.version} - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven.javadoc.version} - - true - none - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compiler.version} - - ${maven.compiler.source} - ${maven.compiler.target} - - - - maven-deploy-plugin - 2.8.1 - - - default-deploy - deploy - - deploy - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - - default-deploy - deploy - - deploy - - - - - ossrh - https://oss.sonatype.org/ - false - - - - - org.apache.maven.plugins - maven-source-plugin - true - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.2.0 - - - attach-javadocs - - jar - - - - - none - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - pl.project13.maven - git-commit-id-plugin - 3.0.1 - - - get-the-git-infos - - revision - - validate - - - - true - ${project.build.outputDirectory}/git.properties - - ^git.build.(time|version)$ - ^git.commit.id.(abbrev|full)$ - - full - ${project.basedir}/.git - - - - - - scm:git:git://github.com/mosip/commons.git - scm:git:ssh://github.com:mosip/commons.git - https://github.com/mosip/commons - HEAD - - - - MPL 2.0 - https://www.mozilla.org/en-US/MPL/2.0/ - - - - - Mosip - mosip.emailnotifier@gmail.com - io.mosip - https://github.com/mosip/commons - - - - - sonar - - . - src/main/java/**,src/main/resources/** - ${sonar.coverage.exclusions} - https://sonarcloud.io - - - false - - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${maven.sonar.plugin.version} - - - verify - - sonar - - - - - - - - -