Skip to content

Commit

Permalink
chore: check vct scheme to choose hardware/software key
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
Berend Sliedrecht committed Aug 6, 2024
1 parent 3b7c7d9 commit d59304e
Show file tree
Hide file tree
Showing 7 changed files with 571 additions and 445 deletions.
96 changes: 52 additions & 44 deletions apps/funke/app.config.js
Original file line number Diff line number Diff line change
@@ -1,83 +1,91 @@
const { version } = require('./package.json')
const { version } = require("./package.json");

const APP_VARIANT = process.env.APP_VARIANT || 'production'
const APP_VARIANT = process.env.APP_VARIANT || "production";

const variants = {
development: {
bundle: '.dev',
name: ' (Dev)',
bundle: ".dev",
name: " (Dev)",
},
preview: {
bundle: '.preview',
name: ' (Preview)',
bundle: ".preview",
name: " (Preview)",
},
production: {
bundle: '',
name: '',
bundle: "",
name: "",
},
}
};

const variant = variants[APP_VARIANT]
const variant = variants[APP_VARIANT];

if (!variant) {
throw new Error(`Invalid variant provided: ${process.env.APP_VARIANT}`)
throw new Error(`Invalid variant provided: ${process.env.APP_VARIANT}`);
}

// NOTE: Keep this in sync with the `QrTypes` enum
const invitationSchemes = ['openid', 'openid-initiate-issuance', 'openid-credential-offer', 'openid-vc', 'openid4vp']
const invitationSchemes = [
"openid",
"openid-initiate-issuance",
"openid-credential-offer",
"openid-vc",
"openid4vp",
];

/**
* @type {import('@expo/config-types').ExpoConfig}
*/
const config = {
name: `Funke Wallet${variant.name}`,
scheme: 'funke',
slug: 'funke-wallet',
owner: 'animo-id',
scheme: "funke",
slug: "funke-wallet",
owner: "animo-id",
version,
orientation: 'portrait',
icon: './assets/icon.png',
userInterfaceStyle: 'light',
orientation: "portrait",
icon: "./assets/icon.png",
userInterfaceStyle: "light",
androidStatusBar: {
backgroundColor: '#F2F4F6',
backgroundColor: "#F2F4F6",
},
androidNavigationBar: {
backgroundColor: '#F2F4F6',
backgroundColor: "#F2F4F6",
},
splash: {
image: './assets/splash.png',
resizeMode: 'contain',
backgroundColor: '#F2F4F6',
image: "./assets/splash.png",
resizeMode: "contain",
backgroundColor: "#F2F4F6",
},
updates: {
fallbackToCacheTimeout: 0,
},
plugins: [
'@animo-id/expo-ausweis-sdk',
"@animo-id/expo-ausweis-sdk",
[
'expo-font',
"expo-font",
{
fonts: [
'../../node_modules/@expo-google-fonts/open-sans/OpenSans_400Regular.ttf',
'../../node_modules/@expo-google-fonts/open-sans/OpenSans_500Medium.ttf',
'../../node_modules/@expo-google-fonts/open-sans/OpenSans_600SemiBold.ttf',
'../../node_modules/@expo-google-fonts/open-sans/OpenSans_700Bold.ttf',
'../../node_modules/@expo-google-fonts/raleway/Raleway_400Regular.ttf',
'../../node_modules/@expo-google-fonts/raleway/Raleway_500Medium.ttf',
'../../node_modules/@expo-google-fonts/raleway/Raleway_600SemiBold.ttf',
'../../node_modules/@expo-google-fonts/raleway/Raleway_700Bold.ttf',
"../../node_modules/@expo-google-fonts/open-sans/OpenSans_400Regular.ttf",
"../../node_modules/@expo-google-fonts/open-sans/OpenSans_500Medium.ttf",
"../../node_modules/@expo-google-fonts/open-sans/OpenSans_600SemiBold.ttf",
"../../node_modules/@expo-google-fonts/open-sans/OpenSans_700Bold.ttf",
"../../node_modules/@expo-google-fonts/raleway/Raleway_400Regular.ttf",
"../../node_modules/@expo-google-fonts/raleway/Raleway_500Medium.ttf",
"../../node_modules/@expo-google-fonts/raleway/Raleway_600SemiBold.ttf",
"../../node_modules/@expo-google-fonts/raleway/Raleway_700Bold.ttf",
],
},
],
'expo-router',
"expo-router",
],
assetBundlePatterns: ['**/*'],
assetBundlePatterns: ["**/*"],
ios: {
supportsTablet: false,
bundleIdentifier: `id.animo.funke.wallet${variant.bundle}`,
infoPlist: {
NSCameraUsageDescription: 'Funke Wallet uses the camera to initiate receiving and sharing of credentials.',
NSFaceIDUsageDescription: 'Funke Wallet uses FaceID to securely unlock the wallet and share credentials.',
NSCameraUsageDescription:
"Funke Wallet uses the camera to initiate receiving and sharing of credentials.",
NSFaceIDUsageDescription:
"Funke Wallet uses FaceID to securely unlock the wallet and share credentials.",
ITSAppUsesNonExemptEncryption: false,
// Add schemes for deep linking
CFBundleURLTypes: [
Expand All @@ -89,14 +97,14 @@ const config = {
},
android: {
adaptiveIcon: {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: '#FFFFFF',
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#FFFFFF",
},
package: `id.animo.funke.wallet${variant.bundle}`,
intentFilters: [
...invitationSchemes.map((scheme) => ({
action: 'VIEW',
category: ['DEFAULT', 'BROWSABLE'],
action: "VIEW",
category: ["DEFAULT", "BROWSABLE"],
data: {
scheme,
},
Expand All @@ -108,9 +116,9 @@ const config = {
},
extra: {
eas: {
projectId: 'todo',
projectId: "todo",
},
},
}
};

export default config
export default config;
29 changes: 24 additions & 5 deletions apps/funke/constants.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
export const FUNKE_WALLET_SEED_CREDENTIAL_RECORD_ID = 'FUNKE_WALLET_SEED_CREDENTIAL_RECORD_ID '
export const FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID = 'FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID'
export const FUNKE_WALLET_SEED_CREDENTIAL_RECORD_ID =
"FUNKE_WALLET_SEED_CREDENTIAL_RECORD_ID ";
export const FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID =
"FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID";

// https://demo.pid-issuer.bundesdruckerei.de
const bdrPidIssuerCertificate = `-----BEGIN CERTIFICATE-----
MIICeTCCAiCgAwIBAgIUB5E9QVZtmUYcDtCjKB/H3VQv72gwCgYIKoZIzj0EAwIwgYgxCzAJBgNVBAYTAkRFMQ8wDQYDVQQHDAZCZXJsaW4xHTAbBgNVBAoMFEJ1bmRlc2RydWNrZXJlaSBHbWJIMREwDwYDVQQLDAhUIENTIElERTE2MDQGA1UEAwwtU1BSSU5EIEZ1bmtlIEVVREkgV2FsbGV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6ADAgECAhArxq0w60RTDK4WY9HzgcvBMAoGCCqGSM49BAMCMAAwIBcNNzAwMTAxMDAwMDAwWhgPMjI4NjExMjAxNzQ2NDBaMAAwOTATBgcqhkjOPQIBBggqhkjOPQMBBwMiAALcD1XzKepFxWMAOqV+ln1fybBt7DRO5CV0f9A6mRp2xaMlMCMwIQYDVR0RBBowGIYWaHR0cHM6Ly9mdW5rZS5hbmltby5pZDAKBggqhkjOPQQDAgNHADBEAiAfvGG6sqrvzIMWYpJB5VLloo9f51loYXSkKxJIOztlNwIgLLSvEl0Dmp5vtj2buZ2nXQ2RBKxiLbc5eYGeMeoUnjk=";

export const trustedX509Certificates = [bdrPidIssuerCertificate, animoFunkeRelyingPartyCertificate]
export const trustedX509Certificates = [
bdrPidIssuerCertificate,
animoFunkeRelyingPartyCertificate,
];

// https://gitlab.opencode.de/bmi/eudi-wallet/eidas-2.0-architekturkonzept/-/blob/main/architecture-proposal.md#pid-contents
const sdJwtVcVcts = [
"https://example.bmi.bund.de/credential/pid/1.0",
"urn:eu.europa.ec.eudi:pid:1",
];

// TODO
const msoMdocNamespaces = ["org.iso.18013.5.1.mDL"];

export const pidSchemes = {
sdJwtVcVcts,
msoMdocNamespaces,
};
126 changes: 63 additions & 63 deletions apps/funke/package.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
{
"name": "funke-wallet",
"version": "1.5.1",
"main": "expo-router/entry",
"private": true,
"scripts": {
"start": "APP_VARIANT=development expo start -c --dev-client",
"android": "APP_VARIANT=development expo run:android",
"ios": "APP_VARIANT=development expo run:ios",
"prebuild": "APP_VARIANT=development expo prebuild --no-install"
},
"dependencies": {
"@animo-id/expo-ausweis-sdk": "0.0.1-alpha.5",
"@animo-id/expo-secure-environment": "0.1.0-alpha.1",
"@credo-ts/core": "*",
"@expo-google-fonts/open-sans": "^0.2.3",
"@expo-google-fonts/raleway": "^0.2.3",
"@gorhom/bottom-sheet": "^4.6.3",
"@hyperledger/anoncreds-react-native": "*",
"@hyperledger/aries-askar-react-native": "*",
"@hyperledger/indy-vdr-react-native": "*",
"@package/agent": "workspace:*",
"@package/app": "workspace:*",
"@package/secure-store": "workspace:*",
"@package/ui": "workspace:*",
"@react-native-community/blur": "^4.3.2",
"@react-native-community/netinfo": "11.3.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-navigation/native": "^6.1.6",
"babel-plugin-module-resolver": "^4.1.0",
"burnt": "^0.12.2",
"expo": "~51.0.12",
"expo-barcode-scanner": "~13.0.1",
"expo-constants": "~16.0.2",
"expo-dev-client": "~4.0.16",
"expo-font": "~12.0.7",
"expo-haptics": "~13.0.1",
"expo-image": "~1.12.11",
"expo-linear-gradient": "~13.0.2",
"expo-linking": "~6.3.1",
"expo-navigation-bar": "~3.0.6",
"expo-router": "~3.5.16",
"expo-secure-store": "~13.0.1",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.6",
"expo-updates": "~0.25.16",
"react": "*",
"react-native": "0.74.2",
"react-native-argon2": "^2.0.1",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "~2.16.2",
"react-native-get-random-values": "~1.11.0",
"react-native-keychain": "^8.2.0",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "~3.31.1",
"react-native-svg": "15.2.0"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@tamagui/babel-plugin": "^1.108.0",
"typescript": "*"
}
"name": "funke-wallet",
"version": "1.5.1",
"main": "expo-router/entry",
"private": true,
"scripts": {
"start": "APP_VARIANT=development expo start -c --dev-client",
"android": "APP_VARIANT=development expo run:android",
"ios": "APP_VARIANT=development expo run:ios",
"prebuild": "APP_VARIANT=development expo prebuild --no-install"
},
"dependencies": {
"@animo-id/expo-ausweis-sdk": "0.0.1-alpha.6",
"@animo-id/expo-secure-environment": "0.1.0-alpha.1",
"@credo-ts/core": "*",
"@expo-google-fonts/open-sans": "^0.2.3",
"@expo-google-fonts/raleway": "^0.2.3",
"@gorhom/bottom-sheet": "^4.6.3",
"@hyperledger/anoncreds-react-native": "*",
"@hyperledger/aries-askar-react-native": "*",
"@hyperledger/indy-vdr-react-native": "*",
"@package/agent": "workspace:*",
"@package/app": "workspace:*",
"@package/secure-store": "workspace:*",
"@package/ui": "workspace:*",
"@react-native-community/blur": "^4.3.2",
"@react-native-community/netinfo": "11.3.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-navigation/native": "^6.1.6",
"babel-plugin-module-resolver": "^4.1.0",
"burnt": "^0.12.2",
"expo": "~51.0.12",
"expo-barcode-scanner": "~13.0.1",
"expo-constants": "~16.0.2",
"expo-dev-client": "~4.0.16",
"expo-font": "~12.0.7",
"expo-haptics": "~13.0.1",
"expo-image": "~1.12.11",
"expo-linear-gradient": "~13.0.2",
"expo-linking": "~6.3.1",
"expo-navigation-bar": "~3.0.6",
"expo-router": "~3.5.16",
"expo-secure-store": "~13.0.1",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.6",
"expo-updates": "~0.25.16",
"react": "*",
"react-native": "0.74.2",
"react-native-argon2": "^2.0.1",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "~2.16.2",
"react-native-get-random-values": "~1.11.0",
"react-native-keychain": "^8.2.0",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "~3.31.1",
"react-native-svg": "15.2.0"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@tamagui/babel-plugin": "^1.108.0",
"typescript": "*"
}
}
Loading

0 comments on commit d59304e

Please sign in to comment.