diff --git a/.talismanrc b/.talismanrc index bae6896481..23d775646d 100644 --- a/.talismanrc +++ b/.talismanrc @@ -363,7 +363,7 @@ fileignoreconfig: - filename: android/app/src/main/AndroidManifest.xml checksum: 8f4bd61770b8bb0a28859ca0f3b4b095aed4e3fb5adef435cb74b9389ff13e09 - filename: ios/Inji.xcworkspace/xcshareddata/swiftpm/Package.resolved - checksum: f20299bbbc14f44eb69e0f81aed50cf10ff4d9eab04cd05ac54855c07bf449ed + checksum: 1f5cf15c5093ec6d873a60bf8e7a19288d7f77707bf1b2f08a1c371c08fcf47b - filename: ios/Inji.xcodeproj/project.pbxproj checksum: 6e83472f832f71f75aa82ed06eb677d865195755074144e4bf832d6adb30e959 - filename: screens/Settings/ReceivedCardsModal.tsx diff --git a/ios/Inji.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Inji.xcworkspace/xcshareddata/swiftpm/Package.resolved index 64621a5922..669aadb85c 100644 --- a/ios/Inji.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Inji.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -34,7 +34,7 @@ "location" : "https://github.com/mosip/inji-openid4vp-ios-swift", "state" : { "branch" : "release-0.1.x", - "revision" : "cd96f2e819c3d4b543160b0700c74fa4049b9710" + "revision" : "258ff0da26571f090d3a2296212458737eff365f" } }, { @@ -81,6 +81,15 @@ "branch" : "release-0.5.x", "revision" : "2d49e123f70dfc2179983a753d370cc2212385db" } + }, + { + "identity" : "zipfoundation", + "kind" : "remoteSourceControl", + "location" : "https://github.com/weichsel/ZIPFoundation.git", + "state" : { + "revision" : "02b6abe5f6eef7e3cbd5f247c5cc24e246efcfe0", + "version" : "0.9.19" + } } ], "version" : 2 diff --git a/locales/ara.json b/locales/ara.json index 13babc254d..4057c366f5 100644 --- a/locales/ara.json +++ b/locales/ara.json @@ -835,14 +835,14 @@ } }, "SendVPScreen": { - "requester": "الطالب", + "requester": "جهة التحقق", "cardsSelected": "البطاقات المختارة", "cardSelected": "card selected", "unCheck": "البطاقة مختارة", "checkAll": "تحقق من الكل", "consentDialog": { "title": "الموافقة مطلوبة", - "message": "نحن نطلب موافقتك على مشاركة بيانات الاعتماد الخاصة بك التي يمكن التحقق منها. وهذا سيمكننا من التحقق من هويتك وتلبية طلبات الخدمة الخاصة بك. اختر \"نعم، متابعة\" للموافقة أو \"رفض\" إذا كنت لا ترغب في المشاركة.", + "message": "نحن نطلب موافقتك على مشاركة بيانات اعتمادك التي يمكن التحقق منها مع {{verifierName}}. وهذا سيمكننا من التحقق من هويتك وتلبية طلبات الخدمة الخاصة بك. اختر \"نعم، متابعة\" للموافقة أو \"رفض\" إذا كنت لا ترغب في مشاركة بيانات الاعتماد الخاصة بك مع {{verifierName}}.", "confirmButton": "نعم، تابع", "cancelButton": "انخفاض" }, diff --git a/locales/en.json b/locales/en.json index cda1b16375..1890419717 100644 --- a/locales/en.json +++ b/locales/en.json @@ -847,14 +847,14 @@ } }, "SendVPScreen": { - "requester": "Requester", + "requester": "Verification Entity", "cardsSelected": "cards selected", "cardSelected": "card selected", "unCheck": "Uncheck", "checkAll": "Check All", "consentDialog": { "title": "Consent Required", - "message": "We require your consent to share your verifiable credentials. This will enable us to verify your identity and fulfil your service requests. Choose \"Yes, Proceed\" to consent or \"Decline\" if you do not wish to share.", + "message": "We require your consent to share your verifiable credentials with {{verifierName}}. This will enable us to verify your identity and fulfil your service requests. Choose \"Yes, Proceed\" to consent or \"Decline\" if you do not wish to share your credentials with {{verifierName}}.", "confirmButton": "Yes, Proceed", "cancelButton": "Decline" }, diff --git a/locales/fil.json b/locales/fil.json index 4bc4ce691f..81a9e919c0 100644 --- a/locales/fil.json +++ b/locales/fil.json @@ -838,14 +838,14 @@ } }, "SendVPScreen": { - "requester": "Humihiling", + "requester": "Entity ng Pagpapatunay", "cardsSelected": "mga card na napili", "cardSelected": "card pinili", "unCheck": "Alisin ang check", "checkAll": "Suriin Lahat", "consentDialog": { "title": "Kinakailangan ang Pahintulot", - "message": "Hinihiling namin ang iyong pahintulot na ibahagi ang iyong mga nabe-verify na kredensyal. Ito ay magbibigay-daan sa amin na i-verify ang iyong pagkakakilanlan at matupad ang iyong mga kahilingan sa serbisyo. Piliin ang \"Oo, Magpatuloy\" sa pagsang-ayon o \"Tanggihan\" kung ayaw mong ibahagi.", + "message": "Hinihiling namin ang iyong pahintulot na ibahagi ang iyong mga nabe-verify na kredensyal sa {{verifierName}}. Ito ay magbibigay-daan sa amin na i-verify ang iyong pagkakakilanlan at matupad ang iyong mga kahilingan sa serbisyo. Piliin ang \"Oo, Magpatuloy\" upang pumayag o \"Tanggihan\" kung hindi mo gustong ibahagi ang iyong mga kredensyal sa {{verifierName}}.", "confirmButton": "Oo, Magpatuloy", "cancelButton": "Tanggihan" }, diff --git a/locales/hin.json b/locales/hin.json index 6a1896e376..4f22150b4e 100644 --- a/locales/hin.json +++ b/locales/hin.json @@ -841,14 +841,14 @@ } }, "SendVPScreen": { - "requester": "अनुरोधकर्ता", + "requester": "सत्यापन इकाई", "cardsSelected": "कार्ड चयनित", "cardSelected": "कार्ड चयनित", "unCheck": "सही का निशान हटाएँ", "checkAll": "सभी चेक करें", "consentDialog": { "title": "सहमति आवश्यक", - "message": "हमें आपकी सत्यापन योग्य साख साझा करने के लिए आपकी सहमति की आवश्यकता है। इससे हमें आपकी पहचान सत्यापित करने और आपके सेवा अनुरोधों को पूरा करने में मदद मिलेगी। यदि आप साझा नहीं करना चाहते हैं तो सहमति के लिए \"हां, आगे बढ़ें\" या \"अस्वीकार करें\" चुनें।", + "message": "हमें आपके सत्यापन योग्य क्रेडेंशियल्स को {{verifierName}} के साथ साझा करने के लिए आपकी सहमति की आवश्यकता है। इससे हमें आपकी पहचान सत्यापित करने और आपके सेवा अनुरोधों को पूरा करने में मदद मिलेगी। यदि आप {{verifierName}} के साथ अपने क्रेडेंशियल साझा नहीं करना चाहते हैं तो सहमति के लिए \"हां, आगे बढ़ें\" या \"अस्वीकार करें\" चुनें।", "confirmButton": "हाँ, आगे बढ़ें", "cancelButton": "गिरावट" }, diff --git a/locales/kan.json b/locales/kan.json index f429cccfc7..13a3b84095 100644 --- a/locales/kan.json +++ b/locales/kan.json @@ -839,14 +839,14 @@ } }, "SendVPScreen": { - "requester": "ವಿನಂತಿಸುವವರು", + "requester": "ಪರಿಶೀಲನೆ ಘಟಕ", "cardsSelected": "ಕಾರ್ಡ್‌ಗಳನ್ನು ಆಯ್ಕೆ ಮಾಡಲಾಗಿದೆ", "cardSelected": "ಕಾರ್ಡ್ ಆಯ್ಕೆಮಾಡಲಾಗಿದೆ", "unCheck": "ಅನ್ಚೆಕ್ ಮಾಡಿ", "checkAll": "ಎಲ್ಲವನ್ನೂ ಪರಿಶೀಲಿಸಿ", "consentDialog": { "title": "ಒಪ್ಪಿಗೆ ಅಗತ್ಯವಿದೆ", - "message": "ನಿಮ್ಮ ಪರಿಶೀಲಿಸಬಹುದಾದ ರುಜುವಾತುಗಳನ್ನು ಹಂಚಿಕೊಳ್ಳಲು ನಮಗೆ ನಿಮ್ಮ ಒಪ್ಪಿಗೆಯ ಅಗತ್ಯವಿದೆ. ಇದು ನಿಮ್ಮ ಗುರುತನ್ನು ಪರಿಶೀಲಿಸಲು ಮತ್ತು ನಿಮ್ಮ ಸೇವಾ ವಿನಂತಿಗಳನ್ನು ಪೂರೈಸಲು ನಮಗೆ ಅನುವು ಮಾಡಿಕೊಡುತ್ತದೆ. ಒಪ್ಪಿಗೆ ನೀಡಲು \"ಹೌದು, ಮುಂದುವರೆಯಿರಿ\" ಅಥವಾ ನೀವು ಹಂಚಿಕೊಳ್ಳಲು ಬಯಸದಿದ್ದರೆ \"ನಿರಾಕರಿಸಿ\" ಆಯ್ಕೆಮಾಡಿ.", + "message": "ನಿಮ್ಮ ಪರಿಶೀಲಿಸಬಹುದಾದ ರುಜುವಾತುಗಳನ್ನು {{verifierName}} ಜೊತೆಗೆ ಹಂಚಿಕೊಳ್ಳಲು ನಿಮ್ಮ ಸಮ್ಮತಿಯ ಅಗತ್ಯವಿದೆ. ಇದು ನಿಮ್ಮ ಗುರುತನ್ನು ಪರಿಶೀಲಿಸಲು ಮತ್ತು ನಿಮ್ಮ ಸೇವಾ ವಿನಂತಿಗಳನ್ನು ಪೂರೈಸಲು ನಮಗೆ ಅನುವು ಮಾಡಿಕೊಡುತ್ತದೆ. ನಿಮ್ಮ ರುಜುವಾತುಗಳನ್ನು {{verifierName}} ಜೊತೆಗೆ ಹಂಚಿಕೊಳ್ಳಲು ನೀವು ಬಯಸದಿದ್ದರೆ, ಒಪ್ಪಿಗೆ ನೀಡಲು \"ಹೌದು, ಮುಂದುವರಿಯಿರಿ\" ಅಥವಾ \"ನಿರಾಕರಿಸಿ\" ಆಯ್ಕೆಮಾಡಿ.", "confirmButton": "ಹೌದು, ಮುಂದುವರೆಯಿರಿ", "cancelButton": "ನಿರಾಕರಿಸು" }, diff --git a/locales/tam.json b/locales/tam.json index 2df68db9ab..2a5756595a 100644 --- a/locales/tam.json +++ b/locales/tam.json @@ -839,14 +839,14 @@ } }, "SendVPScreen": { - "requester": "கோரிக்கையாளர்", + "requester": "Tagzemt n usefqed", "cardsSelected": "அட்டைகள் தேர்ந்தெடுக்கப்பட்டன", "cardSelected": "அட்டை தேர்ந்தெடுக்கப்பட்டது", "unCheck": "தேர்வுநீக்கவும்", "checkAll": "அனைத்தையும் சரிபார்க்கவும்", "consentDialog": { "title": "ஒப்புதல் தேவை", - "message": "உங்களின் சரிபார்க்கக்கூடிய நற்சான்றிதழ்களைப் பகிர உங்கள் ஒப்புதல் தேவை. இது உங்கள் அடையாளத்தைச் சரிபார்க்கவும் உங்கள் சேவை கோரிக்கைகளை நிறைவேற்றவும் எங்களுக்கு உதவும். ஒப்புக்கொள்ள \"ஆம், தொடரவும்\" அல்லது நீங்கள் பகிர விரும்பவில்லை என்றால் \"நிராகரி\" என்பதைத் தேர்ந்தெடுக்கவும்.", + "message": "உங்கள் சரிபார்க்கக்கூடிய நற்சான்றிதழ்களை {{verifierName}} உடன் பகிர உங்கள் ஒப்புதல் தேவை. இது உங்கள் அடையாளத்தைச் சரிபார்க்கவும் உங்கள் சேவை கோரிக்கைகளை நிறைவேற்றவும் எங்களுக்கு உதவும். ஒப்புதல் அளிக்க \"ஆம், தொடரவும்\" என்பதைத் தேர்வு செய்யவும் அல்லது {{verifierName}} உடன் உங்கள் சான்றுகளைப் பகிர விரும்பவில்லை எனில் \"நிராகரி\" என்பதைத் தேர்ந்தெடுக்கவும்.", "confirmButton": "ஆம், தொடரவும்", "cancelButton": "நிராகரி" }, diff --git a/machines/app.ts b/machines/app.ts index 0a0452081d..4b923bd37a 100644 --- a/machines/app.ts +++ b/machines/app.ts @@ -103,8 +103,8 @@ export const appMachine = model.createMachine( target: 'init', }, BIOMETRIC_CANCELLED: { - target: 'init' - } + target: 'init', + }, }, states: { init: { @@ -171,9 +171,8 @@ export const appMachine = model.createMachine( target: 'info', }, BIOMETRIC_CANCELLED: { - target: 'store' - } - + target: 'store', + }, }, }, info: { diff --git a/machines/auth.ts b/machines/auth.ts index 3292a44c6c..8b9411f4b9 100644 --- a/machines/auth.ts +++ b/machines/auth.ts @@ -65,7 +65,7 @@ export const authMachine = model.createMachine( actions: 'setTourGuide', }, BIOMETRIC_CANCELLED: { - target: 'init' + target: 'init', }, }, states: { @@ -80,9 +80,11 @@ export const authMachine = model.createMachine( }, {target: 'savingDefaults'}, ], - BIOMETRIC_CANCELLED: [{ - target: 'init' - }], + BIOMETRIC_CANCELLED: [ + { + target: 'init', + }, + ], }, }, savingDefaults: { diff --git a/machines/openID4VP/openID4VPActions.ts b/machines/openID4VP/openID4VPActions.ts index 34d732ac05..9716916ba4 100644 --- a/machines/openID4VP/openID4VPActions.ts +++ b/machines/openID4VP/openID4VPActions.ts @@ -56,7 +56,7 @@ export const openID4VPActions = (model: any) => { areVCFormatAndProofTypeMatchingRequest( format, vc.format, - vc.verifiableCredential.credential.proof.type, + vc?.verifiableCredential?.credential?.proof?.type, ); if (inputDescriptor.constraints.fields && format) { diff --git a/machines/openID4VP/openID4VPSelectors.ts b/machines/openID4VP/openID4VPSelectors.ts index bcc77652ba..603c750cc8 100644 --- a/machines/openID4VP/openID4VPSelectors.ts +++ b/machines/openID4VP/openID4VPSelectors.ts @@ -106,7 +106,10 @@ export function selectIsFaceVerifiedInVPSharing(state: State) { } export function selectVerifierNameInVPSharing(state: State) { - return state.context.authenticationResponse['client_metadata']?.name; + return ( + state.context.authenticationResponse['client_metadata']?.['client_name'] ?? + state.context.authenticationResponse['client_id'] + ); } export function selectRequestedClaimsByVerifier(state: State) { diff --git a/machines/settings.ts b/machines/settings.ts index fc91cb4e0f..6edbaac3d3 100644 --- a/machines/settings.ts +++ b/machines/settings.ts @@ -1,4 +1,11 @@ -import {assign, ContextFrom, EventFrom, send, StateFrom, sendUpdate} from 'xstate'; +import { + assign, + ContextFrom, + EventFrom, + send, + StateFrom, + sendUpdate, +} from 'xstate'; import {createModel} from 'xstate/lib/model'; import {AppServices} from '../shared/GlobalContext'; import { @@ -108,17 +115,17 @@ export const settingsMachine = model.createMachine( {target: 'storingDefaults'}, ], BIOMETRIC_CANCELLED: { - actions: [ - send( - (_, event) => model.events.BIOMETRIC_CANCELLED(event.requester), - { - to: (_, event) => event.requester, - }, - ), - sendUpdate(), - ], - target: 'init', - }, + actions: [ + send( + (_, event) => model.events.BIOMETRIC_CANCELLED(event.requester), + { + to: (_, event) => event.requester, + }, + ), + sendUpdate(), + ], + target: 'init', + }, }, }, storingDefaults: { diff --git a/machines/store.ts b/machines/store.ts index 2b67f53332..89f82ab5b0 100644 --- a/machines/store.ts +++ b/machines/store.ts @@ -276,16 +276,17 @@ export const storeMachine = BIOMETRIC_CANCELLED: { actions: [ send( - (_, event) => model.events.BIOMETRIC_CANCELLED(event.requester), + (_, event) => + model.events.BIOMETRIC_CANCELLED(event.requester), { to: (_, event) => event.requester, }, ), sendUpdate(), - sendParent('BIOMETRIC_CANCELLED') + sendParent('BIOMETRIC_CANCELLED'), ], target: 'checkFreshInstall', - } + }, }, }, }, @@ -303,10 +304,10 @@ export const storeMachine = }, BIOMETRIC_CANCELLED: { actions: [sendParent('BIOMETRIC_CANCELLED')], - target: 'checkFreshInstall' + target: 'checkFreshInstall', + }, }, }, - }, { actions: { notifyParent: sendParent(model.events.READY()), @@ -334,11 +335,10 @@ export const storeMachine = return; }, checkFreshInstall: () => async callback => { - try{ - return await getItem('auth', null, ''); - } - catch(e){ - if(e instanceof BiometricCancellationError){ + try { + return await getItem('auth', null, ''); + } catch (e) { + if (e instanceof BiometricCancellationError) { callback(model.events.BIOMETRIC_CANCELLED()); } else { callback(model.events.STORE_ERROR(e)); @@ -363,7 +363,7 @@ export const storeMachine = base64EncodedString, ); } catch (e) { - if(e instanceof BiometricCancellationError){ + if (e instanceof BiometricCancellationError) { callback(model.events.BIOMETRIC_CANCELLED(event.requester)); } sendErrorEvent(getErrorEventData('ENCRYPTION', '', e)); diff --git a/screens/Scan/SendVPScreenController.ts b/screens/Scan/SendVPScreenController.ts index cfc5f5991a..2eb46e2a42 100644 --- a/screens/Scan/SendVPScreenController.ts +++ b/screens/Scan/SendVPScreenController.ts @@ -204,6 +204,10 @@ export function useSendVPScreen() { } let overlayDetails: Omit | null = null; + let vpVerifierName = useSelector( + openID4VPService, + selectVerifierNameInVPSharing, + ); if (isVPSharingConsent) { overlayDetails = { primaryButtonTestID: 'confirm', @@ -214,7 +218,7 @@ export function useSendVPScreen() { secondaryButtonEvent: CANCEL, title: t('consentDialog.title'), titleTestID: 'consentTitle', - message: t('consentDialog.message'), + message: t('consentDialog.message', {verifierName: vpVerifierName}), messageTestID: 'consentMsg', onCancel: DISMISS_POPUP, }; @@ -237,10 +241,7 @@ export function useSendVPScreen() { return { isSendingVP: useSelector(openID4VPService, selectIsSharingVP), showLoadingScreen: useSelector(openID4VPService, selectIsShowLoadingScreen), - vpVerifierName: useSelector( - openID4VPService, - selectVerifierNameInVPSharing, - ), + vpVerifierName, flowType: useSelector(openID4VPService, selectFlowType), showConfirmationPopup, isSelectingVCs, diff --git a/screens/Settings/SettingsKeyManagement.tsx b/screens/Settings/SettingsKeyManagement.tsx index d9d878018e..7173cfe523 100644 --- a/screens/Settings/SettingsKeyManagement.tsx +++ b/screens/Settings/SettingsKeyManagement.tsx @@ -47,21 +47,21 @@ export const SettingsKeyManagementScreen: React.FC< {!props.controller.isKeyManagementExplored && ( - - {t('NEW')} - - + colors={Theme.Colors.GradientColors} + start={Theme.LinearGradientDirection.start} + end={Theme.LinearGradientDirection.end} + style={{ + justifyContent: 'center', + height: 20, + marginTop: 10, + }}> + + {t('NEW')} + + )} diff --git a/shared/cryptoutil/cryptoUtil.ts b/shared/cryptoutil/cryptoUtil.ts index 6c41cb100b..1da431e67f 100644 --- a/shared/cryptoutil/cryptoUtil.ts +++ b/shared/cryptoutil/cryptoUtil.ts @@ -188,7 +188,7 @@ export async function getJWT( ) { try { const header64 = encodeB64(JSON.stringify(header)); - const payLoad64 = encodeB64(JSON.stringify(payLoad)); + const payLoad64 = encodeB64(forge.util.encodeUtf8(JSON.stringify(payLoad))); const preHash = header64 + '.' + payLoad64; const signature64 = await createSignature( privateKey,