From e138caab8a856ae5f545cff83679a822fceb34e7 Mon Sep 17 00:00:00 2001 From: Anup Nehe Date: Mon, 23 Oct 2023 18:40:46 +0530 Subject: [PATCH] MOSIP-29798 Signed-off-by: Anup Nehe --- .../CreateBioExtractors.yml | 27 +- .../DefineDataSharePolicy.yml | 357 ++++++++++++++++++ .../defineDataSharePolicy.hbs | 12 +- 3 files changed, 389 insertions(+), 7 deletions(-) diff --git a/automationtests/src/main/resources/partner/CreateBioExtractors/CreateBioExtractors.yml b/automationtests/src/main/resources/partner/CreateBioExtractors/CreateBioExtractors.yml index ac90c3f5796..6e5b157c093 100644 --- a/automationtests/src/main/resources/partner/CreateBioExtractors/CreateBioExtractors.yml +++ b/automationtests/src/main/resources/partner/CreateBioExtractors/CreateBioExtractors.yml @@ -21,4 +21,29 @@ CreateBioExtractors: "errorCode": "PMS_PRT_061" } ] -}' \ No newline at end of file +}' + + Partner_CreateBioExtractors_InValid_PolicyId: + endPoint: /v1/partnermanager/partners/{partnerId}/bioextractors/{policyId} + role: partner + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: partner/CreateBioExtractors/createBioExtractors + outputTemplate: partner/error + input: '{ + "partnerId": "mpartner-default-auth", + "policyId": "vdsfhfx", + "attributeName": "iris", + "biometric": "iris", + "provider": "mock", + "version": "1.1", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": "PMS_PRT_061" + } + ] +}' + diff --git a/automationtests/src/main/resources/partner/policy/DefineDataSharePolicy/DefineDataSharePolicy.yml b/automationtests/src/main/resources/partner/policy/DefineDataSharePolicy/DefineDataSharePolicy.yml index c3ccbf6b2d9..9a1fbf8df37 100644 --- a/automationtests/src/main/resources/partner/policy/DefineDataSharePolicy/DefineDataSharePolicy.yml +++ b/automationtests/src/main/resources/partner/policy/DefineDataSharePolicy/DefineDataSharePolicy.yml @@ -12,6 +12,12 @@ defineDataSharePolicy: "policyGroupName": "mosip policy group", "policyType": "DataShare", "format":"extraction", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "attributeName":"biometrics", "version": "1.0", "requesttime": "$TIMESTAMP$" @@ -38,6 +44,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: ' { @@ -62,6 +74,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: ' { @@ -86,6 +104,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: ' { @@ -109,6 +133,12 @@ defineDataSharePolicy: "format":"$REMOVE$", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: ' { @@ -133,6 +163,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: '{ @@ -157,6 +193,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: '{ @@ -181,6 +223,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: '{ @@ -205,6 +253,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: '{ @@ -229,6 +283,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: '{ @@ -253,6 +313,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: '{ @@ -277,6 +343,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: '{ @@ -301,6 +373,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"biometrics", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: '{ @@ -326,6 +404,12 @@ defineDataSharePolicy: "format":"extraction", "attributeName":"$REMOVE$", "version": "1.0", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", "requesttime": "$TIMESTAMP$" }' output: ' { @@ -335,4 +419,277 @@ defineDataSharePolicy: } ] + }' + + Partner_DefineDataSharePolicy_format_SpaceVal_Neg: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicyResult + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policya", + "policyId": "MDSPA", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":" ", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", + "attributeName":"biometrics", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "policyGroupName": "mosip policy group", + "name": "mosip data share policya", + "desc": "mosip data share policy", + "is_Active": false + }' + + Partner_DefineDataSharePolicy_IndividualBiometrics_Attribute: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicyResult + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policyb", + "policyId": "MDSPB", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":"extraction", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", + "attributeName":"individualBiometrics", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "policyGroupName": "mosip policy group", + "name": "mosip data share policyb", + "desc": "mosip data share policy", + "is_Active": false + }' + + Partner_DefineDataSharePolicy_Zipcode_Attribute: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicyResult + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policyd", + "policyId": "MDSPC", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":"extraction", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", + "attributeName":"Zipcode", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "policyGroupName": "mosip policy group", + "name": "mosip data share policyd", + "desc": "mosip data share policy", + "is_Active": false + }' + + Partner_DefineDataSharePolicy_typeOfShare_SpaceVal_Neg: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/error + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policye", + "policyId": "MDSPDD", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":"extraction", + "typeOfShare": " ", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", + "attributeName":"biometrics", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_PV_005" + } + ] + }' + + Partner_DefineDataSharePolicy_typeOfShare_Direct_Neg: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/error + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policyf", + "policyId": "MDSPEE", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":"extraction", + "typeOfShare": "Direct", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", + "attributeName":"biometrics", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_PV_005" + } + ] + }' + + Partner_DefineDataSharePolicy_typeOfShare_Remove_Neg: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/error + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policyi", + "policyId": "MDSPEE", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":"extraction", + "typeOfShare": "$REMOVE$", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", + "attributeName":"biometrics", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_PV_006" + } + ] + }' + + Partner_DefineDataSharePolicy_shareDomain_https_Smoke: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicyResult + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policyg", + "policyId": "MDSPGG", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":"extraction", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "https", + "source": "Packet Manager", + "attributeName":"biometrics", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "policyGroupName": "mosip policy group", + "name": "mosip data share policyg", + "desc": "mosip data share policy", + "is_Active": false + }' + + Partner_DefineDataSharePolicy_EncryptionType_Neg: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicyResult + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policyh", + "policyId": "MDSPHH", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":"extraction", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "none", + "shareDomain": "datashare-service", + "source": "Packet Manager", + "attributeName":"biometrics", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "policyGroupName": "mosip policy group", + "name": "mosip data share policyh", + "desc": "mosip data share policy", + "is_Active": false + }' + + Partner_DefineDataSharePolicy_AttributeName_Custom_Name_Neg: + endPoint: /v1/policymanager/policies + role: partner + restMethod: post + inputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicy + outputTemplate: partner/policy/DefineDataSharePolicy/defineDataSharePolicyResult + input: '{ + "desc": "mosip data share policy", + "name": "mosip data share policyk", + "policyId": "MDSPm", + "policyGroupName": "mosip policy group", + "policyType": "DataShare", + "format":"extraction", + "typeOfShare": "Data Share", + "validForInMinutes": "30", + "transactionsAllowed": "2", + "encryptionType": "Partner Based", + "shareDomain": "datashare-service", + "source": "Packet Manager", + "attributeName":"custom name", + "version": "1.0", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "policyGroupName": "mosip policy group", + "name": "mosip data share policyk", + "desc": "mosip data share policy", + "is_Active": false }' \ No newline at end of file diff --git a/automationtests/src/main/resources/partner/policy/DefineDataSharePolicy/defineDataSharePolicy.hbs b/automationtests/src/main/resources/partner/policy/DefineDataSharePolicy/defineDataSharePolicy.hbs index 70f66ce5ac4..b5f3742c775 100644 --- a/automationtests/src/main/resources/partner/policy/DefineDataSharePolicy/defineDataSharePolicy.hbs +++ b/automationtests/src/main/resources/partner/policy/DefineDataSharePolicy/defineDataSharePolicy.hbs @@ -33,12 +33,12 @@ "format": "{{format}}" }], "dataSharePolicies": { - "typeOfShare": "Data Share", - "validForInMinutes": "30", - "transactionsAllowed": "2", - "encryptionType": "Partner Based", - "shareDomain": "datashare-service", - "source": "Packet Manager" + "typeOfShare": "{{typeOfShare}}", + "validForInMinutes": "{{validForInMinutes}}", + "transactionsAllowed": "{{transactionsAllowed}}", + "encryptionType": "{{encryptionType}}", + "shareDomain": "{{shareDomain}}", + "source": "{{source}}" } } }