diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 36dfa14eb2..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug, triage -assignees: ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: - -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Actual behavior** -A clear and concise description of what factually occurred. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Add the screenshot of the profile page with commit id** - -**Smartphone (please complete the following information):** - -- Wallet Device: [e.g. iPhone6] - - Phone make/model: [e.g. :Vivo Y73] - - OS: [e.g. iOS8.1] - - BLE version : [e.g. 4.2] - -- Verifier Device: [e.g. iPhone6] - - Phone make/model: [e.g. :Vivo Y73] - - OS: [e.g. iOS8.1] - - BLE version : [e.g. 4.2] - -- Inji app version: [e.g 0.3.0] -- Mimoto version: [e.g 1.2.x] -- MOSIP Version: [e.g. 1.2.1] - -**Where does the issue occur: Wallet/Verifier?** - -**Logs of wallet and verifier:** - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 01fb3846df..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement, triage -assignees: - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/shared/openId4VCI/Utils.test.ts b/shared/openId4VCI/Utils.test.ts index 31c9e9cefc..ab929a0cc1 100644 --- a/shared/openId4VCI/Utils.test.ts +++ b/shared/openId4VCI/Utils.test.ts @@ -6,12 +6,14 @@ import { ACTIVATION_NEEDED, Issuers_Key_Ref, getDisplayObjectForCurrentLanguage, + getCredentialIssuersWellKnownConfig, removeBottomSectionFields, getMatchingCredentialIssuerMetadata, selectCredentialRequestKey, updateCredentialInformation, } from './Utils'; import {VCFormat} from '../VCFormat'; +import {CACHED_API} from '../api'; // Mock VCProcessor jest.mock('../../components/VC/common/VCProcessor', () => ({ @@ -22,6 +24,12 @@ jest.mock('../../components/VC/common/VCProcessor', () => ({ }, })); +jest.mock('../api', () => ({ + CACHED_API: { + fetchIssuerWellknownConfig: jest.fn(), + }, +})); + describe('openId4VCI Utils', () => { describe('Protocols', () => { it('should have OpenId4VCI protocol defined', () => { @@ -230,6 +238,40 @@ describe('openId4VCI Utils', () => { }); }); + describe('getCredentialIssuersWellKnownConfig', () => { + it('should include mdoc fallback fields when issuer order is missing', async () => { + (CACHED_API.fetchIssuerWellknownConfig as jest.Mock).mockResolvedValue({ + credential_configurations_supported: { + SampleMdocCredential: { + format: VCFormat.mso_mdoc, + claims: { + 'org.iso.18013.5.1': { + family_name: {display: [{locale: 'en', name: 'Family Name'}]}, + given_name: {display: [{locale: 'en', name: 'Given Name'}]}, + }, + }, + }, + }, + }); + + const result = await getCredentialIssuersWellKnownConfig( + 'issuer-cache-key', + ['default-field'], + 'SampleMdocCredential', + VCFormat.mso_mdoc, + 'https://issuer.example', + ); + + expect(result.fields).toEqual( + expect.arrayContaining([ + 'org.iso.18013.5.1~family_name', + 'org.iso.18013.5.1~given_name', + ]), + ); + expect(result.fields).toHaveLength(2); + }); + }); + describe('selectCredentialRequestKey', () => { it('should select first supported key type', () => { const proofSigningAlgos = ['RS256', 'ES256']; diff --git a/shared/openId4VCI/Utils.ts b/shared/openId4VCI/Utils.ts index dbd542c337..cbdf460c0c 100644 --- a/shared/openId4VCI/Utils.ts +++ b/shared/openId4VCI/Utils.ts @@ -8,7 +8,6 @@ import { BOTTOM_SECTION_FIELDS_WITH_DETAILED_ADDRESS_FIELDS, DETAIL_VIEW_ADD_ON_FIELDS, DETAIL_VIEW_BOTTOM_SECTION_FIELDS, - getCredentialTypeFromWellKnown, } from '../../components/VC/common/VCUtils'; import {displayType} from '../../machines/Issuers/IssuersMachine'; import { @@ -25,7 +24,6 @@ import { } from '../constants'; import {getJWT} from '../cryptoutil/cryptoUtil'; import {verifyCredential} from '../vcjs/verifyCredential'; -import {getVerifiableCredential} from '../../machines/VerifiableCredential/VCItemMachine/VCItemSelectors'; import {getErrorEventData, sendErrorEvent} from '../telemetry/TelemetryUtils'; import {TelemetryConstants} from '../telemetry/TelemetryConstants'; import {KeyTypes} from '../cryptoutil/KeyTypes'; @@ -163,7 +161,7 @@ export const getCredentialIssuersWellKnownConfig = async ( Object.keys(matchingWellknownDetails.claims).forEach(namespace => { Object.keys(matchingWellknownDetails.claims[namespace]).forEach( claim => { - fields.concat(`${namespace}~${claim}`); + fields = fields.concat(`${namespace}~${claim}`); }, ); });