Merge pull request #440 from selfxyz/update-logging

Update logging
This commit is contained in:
turnoffthiscomputer
2025-03-12 13:57:56 -04:00
committed by GitHub
7 changed files with 34 additions and 31 deletions

View File

@@ -100,7 +100,7 @@ class PassportReader: NSObject{
let passport = try await passportReader.readPassport( mrzKey: mrzKey, tags: [.COM, .DG1, .SOD], customDisplayMessage: customMessageHandler)
var ret = [String:String]()
print("documentType", passport.documentType)
//print("documentType", passport.documentType)
ret["documentType"] = passport.documentType
ret["documentSubType"] = passport.documentSubType
@@ -136,26 +136,26 @@ class PassportReader: NSObject{
if let serializedCountrySigningCertificate = serializeX509Wrapper(passport.countrySigningCertificate) {
ret["countrySigningCertificate"] = serializedCountrySigningCertificate
}
print("passport.documentSigningCertificate", passport.documentSigningCertificate)
print("passport.countrySigningCertificate", passport.countrySigningCertificate)
//print("passport.documentSigningCertificate", passport.documentSigningCertificate)
//print("passport.countrySigningCertificate", passport.countrySigningCertificate)
ret["LDSVersion"] = passport.LDSVersion
ret["dataGroupsPresent"] = passport.dataGroupsPresent.joined(separator: ", ")
print("passport.LDSVersion", passport.LDSVersion)
//print("passport.LDSVersion", passport.LDSVersion)
// ret["dataGroupsAvailable"] = passport.dataGroupsAvailable.map(dataGroupIdToString)
print("passport.dataGroupsAvailable", passport.dataGroupsAvailable)
print("passport.dataGroupsRead", passport.dataGroupsRead)
print("passport.dataGroupHashes", passport.dataGroupHashes)
//print("passport.dataGroupsAvailable", passport.dataGroupsAvailable)
//print("passport.dataGroupsRead", passport.dataGroupsRead)
//print("passport.dataGroupHashes", passport.dataGroupHashes)
// do {
// let dataGroupsReadData = try JSONSerialization.data(withJSONObject: passport.dataGroupsRead.mapValues { self.convertDataGroupToSerializableFormat($0) }, options: [])
// let dataGroupsReadJsonString = String(data: dataGroupsReadData, encoding: .utf8) ?? ""
// ret["dataGroupsRead"] = dataGroupsReadJsonString
// } catch {
// print("Error serializing dataGroupsRead: \(error)")
// //print("Error serializing dataGroupsRead: \(error)")
// }
// ret["dataGroupsRead"] = passport.dataGroupsRead.mapValues { convertDataGroupToSerializableFormat($0) }
@@ -166,7 +166,7 @@ class PassportReader: NSObject{
let dataGroupHashesJsonString = String(data: dataGroupHashesData, encoding: .utf8) ?? ""
ret["dataGroupHashes"] = dataGroupHashesJsonString
} catch {
print("Error serializing dataGroupHashes: \(error)")
//print("Error serializing dataGroupHashes: \(error)")
}
@@ -190,7 +190,7 @@ class PassportReader: NSObject{
// activeAuthenticationSupported
print("passport.certificateSigningGroups", passport.certificateSigningGroups)
//print("passport.certificateSigningGroups", passport.certificateSigningGroups)
// ret["certificateSigningGroups"] = passport.certificateSigningGroups.mapKeys(certificateTypeToString).mapValues(encodeX509WrapperToJsonString)
// if let passportDataElements = passport.passportDataElements {
@@ -210,7 +210,7 @@ class PassportReader: NSObject{
let messageDigestFromSignedAttributes = try sod.getMessageDigestFromSignedAttributes()
let signedAttributes = try sod.getSignedAttributes()
print("messageDigestFromSignedAttributes", messageDigestFromSignedAttributes)
//print("messageDigestFromSignedAttributes", messageDigestFromSignedAttributes)
ret["signedAttributes"] = signedAttributes.base64EncodedString()
// if let pubKey = convertOpaquePointerToSecKey(opaquePointer: sod.pubKey),
@@ -225,7 +225,7 @@ class PassportReader: NSObject{
}
} catch {
print("Error serializing SOD data: \(error)")
//print("Error serializing SOD data: \(error)")
reject("E_PASSPORT_READ", error.localizedDescription, error)
}
@@ -260,7 +260,7 @@ class PassportReader: NSObject{
// let secKey = SecKeyCreateWithData(keyData as CFData, attributes as CFDictionary, &error)
// if let error = error {
// print("Error creating SecKey: \(error.takeRetainedValue())")
// //print("Error creating SecKey: \(error.takeRetainedValue())")
// return nil
// }
@@ -270,7 +270,7 @@ class PassportReader: NSObject{
func serializePublicKey(_ publicKey: SecKey) -> String? {
var error: Unmanaged<CFError>?
guard let publicKeyData = SecKeyCopyExternalRepresentation(publicKey, &error) as Data? else {
print("Error serializing public key: \(error!.takeRetainedValue() as Error)")
//print("Error serializing public key: \(error!.takeRetainedValue() as Error)")
return nil
}
return publicKeyData.base64EncodedString()
@@ -281,7 +281,7 @@ func serializePublicKey(_ publicKey: SecKey) -> String? {
let signature = try sod.getSignature()
return signature.base64EncodedString()
} catch {
print("Error extracting signature: \(error)")
//print("Error extracting signature: \(error)")
return nil
}
}
@@ -305,7 +305,7 @@ func serializePublicKey(_ publicKey: SecKey) -> String? {
let jsonData = try JSONSerialization.data(withJSONObject: certInfoStringKeys, options: [])
return String(data: jsonData, encoding: .utf8)
} catch {
print("Error serializing X509Wrapper: \(error)")
//print("Error serializing X509Wrapper: \(error)")
return nil
}
}
@@ -319,7 +319,7 @@ func serializePublicKey(_ publicKey: SecKey) -> String? {
let jsonData = try JSONSerialization.data(withJSONObject: certificateItems, options: [])
return String(data: jsonData, encoding: .utf8)
} catch {
print("Error serializing certificate items to JSON: \(error)")
//print("Error serializing certificate items to JSON: \(error)")
return nil
}
}

View File

@@ -24,7 +24,7 @@ target 'Self' do
config = use_native_modules!
use_frameworks!
pod 'NFCPassportReader', git: 'https://github.com/zk-passport/NFCPassportReader', commit: '8e72f0a2d3ca3bede00304bd22ed10829535dd53'
pod 'NFCPassportReader', git: 'https://github.com/zk-passport/NFCPassportReader', commit: '9bf434c86a01ae9670422f5a7484d7405124a108'
pod 'QKMRZScanner'
pod 'lottie-ios'
pod 'SwiftQRScanner', :git => 'https://github.com/vinodiOS/SwiftQRScanner'

View File

@@ -1674,7 +1674,7 @@ DEPENDENCIES:
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- lottie-ios
- lottie-react-native (from `../node_modules/lottie-react-native`)
- NFCPassportReader (from `https://github.com/zk-passport/NFCPassportReader`, commit `8e72f0a2d3ca3bede00304bd22ed10829535dd53`)
- NFCPassportReader (from `https://github.com/zk-passport/NFCPassportReader`, commit `9bf434c86a01ae9670422f5a7484d7405124a108`)
- QKMRZScanner
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
@@ -1786,7 +1786,7 @@ EXTERNAL SOURCES:
lottie-react-native:
:path: "../node_modules/lottie-react-native"
NFCPassportReader:
:commit: 8e72f0a2d3ca3bede00304bd22ed10829535dd53
:commit: 9bf434c86a01ae9670422f5a7484d7405124a108
:git: https://github.com/zk-passport/NFCPassportReader
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
@@ -1943,7 +1943,7 @@ EXTERNAL SOURCES:
CHECKOUT OPTIONS:
NFCPassportReader:
:commit: 8e72f0a2d3ca3bede00304bd22ed10829535dd53
:commit: 9bf434c86a01ae9670422f5a7484d7405124a108
:git: https://github.com/zk-passport/NFCPassportReader
SwiftQRScanner:
:commit: fddcabcb431cd6110cea0394660082661dbafa7e
@@ -2046,6 +2046,6 @@ SPEC CHECKSUMS:
SwiftyTesseract: 1f3d96668ae92dc2208d9842c8a59bea9fad2cbb
Yoga: b05994d1933f507b0a28ceaa4fdb968dc18da178
PODFILE CHECKSUM: f648ca6b271c53ebcd59e8a98dd25929f98c5e55
PODFILE CHECKSUM: 360610d96d3dc76182e3079e22704a7c8151e46d
COCOAPODS: 1.16.2

View File

@@ -836,7 +836,10 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -926,7 +929,10 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = false;

View File

@@ -91,11 +91,6 @@ const PassportCameraScreen: React.FC<PassportNFCScanScreen> = ({}) => {
dateOfBirth: formattedDateOfBirth,
dateOfExpiry: formattedDateOfExpiry,
});
console.log('Updated store with:', {
passportNumber,
dateOfBirth: formattedDateOfBirth,
dateOfExpiry: formattedDateOfExpiry,
});
trackEvent('Passport Camera Scan Successful', {
duration_seconds: parseFloat(scanDurationSeconds),

View File

@@ -121,7 +121,7 @@ const ProveScreen: React.FC = () => {
const passportDataAndSecret = await getPassportDataAndSecret().catch(
(e: Error) => {
console.error('Error getPassportDataAndSecret', e);
console.error('Error getting passport data', e);
globalSetDisclosureStatus?.(ProofStatusEnum.ERROR);
},
);
@@ -161,7 +161,7 @@ const ProveScreen: React.FC = () => {
status === ProofStatusEnum.SUCCESS,
);
} catch (e) {
console.log('Error sending VC and disclose payload', e);
console.log('Error in verification process');
globalSetDisclosureStatus?.(ProofStatusEnum.ERROR);
} finally {
isProcessing.current = false;

View File

@@ -14,6 +14,8 @@ const dataKeysToLabels: Record<
string
> = {
dataGroups: 'Data Groups',
dg1Size: 'DG1 Size',
dg1HashSize: 'DG1 Hash Size',
dg1HashFunction: 'DG1 Hash Function',
dg1HashOffset: 'DG1 Hash Offset',
dgPaddingBytes: 'DG Padding Bytes',