[INJIMOB-1884] remove SetupKeySelectionScreen (#1632)

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
abhip2565
2024-09-30 17:06:11 +05:30
committed by GitHub
parent fed858eb04
commit 13c3941bfc
12 changed files with 262 additions and 724 deletions

View File

@@ -1,357 +1,130 @@
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
'done.invoke.checkInternet': {
type: 'done.invoke.checkInternet';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.checkKeyPair:invocation[0]': {
type: 'done.invoke.issuersMachine.checkKeyPair:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.displayIssuers:invocation[0]': {
type: 'done.invoke.issuersMachine.displayIssuers:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]': {
type: 'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.downloadCredentials:invocation[0]': {
type: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'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.';
};
'error.platform.checkInternet': {
type: 'error.platform.checkInternet';
data: unknown;
};
'error.platform.issuersMachine.displayIssuers:invocation[0]': {
type: 'error.platform.issuersMachine.displayIssuers:invocation[0]';
data: unknown;
};
'error.platform.issuersMachine.downloadCredentialTypes:invocation[0]': {
type: 'error.platform.issuersMachine.downloadCredentialTypes:invocation[0]';
data: unknown;
};
'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'};
};
invokeSrcNameMap: {
checkInternet: 'done.invoke.checkInternet';
downloadCredential: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]';
downloadCredentialTypes: 'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]';
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]';
isUserSignedAlready: 'done.invoke.issuersMachine.storing:invocation[0]';
verifyCredential: 'done.invoke.issuersMachine.verifyingCredential:invocation[0]';
};
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';
};
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]';
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]';
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]';
setFetchWellknownError: 'error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]';
setIsVerified: 'done.invoke.issuersMachine.verifyingCredential:invocation[0]';
setIssuers: 'done.invoke.issuersMachine.displayIssuers:invocation[0]';
setLoadingReasonAsDisplayIssuers: 'TRY_AGAIN';
setLoadingReasonAsDownloadingCredentials:
| 'TRY_AGAIN'
| 'done.invoke.issuersMachine.generateKeyPair:invocation[0]'
| 'done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]'
| 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]';
setLoadingReasonAsSettingUp:
| 'SELECTED_ISSUER'
| 'TRY_AGAIN'
| 'done.invoke.issuersMachine.performAuthorization:invocation[0]';
setMetadataInCredentialData:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
setNoInternet: 'done.invoke.checkInternet';
setOIDCConfigError: 'error.platform.issuersMachine.performAuthorization:invocation[0]';
setPrivateKey: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
setPublicKey: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
setSelectedCredentialType: 'SELECTED_CREDENTIAL_TYPE';
setSelectedIssuerId: 'SELECTED_ISSUER';
setSelectedIssuers: 'SELECTED_ISSUER';
setSelectedKey: 'done.invoke.issuersMachine.performAuthorization.setSelectedKey: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]';
setVerifiableCredential: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]';
storeKeyPair: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
storeVcMetaContext:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
storeVcsContext:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
storeVerifiableCredentialData:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
storeVerifiableCredentialMeta:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
updateIssuerFromWellknown: 'done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]';
updateSelectedIssuerWellknownResponse: 'done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]';
updateVerificationErrorMessage: 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
};
eventsCausingDelays: {};
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]';
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]';
isVerificationPendingBecauseOfNetworkIssue: 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
shouldFetchIssuersAgain: 'TRY_AGAIN';
};
eventsCausingServices: {
checkInternet:
| 'SELECTED_CREDENTIAL_TYPE'
| 'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]';
downloadCredential:
| 'done.invoke.issuersMachine.checkKeyPair:invocation[0]'
| 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
downloadCredentialTypes: 'done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]';
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]';
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';
};
tags: never;
}
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
"done.invoke.checkInternet": { type: "done.invoke.checkInternet"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.checkKeyPair:invocation[0]": { type: "done.invoke.issuersMachine.checkKeyPair:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.displayIssuers:invocation[0]": { type: "done.invoke.issuersMachine.displayIssuers:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]": { type: "done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.downloadCredentials:invocation[0]": { type: "done.invoke.issuersMachine.downloadCredentials:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"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." };
"error.platform.checkInternet": { type: "error.platform.checkInternet"; data: unknown };
"error.platform.issuersMachine.displayIssuers:invocation[0]": { type: "error.platform.issuersMachine.displayIssuers:invocation[0]"; data: unknown };
"error.platform.issuersMachine.downloadCredentialTypes:invocation[0]": { type: "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]"; data: unknown };
"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" };
};
invokeSrcNameMap: {
"checkInternet": "done.invoke.checkInternet";
"downloadCredential": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
"downloadCredentialTypes": "done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]";
"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]";
"isUserSignedAlready": "done.invoke.issuersMachine.storing:invocation[0]";
"verifyCredential": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
};
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";
};
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]";
"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]";
"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]";
"setFetchWellknownError": "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]";
"setIsVerified": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
"setIssuers": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
"setLoadingReasonAsDisplayIssuers": "TRY_AGAIN";
"setLoadingReasonAsDownloadingCredentials": "TRY_AGAIN" | "done.invoke.issuersMachine.generateKeyPair:invocation[0]" | "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]";
"setLoadingReasonAsSettingUp": "SELECTED_ISSUER" | "TRY_AGAIN" | "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"setMetadataInCredentialData": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"setNoInternet": "done.invoke.checkInternet";
"setOIDCConfigError": "error.platform.issuersMachine.performAuthorization:invocation[0]";
"setPrivateKey": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"setPublicKey": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"setSelectedCredentialType": "SELECTED_CREDENTIAL_TYPE";
"setSelectedIssuerId": "SELECTED_ISSUER";
"setSelectedIssuers": "SELECTED_ISSUER";
"setSelectedKey": "done.invoke.issuersMachine.performAuthorization.setSelectedKey: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]";
"setVerifiableCredential": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
"storeKeyPair": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"storeVcMetaContext": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"storeVcsContext": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"storeVerifiableCredentialData": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"storeVerifiableCredentialMeta": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"updateIssuerFromWellknown": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]";
"updateSelectedIssuerWellknownResponse": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]";
"updateVerificationErrorMessage": "error.platform.issuersMachine.verifyingCredential:invocation[0]";
};
eventsCausingDelays: {
};
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]";
"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]";
"isVerificationPendingBecauseOfNetworkIssue": "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"shouldFetchIssuersAgain": "TRY_AGAIN";
};
eventsCausingServices: {
"checkInternet": "SELECTED_CREDENTIAL_TYPE" | "done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]";
"downloadCredential": "done.invoke.issuersMachine.checkKeyPair:invocation[0]" | "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"downloadCredentialTypes": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]";
"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]";
"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"; };
tags: never;
}

View File

@@ -35,7 +35,7 @@ import {
} from './VerifiableCredential/VCMetaMachine/VCMetaMachine';
import {
checkAllKeyPairs,
generateKeyPairsAndStore,
generateKeyPairsAndStoreOrder,
} from '../shared/cryptoutil/cryptoUtil';
const QrLoginIntent = NativeModules.QrLoginIntent;
@@ -139,7 +139,7 @@ export const appMachine = model.createMachine(
},
generateKeyPairs: {
invoke: {
src: 'generateKeyPairsAndStore',
src: 'generateKeyPairsAndStoreOrder',
onDone: [
{
target: 'checkKeyPairs',
@@ -467,8 +467,8 @@ export const appMachine = model.createMachine(
return await checkAllKeyPairs();
},
generateKeyPairsAndStore: async () => {
return await generateKeyPairsAndStore();
generateKeyPairsAndStoreOrder: async () => {
return await generateKeyPairsAndStoreOrder();
},
checkNetworkState: () => callback => {
return NetInfo.addEventListener(state => {

View File

@@ -1,117 +0,0 @@
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
'done.invoke.app.init.checkKeyPairs:invocation[0]': {
type: 'done.invoke.app.init.checkKeyPairs:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.app.init.generateKeyPairs:invocation[0]': {
type: 'done.invoke.app.init.generateKeyPairs:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.app.ready.focus.active:invocation[0]': {
type: 'done.invoke.app.ready.focus.active:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'error.platform.app.init.checkKeyPairs:invocation[0]': {
type: 'error.platform.app.init.checkKeyPairs:invocation[0]';
data: unknown;
};
'xstate.init': {type: 'xstate.init'};
};
invokeSrcNameMap: {
checkFocusState: 'done.invoke.app.ready.focus:invocation[0]';
checkKeyPairs: 'done.invoke.app.init.checkKeyPairs:invocation[0]';
checkNetworkState: 'done.invoke.app.ready.network:invocation[0]';
generateKeyPairsAndStore: 'done.invoke.app.init.generateKeyPairs:invocation[0]';
getAppInfo: 'done.invoke.app.init.info:invocation[0]';
isQrLoginByDeepLink: 'done.invoke.app.ready.focus.active:invocation[0]';
resetQRLoginDeepLinkData: 'done.invoke.app.ready.focus.active:invocation[1]';
};
missingImplementations: {
actions: 'forwardToServices';
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
forwardToServices: 'ACTIVE' | 'INACTIVE' | 'OFFLINE' | 'ONLINE';
loadCredentialRegistryHostFromStorage: 'READY';
loadCredentialRegistryInConstants: 'STORE_RESPONSE';
loadEsignetHostFromConstants: 'STORE_RESPONSE';
loadEsignetHostFromStorage: 'READY';
logServiceEvents: 'done.invoke.app.init.checkKeyPairs:invocation[0]';
logStoreEvents:
| 'KEY_INVALIDATE_ERROR'
| 'RESET_KEY_INVALIDATE_ERROR_DISMISS'
| 'xstate.init';
requestDeviceInfo: 'REQUEST_DEVICE_INFO';
resetKeyInvalidateError: 'READY' | 'RESET_KEY_INVALIDATE_ERROR_DISMISS';
resetLinkCode: 'RESET_LINKCODE';
setAppInfo: 'APP_INFO_RECEIVED';
setIsDecryptError: 'DECRYPT_ERROR';
setIsReadError: 'ERROR';
setLinkCode: 'done.invoke.app.ready.focus.active:invocation[0]';
spawnServiceActors: 'done.invoke.app.init.checkKeyPairs:invocation[0]';
spawnStoreActor:
| 'KEY_INVALIDATE_ERROR'
| 'RESET_KEY_INVALIDATE_ERROR_DISMISS'
| 'xstate.init';
unsetIsDecryptError: 'DECRYPT_ERROR_DISMISS' | 'READY';
unsetIsReadError: 'READY';
updateKeyInvalidateError: 'ERROR' | 'KEY_INVALIDATE_ERROR';
};
eventsCausingDelays: {};
eventsCausingGuards: {};
eventsCausingServices: {
checkFocusState: 'APP_INFO_RECEIVED';
checkKeyPairs:
| 'READY'
| 'done.invoke.app.init.generateKeyPairs:invocation[0]';
checkNetworkState: 'APP_INFO_RECEIVED';
generateKeyPairsAndStore: 'error.platform.app.init.checkKeyPairs:invocation[0]';
getAppInfo: 'STORE_RESPONSE';
isQrLoginByDeepLink: 'ACTIVE';
resetQRLoginDeepLinkData: 'ACTIVE';
};
matchesStates:
| 'init'
| 'init.checkKeyPairs'
| 'init.credentialRegistry'
| 'init.generateKeyPairs'
| 'init.info'
| 'init.services'
| 'init.store'
| 'ready'
| 'ready.focus'
| 'ready.focus.active'
| 'ready.focus.checking'
| 'ready.focus.inactive'
| 'ready.network'
| 'ready.network.checking'
| 'ready.network.offline'
| 'ready.network.online'
| 'waiting'
| {
init?:
| 'checkKeyPairs'
| 'credentialRegistry'
| 'generateKeyPairs'
| 'info'
| 'services'
| 'store';
ready?:
| 'focus'
| 'network'
| {
focus?: 'active' | 'checking' | 'inactive';
network?: 'checking' | 'offline' | 'online';
};
};
tags: never;
}

View File

@@ -12,7 +12,6 @@ const model = createModel(
passcode: '',
passcodeSalt: '',
biometrics: '',
keySetup: false,
canUseBiometrics: false,
selectLanguage: false,
toggleFromSettings: false,
@@ -88,7 +87,6 @@ export const authMachine = model.createMachine(
checkingAuth: {
always: [
{cond: 'hasLanguageset', target: 'languagesetup'},
{cond: 'hasKeySetup', target: 'keySetup'},
{cond: 'hasPasscodeSet', target: 'unauthorized'},
{cond: 'hasBiometricSet', target: 'unauthorized'},
{target: 'settingUp'},
@@ -97,14 +95,6 @@ export const authMachine = model.createMachine(
languagesetup: {
on: {
SELECT: {
target: 'keySetup',
},
},
},
keySetup: {
on: {
SELECT: {
actions: 'setKeySetup',
target: 'introSlider',
},
},
@@ -165,10 +155,6 @@ export const authMachine = model.createMachine(
to: context => context.serviceRefs.store,
}),
setKeySetup: model.assign({
keySetup: true,
}),
setIsToggleFromSettings: assign({
toggleFromSettings: (_, event) => event.isToggleFromSettings,
}),
@@ -230,7 +216,6 @@ export const authMachine = model.createMachine(
},
guards: {
hasKeySetup: (context, event: any) => !context.keySetup,
hasData: (_, event: StoreResponseEvent) => event.response != null,
hasPasscodeSet: context => {

View File

@@ -1,73 +1,51 @@
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
'': {type: ''};
'done.invoke.auth.authorized:invocation[0]': {
type: 'done.invoke.auth.authorized:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.auth.introSlider:invocation[0]': {
type: 'done.invoke.auth.introSlider:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'xstate.init': {type: 'xstate.init'};
};
invokeSrcNameMap: {
downloadFaceSdkModel: 'done.invoke.auth.authorized:invocation[0]';
generatePasscodeSalt: 'done.invoke.auth.introSlider:invocation[0]';
};
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
requestStoredContext: 'xstate.init';
setBiometrics: 'SETUP_BIOMETRICS';
setContext: 'STORE_RESPONSE';
setInitialDownloadDone: 'INITIAL_DOWNLOAD_DONE';
setIsToggleFromSettings: 'CHANGE_METHOD';
setKeySetup: 'SELECT';
setLanguage: 'SETUP_BIOMETRICS' | 'SETUP_PASSCODE';
setOnboardingDone: 'ONBOARDING_DONE';
setPasscode: 'SETUP_PASSCODE';
setPasscodeSalt: 'done.invoke.auth.introSlider:invocation[0]';
setTourGuide: 'SET_TOUR_GUIDE';
storeContext:
| 'INITIAL_DOWNLOAD_DONE'
| 'ONBOARDING_DONE'
| 'SETUP_BIOMETRICS'
| 'SETUP_PASSCODE'
| 'STORE_RESPONSE'
| 'done.invoke.auth.authorized:invocation[0]'
| 'done.invoke.auth.introSlider:invocation[0]';
};
eventsCausingDelays: {};
eventsCausingGuards: {
hasBiometricSet: '';
hasData: 'STORE_RESPONSE';
hasKeySetup: '';
hasLanguageset: '';
hasPasscodeSet: '';
};
eventsCausingServices: {
downloadFaceSdkModel: 'LOGIN' | 'SETUP_BIOMETRICS' | 'SETUP_PASSCODE';
generatePasscodeSalt: 'SELECT';
};
matchesStates:
| 'authorized'
| 'checkingAuth'
| 'init'
| 'introSlider'
| 'keySetup'
| 'languagesetup'
| 'savingDefaults'
| 'settingUp'
| 'unauthorized';
tags: never;
}
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
"": { type: "" };
"done.invoke.auth.authorized:invocation[0]": { type: "done.invoke.auth.authorized:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.auth.introSlider:invocation[0]": { type: "done.invoke.auth.introSlider:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"xstate.init": { type: "xstate.init" };
};
invokeSrcNameMap: {
"downloadFaceSdkModel": "done.invoke.auth.authorized:invocation[0]";
"generatePasscodeSalt": "done.invoke.auth.introSlider:invocation[0]";
};
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
"requestStoredContext": "xstate.init";
"setBiometrics": "SETUP_BIOMETRICS";
"setContext": "STORE_RESPONSE";
"setInitialDownloadDone": "INITIAL_DOWNLOAD_DONE";
"setIsToggleFromSettings": "CHANGE_METHOD";
"setLanguage": "SETUP_BIOMETRICS" | "SETUP_PASSCODE";
"setOnboardingDone": "ONBOARDING_DONE";
"setPasscode": "SETUP_PASSCODE";
"setPasscodeSalt": "done.invoke.auth.introSlider:invocation[0]";
"setTourGuide": "SET_TOUR_GUIDE";
"storeContext": "INITIAL_DOWNLOAD_DONE" | "ONBOARDING_DONE" | "SETUP_BIOMETRICS" | "SETUP_PASSCODE" | "STORE_RESPONSE" | "done.invoke.auth.authorized:invocation[0]" | "done.invoke.auth.introSlider:invocation[0]";
};
eventsCausingDelays: {
};
eventsCausingGuards: {
"hasBiometricSet": "";
"hasData": "STORE_RESPONSE";
"hasLanguageset": "";
"hasPasscodeSet": "";
};
eventsCausingServices: {
"downloadFaceSdkModel": "LOGIN" | "SETUP_BIOMETRICS" | "SETUP_PASSCODE";
"generatePasscodeSalt": "SELECT";
};
matchesStates: "authorized" | "checkingAuth" | "init" | "introSlider" | "languagesetup" | "savingDefaults" | "settingUp" | "unauthorized";
tags: never;
}

View File

@@ -0,0 +1,57 @@
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
"done.invoke.settings.resetInjiProps:invocation[0]": { type: "done.invoke.settings.resetInjiProps:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"error.platform.settings.resetInjiProps:invocation[0]": { type: "error.platform.settings.resetInjiProps:invocation[0]"; data: unknown };
"xstate.init": { type: "xstate.init" };
};
invokeSrcNameMap: {
"resetInjiProps": "done.invoke.settings.resetInjiProps:invocation[0]";
};
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
"requestStoredContext": "xstate.init";
"resetCredentialRegistryResponse": "CANCEL" | "UPDATE_HOST";
"resetIsBiometricToggled": "DISMISS";
"resetKeyOrderingResponse": "RESET_KEY_ORDER_RESPONSE";
"setBackupAndRestoreOptionExplored": "SET_IS_BACKUP_AND_RESTORE_EXPLORED";
"setContext": "STORE_RESPONSE";
"setIsBiometricToggled": "TOGGLE_BIOMETRIC_UNLOCK";
"setKeyManagementExplored": "SET_KEY_MANAGEMENT_EXPLORED";
"setKeyManagementTourGuideExplored": "SET_KEY_MANAGEMENT_TOUR_GUIDE_EXPLORED";
"setKeyOrderingResponse": "SET_KEY_ORDER_RESPONSE";
"storeContext": "ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS" | "SET_IS_BACKUP_AND_RESTORE_EXPLORED" | "SET_KEY_MANAGEMENT_EXPLORED" | "SHOWN_ACCOUNT_SELECTION_CONFIRMATION" | "STORE_RESPONSE" | "TOGGLE_BIOMETRIC_UNLOCK" | "UPDATE_HOST" | "UPDATE_NAME" | "UPDATE_VC_LABEL" | "done.invoke.settings.resetInjiProps:invocation[0]";
"toggleBiometricUnlock": "TOGGLE_BIOMETRIC_UNLOCK";
"updateCredentialRegistry": "done.invoke.settings.resetInjiProps:invocation[0]";
"updateCredentialRegistryResponse": "error.platform.settings.resetInjiProps:invocation[0]";
"updateCredentialRegistrySuccess": "done.invoke.settings.resetInjiProps:invocation[0]";
"updateDefaults": "STORE_RESPONSE";
"updateEsignetHostUrl": "UPDATE_HOST";
"updateIsAccountSelectionConfirmationShown": "SHOWN_ACCOUNT_SELECTION_CONFIRMATION";
"updateName": "UPDATE_NAME";
"updatePartialDefaults": "STORE_RESPONSE";
"updateUserShownWithHardwareKeystoreNotExists": "ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS";
"updateVcLabel": "UPDATE_VC_LABEL";
};
eventsCausingDelays: {
};
eventsCausingGuards: {
"hasData": "STORE_RESPONSE";
"hasPartialData": "STORE_RESPONSE";
};
eventsCausingServices: {
"resetInjiProps": "UPDATE_HOST";
};
matchesStates: "idle" | "init" | "resetInjiProps" | "showInjiTourGuide" | "storingDefaults";
tags: never;
}

View File

@@ -14,7 +14,6 @@ import {IntroSlidersScreen} from '../screens/Home/IntroSlidersScreen';
import {RequestLayout} from '../screens/Request/RequestLayout';
import {SplashScreen} from '../screens/SplashScreen';
import {RequestStackParamList} from './routesConstants';
import {SetupKeySelectionScreen} from '../screens/SetupKeySelectionScreen';
import {KeyManagementScreen} from '../screens/Settings/KeyManagementScreen';
export const baseRoutes: Screen[] = [
@@ -36,10 +35,6 @@ export const baseRoutes: Screen[] = [
headerShown: false,
},
},
{
name: 'KeySetup',
component: SetupKeySelectionScreen,
},
{
name: 'IntroSliders',
component: IntroSlidersScreen,

View File

@@ -3,10 +3,9 @@ import {useTranslation} from 'react-i18next';
import {NativeModules, TouchableOpacity, BackHandler, View} from 'react-native';
import DragList from 'react-native-draglist';
import {ListItem, Icon} from 'react-native-elements';
import {Row, Text, Button} from '../../components/ui';
import {Text, Button} from '../../components/ui';
import {Theme} from '../../components/ui/styleUtils';
import {HelpScreen} from '../../components/HelpScreen';
import {SvgImage} from '../../components/ui/svg';
import {BannerNotificationContainer} from '../../components/BannerNotificationContainer';
import {BackButton} from '../../components/ui/backButton/BackButton';
import {Copilot} from '../../components/ui/Copilot';

View File

@@ -1,150 +0,0 @@
import React, {useEffect, useState} from 'react';
import {useTranslation} from 'react-i18next';
import {Button, Column, Row} from '../components/ui';
import {Theme} from '../components/ui/styleUtils';
import {Icon, ListItem} from 'react-native-elements';
import {RootRouteProps} from '../routes';
import {useWelcomeScreen} from './WelcomeScreenController';
import {
BackHandler,
Dimensions,
NativeModules,
TouchableOpacity,
View,
} from 'react-native';
import {useBackupRestoreScreen} from './Settings/BackupRestoreController';
import DragList from 'react-native-draglist';
import {Text} from '../components/ui';
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
import {
sendEndEvent,
getEndEventData,
} from '../shared/telemetry/TelemetryUtils';
import {SUPPORTED_KEY_TYPES} from '../shared/constants';
export const SetupKeySelectionScreen: React.FC<RootRouteProps> = props => {
const {RNSecureKeystoreModule} = NativeModules;
const {t} = useTranslation('SetupKey');
const controller = useWelcomeScreen(props);
const backupRestoreController = useBackupRestoreScreen();
const keys = Object.entries(SUPPORTED_KEY_TYPES).map(([label, value]) => ({
label,
value,
}));
const [keyOrder, setKeyOrder] = useState(keys);
const renderItem = ({item, onDragStart, onDragEnd}) => {
return (
<TouchableOpacity onLongPress={onDragStart} onPressOut={onDragEnd}>
<ListItem bottomDivider topDivider>
<ListItem.Title style={Theme.KeyManagementScreenStyle.listItemTitle}>
<Text testID={item.label} weight="regular">
{item.label}
</Text>
</ListItem.Title>
<ListItem.Content />
<Icon name="drag-handle" color={Theme.Colors.GrayIcon} />
</ListItem>
</TouchableOpacity>
);
};
const handleReorder = (fromIndex, toIndex) => {
const newData = [...keyOrder];
const item = newData.splice(fromIndex, 1)[0];
newData.splice(toIndex, 0, item);
setKeyOrder(newData);
};
const convertToKeyValue = items => {
const result = {};
items.forEach((item, index) => {
result[index] = item.value;
});
return result;
};
useEffect(() => {
backupRestoreController.DOWNLOAD_UNSYNCED_BACKUP_FILES();
}, []);
useEffect(() => {
const backAction = () => {
BackHandler.exitApp();
return true;
};
const backHandler = BackHandler.addEventListener(
'hardwareBackPress',
backAction,
);
return () => backHandler.remove();
}, []);
return (
<Column style={Theme.SetupLanguageScreenStyle.columnStyle}>
<Icon name="vpn-key" type="outline" color={Theme.Colors.Icon} size={80} />
<Column crossAlign="center" width={Dimensions.get('window').width * 0.8}>
<Text
testID="chooseKey"
style={Theme.KeyManagementScreenStyle.listItemTitle}
margin="10 0 10 0"
weight="semibold">
{t('header')}
</Text>
<Text
weight="semibold"
style={Theme.KeyManagementScreenStyle.listItemTitle}
align="center"
color={Theme.Colors.GrayText}>
{t('description')}
</Text>
</Column>
<View style={Theme.KeyManagementScreenStyle.dragViewStyle}>
<DragList
testID="keyList"
scrollEnabled={false}
data={keyOrder}
renderItem={renderItem}
keyExtractor={item => item.value}
onReordered={handleReorder}
/>
</View>
<Column>
<Button
testID="saveKeyPreferenceSetup"
type="gradient"
title={t('save')}
onPress={async () => {
const keyOrderMap = convertToKeyValue(keyOrder);
await RNSecureKeystoreModule.storeData(
'keyPreference',
JSON.stringify(keyOrderMap),
);
sendEndEvent(
getEndEventData(
TelemetryConstants.FlowType.setKeyPriority,
TelemetryConstants.EndEventStatus.success,
),
);
controller.SELECT('IntroSliders'), controller.unlockPage;
}}
/>
<Button
testID="skipKeySelection"
type="clear"
title={t('skip')}
onPress={async () => {
const defaultKeyOrderMap = convertToKeyValue(keys);
await RNSecureKeystoreModule.storeData(
'keyPreference',
JSON.stringify(defaultKeyOrderMap),
);
controller.SELECT('IntroSliders'), controller.unlockPage;
}}
/>
</Column>
</Column>
);
};

View File

@@ -74,7 +74,7 @@ export const SetupLanguageScreen: React.FC<RootRouteProps> = props => {
type="gradient"
title={t('save')}
onPress={() => {
controller.SELECT('KeySetup'), controller.unlockPage;
controller.SELECT(), controller.unlockPage;
}}
/>
</Column>

View File

@@ -46,7 +46,8 @@ export function useWelcomeScreen(props: RootRouteProps) {
authService.send(AuthEvents.NEXT()), props.navigation.navigate('Auth');
},
SELECT: (screen: any) => {
authService.send(AuthEvents.SELECT()), props.navigation.navigate(screen);
authService.send(AuthEvents.SELECT()),
props.navigation.navigate('IntroSliders');
},
BACK: () => {
settingsService.send(SettingsEvents.BACK()),

View File

@@ -4,6 +4,7 @@ import jose from 'node-jose';
import {
BIOMETRIC_CANCELLED,
DEBUG_MODE_ENABLED,
SUPPORTED_KEY_TYPES,
isAndroid,
isIOS,
} from '../constants';
@@ -127,12 +128,21 @@ export async function checkAllKeyPairs() {
throw Error('Keys not present');
}
export async function generateKeyPairsAndStore() {
export async function generateKeyPairsAndStoreOrder() {
const {RNSecureKeystoreModule} = NativeModules;
const RSAKeyPair = await generateKeyPair(KeyTypes.RS256);
const ECR1KeyPair = await generateKeyPair(KeyTypes.ES256);
const ECK1KeyPair = await generateKeyPair(KeyTypes.ES256K);
//const EDKeyPair = generateKeyPair(KeyTypes.ED25519);
const keys = Object.entries(SUPPORTED_KEY_TYPES).map(([label, value]) => ({
label,
value,
}));
const keyOrderMap = convertToKeyValue(keys);
await RNSecureKeystoreModule.storeData(
'keyPreference',
JSON.stringify(keyOrderMap),
);
await RNSecureKeystoreModule.storeGenericKey(
ECK1KeyPair.publicKey,
ECK1KeyPair.privateKey,
@@ -441,3 +451,10 @@ export async function fetchKeyPair(keyType: any) {
};
}
}
const convertToKeyValue = items => {
const result = {};
items.forEach((item, index) => {
result[index] = item.value;
});
return result;
};