refactor(inji-245): fix download VC on android using openid4vc from esignet (#860)

* refactor(inji-245): refactor the esignet vc item template, loader component, changed usage to vcitem containers

* refactor(INJI-245): remove isValidUrl check for issuer

If logoUrl is passed to issuer it will be rendering else Digit icon will be rendered by default

* fix(INJI-245): perform relevant action on pressing the issuer

* refactor(INJI-245): move vc type files to types folder

* refactor(INJI-245): modify style of VC details

* refactor(INJI-245): move VcItemTags to VC/common folder

* refactor(INJI-245): modify loader style

* fix(INJI-245): make issuer component testIDs visible

For a FlatList, the component passed should have a unique testID set to make accessiblity id visible in appium inspector

* fix(inji-245): fix download credential in the android

* refactor(inji-245): modify the credential endpoint and aud from config

* refactor(inji-245): handle UIN display in the esignet  vcitem template

* refactor(inji-245): method naming corrections

---------

Co-authored-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
This commit is contained in:
vijay151096
2023-09-26 17:22:59 +05:30
committed by GitHub
parent 07efb42a2b
commit 37c65c4be1
46 changed files with 615 additions and 349 deletions

View File

@@ -0,0 +1,117 @@
import {WalletBindingResponse} from '../../../shared/cryptoutil/cryptoUtil';
export interface VC {
id?: string;
idType?: VcIdType;
credential?: DecodedCredential;
verifiableCredential: VerifiableCredential;
verifiablePresentation?: VerifiablePresentation;
requestId?: string;
isVerified?: boolean;
lastVerifiedOn: number;
reason?: VCSharingReason[];
shouldVerifyPresence?: boolean;
walletBindingResponse?: WalletBindingResponse;
credentialRegistry?: string;
isPinned?: boolean;
hashedId?: string;
}
export interface VCSharingReason {
timestamp: number;
message: string;
}
export type VcIdType = 'UIN' | 'VID';
export interface DecodedCredential {
biometrics: {
face: string;
finger: {
left_thumb: string;
right_thumb: string;
};
};
}
export interface CredentialSubject {
//TODO: This should change to mandatory field if uin is also issued
UIN?: string;
VID?: string;
addressLine1: LocalizedField[] | string;
city: LocalizedField[] | string;
dateOfBirth: string;
email: string;
fullName: LocalizedField[] | string;
gender: LocalizedField[] | string;
id: string;
phone: string;
face: string;
}
type VCContext = (string | Record<string, unknown>)[];
export interface Credential {
'@context': VCContext;
credentialSubject: CredentialSubject;
id: string;
issuanceDate: string;
issuer: string;
proof: {
created: string;
jws: string;
proofPurpose: 'assertionMethod' | string;
type: 'RsaSignature2018' | string;
verificationMethod: string;
};
type: VerifiableCredentialType[];
}
export interface VerifiableCredential {
format: string;
credential: Credential;
identifier: string;
generatedOn: Date;
issuerLogo: string;
}
export interface VerifiablePresentation {
'@context': VCContext;
verifiableCredential: VerifiableCredential[];
type: 'VerifiablePresentation';
proof: {
created: string;
jws: string;
proofPurpose: 'authentication' | string;
type: 'RsaSignature2018' | string;
verificationMethod: string;
challenge: string;
domain: string;
};
}
export type VerifiableCredentialType =
| 'VerifiableCredential'
| 'MOSIPVerfiableCredential'
| string;
export interface VCLabel {
singular: string;
plural: string;
}
export interface LocalizedField {
language: string;
value: string;
}
export interface linkTransactionResponse {
authFactors: Object[];
authorizeScopes: null;
clientName: string;
configs: {};
essentialClaims: string[];
linkTransactionId: string;
logoUrl: string;
voluntaryClaims: string[];
}

View File

@@ -1,4 +1,4 @@
import {WalletBindingResponse} from '../shared/cryptoutil/cryptoUtil';
import {WalletBindingResponse} from '../../../shared/cryptoutil/cryptoUtil';
export interface VC {
id: string;