Skip to content

Commit

Permalink
INJIMOB-1578]add ed25519 and es256k support and add logs (mosip#1659)
Browse files Browse the repository at this point in the history
* [INJIMOB-1578]add ecck1 and ed25519 support for signing jwt

Signed-off-by: Abhishek Paul <[email protected]>

* [INJIMOB-1578]add logs and refactor

Signed-off-by: Abhishek Paul <[email protected]>

---------

Signed-off-by: Abhishek Paul <[email protected]>
  • Loading branch information
abhip2565 authored Nov 5, 2024
1 parent 9f34490 commit 1dd0ac8
Show file tree
Hide file tree
Showing 14 changed files with 453 additions and 900 deletions.
30 changes: 14 additions & 16 deletions machines/Issuers/IssuersMachine.typegen.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

// This file was automatically generated. Edits will be overwritten

// This file was automatically generated. Edits will be overwritten

export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
Expand All @@ -12,7 +14,6 @@
"done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]": { type: "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.generateKeyPair:invocation[0]": { type: "done.invoke.issuersMachine.generateKeyPair:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]": { type: "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]": { type: "done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.performAuthorization:invocation[0]": { type: "done.invoke.issuersMachine.performAuthorization:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.storing:invocation[0]": { type: "done.invoke.issuersMachine.storing:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.verifyingCredential:invocation[0]": { type: "done.invoke.issuersMachine.verifyingCredential:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
Expand All @@ -22,7 +23,6 @@
"error.platform.issuersMachine.downloadCredentials:invocation[0]": { type: "error.platform.issuersMachine.downloadCredentials:invocation[0]"; data: unknown };
"error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]": { type: "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]"; data: unknown };
"error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]": { type: "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; data: unknown };
"error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]": { type: "error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]"; data: unknown };
"error.platform.issuersMachine.performAuthorization:invocation[0]": { type: "error.platform.issuersMachine.performAuthorization:invocation[0]"; data: unknown };
"error.platform.issuersMachine.verifyingCredential:invocation[0]": { type: "error.platform.issuersMachine.verifyingCredential:invocation[0]"; data: unknown };
"xstate.init": { type: "xstate.init" };
Expand All @@ -34,7 +34,6 @@
"downloadIssuerWellknown": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]";
"downloadIssuersList": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
"generateKeyPair": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"getKeyOrderList": "done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]";
"getKeyPair": "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]";
"getSelectedKey": "done.invoke.issuersMachine.checkKeyPair:invocation[0]";
"invokeAuthorization": "done.invoke.issuersMachine.performAuthorization:invocation[0]";
Expand All @@ -44,26 +43,26 @@
missingImplementations: {
actions: "downloadIssuerWellknown" | "loadKeyPair" | "logDownloaded" | "resetError" | "resetIsVerified" | "resetLoadingReason" | "resetSelectedCredentialType" | "resetVerificationErrorMessage" | "sendBackupEvent" | "sendDownloadingFailedToVcMeta" | "sendErrorEndEvent" | "sendImpressionEvent" | "sendSuccessEndEvent" | "setCredentialTypeListDownloadFailureError" | "setCredentialWrapper" | "setError" | "setFetchWellknownError" | "setIsVerified" | "setIssuers" | "setLoadingReasonAsDisplayIssuers" | "setLoadingReasonAsDownloadingCredentials" | "setLoadingReasonAsSettingUp" | "setMetadataInCredentialData" | "setNoInternet" | "setOIDCConfigError" | "setPrivateKey" | "setPublicKey" | "setSelectedCredentialType" | "setSelectedIssuerId" | "setSelectedIssuers" | "setSelectedKey" | "setSupportedCredentialTypes" | "setTokenResponse" | "setVCMetadata" | "setVerifiableCredential" | "storeKeyPair" | "storeVcMetaContext" | "storeVcsContext" | "storeVerifiableCredentialData" | "storeVerifiableCredentialMeta" | "updateIssuerFromWellknown" | "updateSelectedIssuerWellknownResponse" | "updateVerificationErrorMessage";
delays: never;
guards: "canSelectIssuerAgain" | "hasKeyPair" | "hasUserCancelledBiometric" | "isCustomSecureKeystore" | "isGenericError" | "isInternetConnected" | "isKeyTypeNotFound" | "isOIDCConfigError" | "isOIDCflowCancelled" | "isSignedIn" | "isVerificationPendingBecauseOfNetworkIssue" | "shouldFetchIssuersAgain";
services: "checkInternet" | "downloadCredential" | "downloadCredentialTypes" | "downloadIssuerWellknown" | "downloadIssuersList" | "generateKeyPair" | "getKeyOrderList" | "getKeyPair" | "getSelectedKey" | "invokeAuthorization" | "isUserSignedAlready" | "verifyCredential";
guards: "canSelectIssuerAgain" | "hasKeyPair" | "hasUserCancelledBiometric" | "isBiometricCancelled" | "isCustomSecureKeystore" | "isGenericError" | "isInternetConnected" | "isOIDCConfigError" | "isOIDCflowCancelled" | "isSignedIn" | "isVerificationPendingBecauseOfNetworkIssue" | "shouldFetchIssuersAgain";
services: "checkInternet" | "downloadCredential" | "downloadCredentialTypes" | "downloadIssuerWellknown" | "downloadIssuersList" | "generateKeyPair" | "getKeyPair" | "getSelectedKey" | "invokeAuthorization" | "isUserSignedAlready" | "verifyCredential";
};
eventsCausingActions: {
"downloadIssuerWellknown": "TRY_AGAIN";
"loadKeyPair": "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]";
"logDownloaded": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"resetError": "RESET_ERROR" | "TRY_AGAIN" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"resetIsVerified": "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"resetLoadingReason": "RESET_ERROR" | "done.invoke.checkInternet" | "done.invoke.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"resetSelectedCredentialType": "CANCEL" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"resetLoadingReason": "RESET_ERROR" | "done.invoke.checkInternet" | "done.invoke.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"resetSelectedCredentialType": "CANCEL" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"resetVerificationErrorMessage": "RESET_VERIFY_ERROR";
"sendBackupEvent": "done.invoke.issuersMachine.storing:invocation[0]";
"sendDownloadingFailedToVcMeta": "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"sendDownloadingFailedToVcMeta": "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"sendErrorEndEvent": "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"sendImpressionEvent": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
"sendSuccessEndEvent": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
"setCredentialTypeListDownloadFailureError": "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]";
"setCredentialWrapper": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
"setError": "error.platform.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"setError": "error.platform.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"setFetchWellknownError": "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]";
"setIsVerified": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
"setIssuers": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
Expand All @@ -78,7 +77,7 @@
"setSelectedCredentialType": "SELECTED_CREDENTIAL_TYPE";
"setSelectedIssuerId": "SELECTED_ISSUER";
"setSelectedIssuers": "SELECTED_ISSUER";
"setSelectedKey": "done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]";
"setSelectedKey": "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"setSupportedCredentialTypes": "done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]";
"setTokenResponse": "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"setVCMetadata": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
Expand All @@ -98,11 +97,11 @@
eventsCausingGuards: {
"canSelectIssuerAgain": "TRY_AGAIN";
"hasKeyPair": "done.invoke.issuersMachine.checkKeyPair:invocation[0]";
"hasUserCancelledBiometric": "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]";
"hasUserCancelledBiometric": "error.platform.issuersMachine.downloadCredentials:invocation[0]";
"isBiometricCancelled": "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]";
"isCustomSecureKeystore": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"isGenericError": "error.platform.issuersMachine.downloadCredentials:invocation[0]";
"isInternetConnected": "done.invoke.checkInternet";
"isKeyTypeNotFound": "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]";
"isOIDCConfigError": "error.platform.issuersMachine.performAuthorization:invocation[0]";
"isOIDCflowCancelled": "error.platform.issuersMachine.performAuthorization:invocation[0]";
"isSignedIn": "done.invoke.issuersMachine.storing:invocation[0]";
Expand All @@ -116,15 +115,14 @@
"downloadIssuerWellknown": "SELECTED_ISSUER" | "TRY_AGAIN";
"downloadIssuersList": "CANCEL" | "TRY_AGAIN" | "xstate.init";
"generateKeyPair": "done.invoke.issuersMachine.checkKeyPair:invocation[0]";
"getKeyOrderList": "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"getKeyPair": "TRY_AGAIN" | "done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]";
"getKeyPair": "TRY_AGAIN" | "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"getSelectedKey": "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]";
"invokeAuthorization": "done.invoke.checkInternet";
"isUserSignedAlready": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"verifyCredential": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
};
matchesStates: "checkInternet" | "checkKeyPair" | "displayIssuers" | "done" | "downloadCredentialTypes" | "downloadCredentials" | "downloadCredentials.idle" | "downloadCredentials.userCancelledBiometric" | "downloadIssuerWellknown" | "error" | "generateKeyPair" | "handleVCVerificationFailure" | "idle" | "performAuthorization" | "performAuthorization.getKeyPairFromKeystore" | "performAuthorization.idle" | "performAuthorization.setSelectedKey" | "performAuthorization.userCancelledBiometric" | "selectingCredentialType" | "selectingIssuer" | "storing" | "verifyingCredential" | { "downloadCredentials"?: "idle" | "userCancelledBiometric";
"performAuthorization"?: "getKeyPairFromKeystore" | "idle" | "setSelectedKey" | "userCancelledBiometric"; };
matchesStates: "checkInternet" | "checkKeyPair" | "displayIssuers" | "done" | "downloadCredentialTypes" | "downloadCredentials" | "downloadCredentials.idle" | "downloadCredentials.userCancelledBiometric" | "downloadIssuerWellknown" | "error" | "generateKeyPair" | "handleVCVerificationFailure" | "idle" | "performAuthorization" | "performAuthorization.getKeyPairFromKeystore" | "performAuthorization.idle" | "performAuthorization.userCancelledBiometric" | "selectingCredentialType" | "selectingIssuer" | "storing" | "verifyingCredential" | { "downloadCredentials"?: "idle" | "userCancelledBiometric";
"performAuthorization"?: "getKeyPairFromKeystore" | "idle" | "userCancelledBiometric"; };
tags: never;
}

3 changes: 2 additions & 1 deletion machines/QrLogin/QrLoginMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,12 @@ export const qrLoginMachine =
},
success: {
entry: [
() =>
(context) =>
sendEndEvent(
getEndEventData(
TelemetryConstants.FlowType.qrLogin,
TelemetryConstants.EndEventStatus.success,
{"Keytype for QrLogin":context.selectedVc.vcMetadata.downloadKeyType}
),
),
],
Expand Down
Loading

0 comments on commit 1dd0ac8

Please sign in to comment.