Skip to content

Commit

Permalink
ES-185 ES-90 (#142)
Browse files Browse the repository at this point in the history
* Updated README.md files

* Changed pom version (#134)

Co-authored-by: ase-101 <>

* [DSD-3393] Update init_values.yaml (#135)

Signed-off-by: syed salman <[email protected]>

* ES-90 bug fix (#139)

Co-authored-by: ase-101 <>

* ES-185 (#140)

Co-authored-by: ase-101 <>

* ES-185 (#141)

* ES-185

* ES-185

---------

Signed-off-by: Anusha Sunkada <[email protected]>
Co-authored-by: ase-101 <>

* Changed pom version

---------

Signed-off-by: syed salman <[email protected]>
Signed-off-by: Anusha Sunkada <[email protected]>
Co-authored-by: KONIJETI YASWANTHA NAGARJUNA <[email protected]>
Co-authored-by: anshulv1401 <[email protected]>
Co-authored-by: syed salman <[email protected]>
Co-authored-by: ase-101 <>
  • Loading branch information
4 people authored Sep 19, 2023
1 parent 625e112 commit ea50c87
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
1 change: 1 addition & 0 deletions db_scripts/init_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ databases:
name: postgres-postgresql
key: postgresql-password
dml: 1
branch: develop
2 changes: 1 addition & 1 deletion mock-esignet-integration-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<artifactId>lombok</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>io.mosip.esignet</groupId>
<artifactId>esignet-integration-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.NotImplementedException;
import io.mosip.esignet.api.exception.VCIExchangeException;
import io.mosip.esignet.api.util.ErrorConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
Expand Down Expand Up @@ -50,10 +51,9 @@ public class MockVCIssuancePlugin implements VCIssuancePlugin {

public static final String OIDC_SERVICE_APP_ID = "OIDC_SERVICE";

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public VCResult getVerifiableCredentialWithLinkedDataProof(VCRequestDto vcRequestDto, String holderId,
Map<String, Object> identityDetails) {
public VCResult<JsonLDObject> getVerifiableCredentialWithLinkedDataProof(VCRequestDto vcRequestDto, String holderId,
Map<String, Object> identityDetails) throws VCIExchangeException {
JsonLDObject vcJsonLdObject = null;
try {
VCResult vcResult = new VCResult();
Expand All @@ -64,21 +64,22 @@ public VCResult getVerifiableCredentialWithLinkedDataProof(VCRequestDto vcReques
} catch (Exception e) {
log.error("Failed to build mock VC", e);
}
return null;
throw new VCIExchangeException();
}

private JsonLDObject buildDummyJsonLDWithLDProof(String holderId)
throws IOException, GeneralSecurityException, JsonLDException, URISyntaxException {
Map<String, Object> formattedMap = new HashMap<>();
formattedMap.put("id", holderId);
formattedMap.put("name", "John Doe");
formattedMap.put("age", 30);
formattedMap.put("email", "[email protected]");
formattedMap.put("gender", "Male");

Map<String, Object> verCredJsonObject = new HashMap<>();
verCredJsonObject.put("@context", Arrays.asList("https://www.w3.org/2018/credentials/v1"));
verCredJsonObject.put("type", Arrays.asList("VerifiableCredential"));
verCredJsonObject.put("@context", Arrays.asList("https://www.w3.org/2018/credentials/v1", "https://schema.org/"));
verCredJsonObject.put("type", Arrays.asList("VerifiableCredential", "Person"));
verCredJsonObject.put("id", "urn:uuid:3978344f-8596-4c3a-a978-8fcaba3903c5");
verCredJsonObject.put("issuer", "did:mock:123456789");
verCredJsonObject.put("issuer", "did:example:123456789");
verCredJsonObject.put("issuanceDate", getUTCDateTime());
verCredJsonObject.put("credentialSubject", formattedMap);

Expand Down Expand Up @@ -119,8 +120,8 @@ private static String getUTCDateTime() {

@Override
public VCResult<String> getVerifiableCredential(VCRequestDto vcRequestDto, String holderId,
Map<String, Object> identityDetails) {
throw new NotImplementedException("This method is not implemented");
Map<String, Object> identityDetails) throws VCIExchangeException {
throw new VCIExchangeException(ErrorConstants.NOT_IMPLEMENTED);
}

}
4 changes: 4 additions & 0 deletions mock-relying-party-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ The application run on PORT=8888.
- Env variables

- ESIGNET_SERVICE_URL: MOSIP ESIGNET API URL (Example:http://esignet.esignet/v1/esignet)
- ESIGNET_AUD_URL: MOSIP ESIGNET OAUTH TOKEN URL (Example:http://esignet.esignet/v1/esignet/oauth/token)
- JWE_USERINFO_PRIVATE_KEY: Used for encrypting user information.
- CLIENT_PRIVATE_KEY: Holds private key for authentication and security.
- USERINFO_RESPONSE_TYPE: Response type for user information retrieval.

- Build and run Docker for a service:

Expand Down
13 changes: 12 additions & 1 deletion mock-relying-party-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,23 @@ The application run on PORT=5000 by default.
- CLIENT_ID: Relying Party client Id, that is registered with MOSIP (Example:health-services)
- ACRS: Value that needs to be passed into authorize acr_values parameter (Example:mosip:esignet:acr:generated-code)
- PRIVATE_KEY: Private key corresponding to the public key of registered Relying Party Client
- MAX_AGE: Represents the maximum amount of time, in seconds, that a cached resource should be considered fresh or valid before it needs to be revalidated with the origin server.
(Example:max_age:21)
- DISPLAY: This property specifies how the authorization server should display the authentication and consent page to the end-user.
Possible values are page, popup, wap, touch
(Exapmle: display:page)
- PROMPT: This property specifies the type of prompt to be used during the authentication flow.
(Exapmle: prompt:consent)
- GRANT_TYPE: This property specifies the OAuth 2.0 grant type that the client will use to request access tokens. (Example: grant_type: authorization_code)
- SIGN_IN_BUTTON_PLUGIN_URL: Sign in button url.
- SCOPE_USER_PROFILE: List of scopes that are requested when initiating an authentication request.
(Example: scope_user_profile: openid%20profile%20resident-service)

- Build and run Docker for a service:

```
$ docker build -t <dockerImageName>:<tag> .
$ docker run -it -d -p 5000:5000 -e ESIGNET_UI_BASE_URL='http://localhost:3000' -e MOCK_RELYING_PARTY_BASE_URL=http://localhost:8888 -e REDIRECT_URI=http://localhost:5000/userprofile -e CLIENT_ID=healthservices -e ACRS="mosip:esignet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fdLU22zE0ImN2Y5Jfi0wRJYT+C\nj3q1sORezw65qB/CKwgMnE9Tiu9fHbrlpeb+lIBEnIFiAoPwOOOMzhXzUxOtlT7r\n/v4Dy3MDgwKBgQCtat7Rba+LTCWuHZeDdBd8Eorc4QV644fFlm8kJJSjKKyS21DO\nYvgq7wI/GZZjMUmMwsj+sanNvr+u/x/dCOFb2J7HuDpnacf9aKwUs+DMUldg4ShX\nC9QRuvW1RwSvi33kuPNZkfHMrlzpE3qZJFEh30vmNYKYfoOrGw8sLIfy+QKBgHGU\nTo478vbNq0YzmBH88fOyslOFFnOT6m5nqMO5miFj47io6yTbkAgjaAeV8z8h4k4m\nIN5wJwPT58smmPH3wwRe4hXB7IM4lnd13sGyBox8qowCaAudU3rjO43QklgT5lXB\nO/47k3FSeSIlsDsPS2GwsB4l3zxk6vreEMCE6pALAoGAZ6vITL4uljwBE3Wv+czJ\nEYiOzmnRLK3TwcNx2E1i4gLi8Fj2NUtXAU2BXEa9oW8Zh+b95X0GjgLJamjZi1cH\nU9ByKn/LBzASbvK5q2fLEsOWWigAUKfO6ecmc8MVniS4GJ+WGsUHcsC3usO4clm0\nWxOiTQVUZ7xZxXwy6DOFLFg=\n-----END PRIVATE KEY-----' <dockerImageName>:<tag>
$ docker run -it -d -p 5000:5000 -e ESIGNET_UI_BASE_URL='http://localhost:3000' -e MOCK_RELYING_PARTY_BASE_URL=http://localhost:8888 -e REDIRECT_URI=http://localhost:5000/userprofile -e CLIENT_ID=healthservices -e ACRS="mosip:esignet:acr:static-code" -e MAX_AGE=21 -e DISPLAY=page -e PROMPT=consent -e GRANT_TYPE=authorization_code -e SIGN_IN_BUTTON_PLUGIN_URL='http://127.0.0.1:5500/dist/iife/index.js' -e SCOPE_USER_PROFILE='openid%20profile%20resident-service' -e PRIVATE_KEY='-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCoUPbvrrOxtxAt\nR2rCmSrSjZjyv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LTCWuHZeDdBd8Eorc4QV644fFlm8kJJSjKKyS21DO\nYvgq7wI/GZZjMUmMwsj+sanNvr+u/x/dCOFb2J7HuDpnacf9aKwUs+DMUldg4ShX\nC9QRuvW1RwSvi33kuPNZkfHMrlzpE3qZJFEh30vmNYKYfoOrGw8sLIfy+QKBgHGU\nTo478vbNq0YzmBH88fOyslOFFnOT6m5nqMO5miFj47io6yTbkAgjaAeV8z8h4k4m\nIN5wJwPT58smmPH3wwRe4hXB7IM4lnd13sGyBox8qowCaAudU3rjO43QklgT5lXB\nO/47k3FSeSIlsDsPS2GwsB4l3zxk6vreEMCE6pALAoGAZ6vITL4uljwBE3Wv+czJ\nEYiOzmnRLK3TwcNx2E1i4gLi8Fj2NUtXAU2BXEa9oW8Zh+b95X0GjgLJamjZi1cH\nU9ByKn/LBzASbvK5q2fLEsOWWigAUKfO6ecmc8MVniS4GJ+WGsUHcsC3usO4clm0\nWxOiTQVUZ7xZxXwy6DOFLFg=\n-----END PRIVATE KEY-----' <dockerImageName>:<tag>
```

To host mock relying party ui on a context path:
Expand Down

0 comments on commit ea50c87

Please sign in to comment.