forked from mosip/esignet-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ES-1690 adding sunbird authentication plugin (mosip#47)
* ES-1690 adding sunbird authentication plugin Signed-off-by: Sachin Rana <sacrana324@gmail.com> * addressed review comments Signed-off-by: Sachin Rana <sacrana324@gmail.com> * property 'kba' changed to 'kbi' Signed-off-by: Sachin Rana <sacrana324@gmail.com> --------- Signed-off-by: Sachin Rana <sacrana324@gmail.com> Signed-off-by: Zeeshan Mehboob <zeeshan.mehboob@infosys.com>
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# sunbird-rc-plugin | ||
|
||
## About | ||
Implementation for all the interfaces defined in esignet-integration-api. This libaray is built as a wrapper for [sunbird-registry-system](sunbird-registry-url) service. | ||
|
||
This library should be added as a runtime dependency to [esignet-service](https://github.com/mosip/esignet) | ||
|
||
## Configurations required to added in esignet-default.properties | ||
|
||
```` | ||
mosip.esignet.integration.scan-base-package=io.mosip.esignet.plugin.sunbirdrc | ||
mosip.esignet.integration.authenticator=SunbirdRCAuthenticationService | ||
mosip.esignet.integration.vci-plugin=SunbirdRCVCIssuancePlugin | ||
##--------------------sunbird registry authentication related demo configuration-------------------------## | ||
mosip.esignet.authenticator.sunbird-rc.auth-factor.kbi.individual-id-field='policyNumber' | ||
mosip.esignet.authenticator.sunbird-rc.auth-factor.kbi.field-details={{"id":"policyNumber", "type":"text", "format":""},{"id":"name", "type":"text", "format":""},{"id":"dob", "type":"date", "format":"dd/mm/yyyy"}} | ||
mosip.esignet.authenticator.sunbird-rc.auth-factor.kbi.registry-search-url=http://10.3.148.107/registry/api/v1/Insurance/search | ||
mosip.esignet.authenticator.sunbird-rc.kbi.entity-id-field=osid | ||
##-----------------------------VCI related demo configuration---------------------------------------------## | ||
mosip.esignet.vciplugin.sunbird-rc.issue-credential-url=http://164.52.205.87/credentials/issue | ||
mosip.esignet.vciplugin.sunbird-rc.supported-credential-types=InsuranceCredential,HealthCardCredential | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.InsuranceCredential.static-value-map.issuerId=did:web:esignet-mock.dev.mosip.net | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.InsuranceCredential.template-url=requestTemplete.json | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.InsuranceCredential.registry-get-url=http://10.3.148.107/api/v1/Insurance/ | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.InsuranceCredential.cred-schema-id=did:schema:1e4d93df-4047-4dd7-8515-9ad46796009f | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.InsuranceCredential.cred-schema-version=1.0.0 | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.HealthCardCredential.static-value-map.issuerId=did:web:esignet-mock.dev.mosip.net | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.HealthCardCredential.template-url=requestTemplete.json | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.HealthCardCredential.registry-get-url=http://10.3.148.107/api/v1/Insurance/ | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.HealthCardCredential.cred-schema-id=did:schema:1e4d93df-4047-4dd7-8515-9ad46796009f | ||
mosip.esignet.vciplugin.sunbird-rc.credential-type.HealthCardCredential.cred-schema-version=1.0.0 | ||
```` | ||
|
||
|
||
Add "bindingtransaction" cache name in "mosip.esignet.cache.names" property. | ||
|
||
## License | ||
This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE). | ||
This integration plugin is compatible with [Sunbird-RC 1.0.0](https://github.com/Sunbird-RC/sunbird-rc-core/tree/v1.0.0) | ||
|
||
|
18 changes: 18 additions & 0 deletions
18
...-plugin/src/main/java/io/mosip/esignet/plugin/sunbirdrc/dto/RegistrySearchRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
package io.mosip.esignet.plugin.sunbirdrc.dto; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.Map; | ||
|
||
@Data | ||
public class RegistrySearchRequestDto { | ||
|
||
private int offset; | ||
private int limit; | ||
private Map<String, Map<String, String>> filters; | ||
} |
30 changes: 30 additions & 0 deletions
30
sunbird-rc-plugin/src/test/resources/InsuranceCredential.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
##Here we are injecting DateTool instance from java velocity library to set the expiry date | ||
#set( $defaultLocale = $date.getLocale() ) | ||
#set( $calenderNow = $date.getCalendar() ) | ||
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" ) | ||
## Adding no. of Days we want to set as expiry,here '5' represent Day and '30' represent no. of days | ||
#set( $expiry =$calenderNow.add(5,30)) | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://holashchand.github.io/test_project/insurance-context.json" | ||
], | ||
"type": [ | ||
"VerifiableCredential", | ||
"InsuranceCredential" | ||
], | ||
"issuer": "${issuerId}", | ||
"expirationDate": "${date.format($ISO8601DateTimeWithMillisUTC, $calenderNow, $defaultLocale)}", | ||
"credentialSubject": { | ||
"dob": "${dob}", | ||
"gender": "${gender}", | ||
"mobile": "${mobile}", | ||
"benefits": #if($benefits)$benefits#else#set($benefits = '"[]"') $benefits#end, | ||
"fullName": "${fullName}", | ||
"email": "${email}", | ||
"policyIssuedOn": "${policyIssuedOn}", | ||
"policyExpiresOn": "${policyExpiresOn}", | ||
"policyName": "${policyName}", | ||
"policyNumber": "${policyNumber}" | ||
} | ||
} |