mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 05:27:57 -05:00
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:
117
types/VC/EsignetMosipVC/vc.ts
Normal file
117
types/VC/EsignetMosipVC/vc.ts
Normal 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[];
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import {WalletBindingResponse} from '../shared/cryptoutil/cryptoUtil';
|
||||
import {WalletBindingResponse} from '../../../shared/cryptoutil/cryptoUtil';
|
||||
|
||||
export interface VC {
|
||||
id: string;
|
||||
Reference in New Issue
Block a user