From 66ee65dc219909914f237dd97e6b91e746ca7a63 Mon Sep 17 00:00:00 2001 From: Berend Sliedrecht <61358536+berendsliedrecht@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:15:09 +0200 Subject: [PATCH] chore: rename funke to ausweis (#138) Signed-off-by: Berend Sliedrecht --- README.md | 2 +- apps/{funke => ausweis}/app.config.js | 14 ++--- .../assets/adaptive-icon.png | Bin .../assets/german-issuer-image.png | Bin apps/{funke => ausweis}/assets/icon.png | Bin .../{funke => ausweis}/assets/in-app-logo.png | Bin apps/{funke => ausweis}/assets/splash.png | Bin apps/{funke => ausweis}/babel.config.js | 0 apps/{funke => ausweis}/eas.json | 0 apps/{funke => ausweis}/metro.config.js | 0 apps/{funke => ausweis}/package.json | 2 +- apps/{funke => ausweis}/src/agent/index.ts | 6 +- apps/ausweis/src/agent/initialize.ts | 12 ++++ .../src/app/(app)/(home)/scan.tsx | 0 .../src/app/(app)/_layout.tsx | 2 +- .../src/app/(app)/credentials/[id].tsx | 0 .../src/app/(app)/index.tsx | 0 .../src/app/(app)/notifications/inbox.tsx | 0 .../(app)/notifications/openIdCredential.tsx | 0 .../notifications/openIdPresentation.tsx | 0 .../src/app/[...unmatched].tsx | 0 apps/{funke => ausweis}/src/app/_layout.tsx | 0 .../src/app/authenticate.tsx | 2 +- .../src/app/onboarding/_layout.tsx | 2 +- .../src/app/onboarding/index.tsx | 2 +- apps/{funke => ausweis}/src/constants.ts | 4 +- apps/ausweis/src/crypto/aes.ts | 4 ++ apps/{funke => ausweis}/src/crypto/bPrime.ts | 6 +- .../src/features/onboarding/index.tsx | 0 .../features/onboarding/onboardingContext.tsx | 59 +++++++++++++----- .../onboarding/screens/biometrics.tsx | 0 .../onboarding/screens/id-card-fetch.tsx | 0 .../onboarding/screens/id-card-pin.tsx | 0 .../onboarding/screens/id-card-scan.tsx | 0 .../onboarding/screens/id-card-start-scan.tsx | 0 .../onboarding/screens/introduction-steps.tsx | 0 .../src/features/onboarding/screens/pin.tsx | 0 .../features/onboarding/screens/welcome.tsx | 0 .../src/polyfills/crypto.ts | 0 apps/{funke => ausweis}/src/storage/index.ts | 0 .../src/storage/seedCredential.ts | 8 +-- .../src/use-cases/ReceivePidUseCase.ts | 4 +- .../src/utils/resetWallet.ts | 0 apps/{funke => ausweis}/tamagui.config.ts | 0 apps/{funke => ausweis}/tsconfig.json | 2 +- apps/funke/src/agent/initialize.ts | 12 ---- apps/funke/src/crypto/aes.ts | 4 -- .../funke/IdCardPinScreen.stories.tsx | 2 +- packages/agent/src/agent.ts | 6 +- packages/agent/src/index.ts | 4 +- pnpm-lock.yaml | 2 +- tsconfig.json | 2 +- 52 files changed, 97 insertions(+), 66 deletions(-) rename apps/{funke => ausweis}/app.config.js (85%) rename apps/{funke => ausweis}/assets/adaptive-icon.png (100%) rename apps/{funke => ausweis}/assets/german-issuer-image.png (100%) rename apps/{funke => ausweis}/assets/icon.png (100%) rename apps/{funke => ausweis}/assets/in-app-logo.png (100%) rename apps/{funke => ausweis}/assets/splash.png (100%) rename apps/{funke => ausweis}/babel.config.js (100%) rename apps/{funke => ausweis}/eas.json (100%) rename apps/{funke => ausweis}/metro.config.js (100%) rename apps/{funke => ausweis}/package.json (98%) rename apps/{funke => ausweis}/src/agent/index.ts (63%) create mode 100644 apps/ausweis/src/agent/initialize.ts rename apps/{funke => ausweis}/src/app/(app)/(home)/scan.tsx (100%) rename apps/{funke => ausweis}/src/app/(app)/_layout.tsx (94%) rename apps/{funke => ausweis}/src/app/(app)/credentials/[id].tsx (100%) rename apps/{funke => ausweis}/src/app/(app)/index.tsx (100%) rename apps/{funke => ausweis}/src/app/(app)/notifications/inbox.tsx (100%) rename apps/{funke => ausweis}/src/app/(app)/notifications/openIdCredential.tsx (100%) rename apps/{funke => ausweis}/src/app/(app)/notifications/openIdPresentation.tsx (100%) rename apps/{funke => ausweis}/src/app/[...unmatched].tsx (100%) rename apps/{funke => ausweis}/src/app/_layout.tsx (100%) rename apps/{funke => ausweis}/src/app/authenticate.tsx (97%) rename apps/{funke => ausweis}/src/app/onboarding/_layout.tsx (82%) rename apps/{funke => ausweis}/src/app/onboarding/index.tsx (95%) rename apps/{funke => ausweis}/src/constants.ts (90%) create mode 100644 apps/ausweis/src/crypto/aes.ts rename apps/{funke => ausweis}/src/crypto/bPrime.ts (84%) rename apps/{funke => ausweis}/src/features/onboarding/index.tsx (100%) rename apps/{funke => ausweis}/src/features/onboarding/onboardingContext.tsx (90%) rename apps/{funke => ausweis}/src/features/onboarding/screens/biometrics.tsx (100%) rename apps/{funke => ausweis}/src/features/onboarding/screens/id-card-fetch.tsx (100%) rename apps/{funke => ausweis}/src/features/onboarding/screens/id-card-pin.tsx (100%) rename apps/{funke => ausweis}/src/features/onboarding/screens/id-card-scan.tsx (100%) rename apps/{funke => ausweis}/src/features/onboarding/screens/id-card-start-scan.tsx (100%) rename apps/{funke => ausweis}/src/features/onboarding/screens/introduction-steps.tsx (100%) rename apps/{funke => ausweis}/src/features/onboarding/screens/pin.tsx (100%) rename apps/{funke => ausweis}/src/features/onboarding/screens/welcome.tsx (100%) rename apps/{funke => ausweis}/src/polyfills/crypto.ts (100%) rename apps/{funke => ausweis}/src/storage/index.ts (100%) rename apps/{funke => ausweis}/src/storage/seedCredential.ts (50%) rename apps/{funke => ausweis}/src/use-cases/ReceivePidUseCase.ts (98%) rename apps/{funke => ausweis}/src/utils/resetWallet.ts (100%) rename apps/{funke => ausweis}/tamagui.config.ts (100%) rename apps/{funke => ausweis}/tsconfig.json (80%) delete mode 100644 apps/funke/src/agent/initialize.ts delete mode 100644 apps/funke/src/crypto/aes.ts diff --git a/README.md b/README.md index bb0336a4..f7272275 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The folder structure is as follows - `apps` top level applications - `paradym` Paradym Wallet - react native app for iOS & Android - - `funke` Funke Wallet - react native app for iOS & Android + - `ausweis` Ausweis Wallet - react native app for iOS & Android - `packages` shared packages - `ui` includes our custom UI kit that will be optimized by Tamagui - `agent` includes the Aries Framework JavaScript (AFJ) agent and SSI capabilities diff --git a/apps/funke/app.config.js b/apps/ausweis/app.config.js similarity index 85% rename from apps/funke/app.config.js rename to apps/ausweis/app.config.js index 4b7a01c9..bc924c27 100644 --- a/apps/funke/app.config.js +++ b/apps/ausweis/app.config.js @@ -30,9 +30,9 @@ const invitationSchemes = ['openid', 'openid-initiate-issuance', 'openid-credent * @type {import('@expo/config-types').ExpoConfig} */ const config = { - name: `Funke Wallet${variant.name}`, - scheme: 'funke', - slug: 'funke-wallet', + name: `Ausweis Wallet ${variant.name}`, + scheme: 'ausweis-wallet', + slug: 'ausweis-wallet', owner: 'animo-id', version, orientation: 'portrait', @@ -74,10 +74,10 @@ const config = { assetBundlePatterns: ['**/*'], ios: { supportsTablet: false, - bundleIdentifier: `id.animo.funke.wallet${variant.bundle}`, + bundleIdentifier: `id.animo.ausweis${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: 'Ausweis Wallet uses the camera to initiate receiving and sharing of credentials.', + NSFaceIDUsageDescription: 'Ausweis Wallet uses FaceID to securely unlock the wallet and share credentials.', ITSAppUsesNonExemptEncryption: false, // Add schemes for deep linking CFBundleURLTypes: [ @@ -92,7 +92,7 @@ const config = { foregroundImage: './assets/adaptive-icon.png', backgroundColor: '#FFFFFF', }, - package: `id.animo.funke.wallet${variant.bundle}`, + package: `id.animo.ausweis${variant.bundle}`, intentFilters: [ ...invitationSchemes.map((scheme) => ({ action: 'VIEW', diff --git a/apps/funke/assets/adaptive-icon.png b/apps/ausweis/assets/adaptive-icon.png similarity index 100% rename from apps/funke/assets/adaptive-icon.png rename to apps/ausweis/assets/adaptive-icon.png diff --git a/apps/funke/assets/german-issuer-image.png b/apps/ausweis/assets/german-issuer-image.png similarity index 100% rename from apps/funke/assets/german-issuer-image.png rename to apps/ausweis/assets/german-issuer-image.png diff --git a/apps/funke/assets/icon.png b/apps/ausweis/assets/icon.png similarity index 100% rename from apps/funke/assets/icon.png rename to apps/ausweis/assets/icon.png diff --git a/apps/funke/assets/in-app-logo.png b/apps/ausweis/assets/in-app-logo.png similarity index 100% rename from apps/funke/assets/in-app-logo.png rename to apps/ausweis/assets/in-app-logo.png diff --git a/apps/funke/assets/splash.png b/apps/ausweis/assets/splash.png similarity index 100% rename from apps/funke/assets/splash.png rename to apps/ausweis/assets/splash.png diff --git a/apps/funke/babel.config.js b/apps/ausweis/babel.config.js similarity index 100% rename from apps/funke/babel.config.js rename to apps/ausweis/babel.config.js diff --git a/apps/funke/eas.json b/apps/ausweis/eas.json similarity index 100% rename from apps/funke/eas.json rename to apps/ausweis/eas.json diff --git a/apps/funke/metro.config.js b/apps/ausweis/metro.config.js similarity index 100% rename from apps/funke/metro.config.js rename to apps/ausweis/metro.config.js diff --git a/apps/funke/package.json b/apps/ausweis/package.json similarity index 98% rename from apps/funke/package.json rename to apps/ausweis/package.json index f7ababdd..50b445bc 100644 --- a/apps/funke/package.json +++ b/apps/ausweis/package.json @@ -1,5 +1,5 @@ { - "name": "funke-wallet", + "name": "ausweis-wallet", "version": "1.5.1", "main": "expo-router/entry", "private": true, diff --git a/apps/funke/src/agent/index.ts b/apps/ausweis/src/agent/index.ts similarity index 63% rename from apps/funke/src/agent/index.ts rename to apps/ausweis/src/agent/index.ts index 92917431..c83a1a42 100644 --- a/apps/funke/src/agent/index.ts +++ b/apps/ausweis/src/agent/index.ts @@ -1,10 +1,10 @@ -import { type FunkeAppAgent, useAgent } from '@package/agent' +import { type AusweisAppAgent, useAgent } from '@package/agent' import { useSecureUnlock as _useSecureUnlock } from '@package/secure-store/secureUnlock' export { initializeAppAgent } from './initialize' -export const useAppAgent = useAgent -export type AppAgent = FunkeAppAgent +export const useAppAgent = useAgent +export type AppAgent = AusweisAppAgent export type SecureUnlockContext = { agent: AppAgent } export const useSecureUnlock = () => _useSecureUnlock() diff --git a/apps/ausweis/src/agent/initialize.ts b/apps/ausweis/src/agent/initialize.ts new file mode 100644 index 00000000..b373b9dc --- /dev/null +++ b/apps/ausweis/src/agent/initialize.ts @@ -0,0 +1,12 @@ +import { trustedX509Certificates } from '@ausweis/constants' +import { initializeAusweisAgent } from '@package/agent' + +export function initializeAppAgent({ walletKey }: { walletKey: string }) { + return initializeAusweisAgent({ + keyDerivation: 'raw', + walletId: 'ausweis-wallet', + walletKey, + walletLabel: 'Ausweis Wallet', + trustedX509Certificates, + }) +} diff --git a/apps/funke/src/app/(app)/(home)/scan.tsx b/apps/ausweis/src/app/(app)/(home)/scan.tsx similarity index 100% rename from apps/funke/src/app/(app)/(home)/scan.tsx rename to apps/ausweis/src/app/(app)/(home)/scan.tsx diff --git a/apps/funke/src/app/(app)/_layout.tsx b/apps/ausweis/src/app/(app)/_layout.tsx similarity index 94% rename from apps/funke/src/app/(app)/_layout.tsx rename to apps/ausweis/src/app/(app)/_layout.tsx index c8e4a2e0..f4ad120c 100644 --- a/apps/funke/src/app/(app)/_layout.tsx +++ b/apps/ausweis/src/app/(app)/_layout.tsx @@ -1,6 +1,6 @@ import { Redirect, Stack } from 'expo-router' -import { useSecureUnlock } from '@funke/agent' +import { useSecureUnlock } from '@ausweis/agent' import { AgentProvider } from '@package/agent' import { useResetWalletDevMenu } from '../../utils/resetWallet' diff --git a/apps/funke/src/app/(app)/credentials/[id].tsx b/apps/ausweis/src/app/(app)/credentials/[id].tsx similarity index 100% rename from apps/funke/src/app/(app)/credentials/[id].tsx rename to apps/ausweis/src/app/(app)/credentials/[id].tsx diff --git a/apps/funke/src/app/(app)/index.tsx b/apps/ausweis/src/app/(app)/index.tsx similarity index 100% rename from apps/funke/src/app/(app)/index.tsx rename to apps/ausweis/src/app/(app)/index.tsx diff --git a/apps/funke/src/app/(app)/notifications/inbox.tsx b/apps/ausweis/src/app/(app)/notifications/inbox.tsx similarity index 100% rename from apps/funke/src/app/(app)/notifications/inbox.tsx rename to apps/ausweis/src/app/(app)/notifications/inbox.tsx diff --git a/apps/funke/src/app/(app)/notifications/openIdCredential.tsx b/apps/ausweis/src/app/(app)/notifications/openIdCredential.tsx similarity index 100% rename from apps/funke/src/app/(app)/notifications/openIdCredential.tsx rename to apps/ausweis/src/app/(app)/notifications/openIdCredential.tsx diff --git a/apps/funke/src/app/(app)/notifications/openIdPresentation.tsx b/apps/ausweis/src/app/(app)/notifications/openIdPresentation.tsx similarity index 100% rename from apps/funke/src/app/(app)/notifications/openIdPresentation.tsx rename to apps/ausweis/src/app/(app)/notifications/openIdPresentation.tsx diff --git a/apps/funke/src/app/[...unmatched].tsx b/apps/ausweis/src/app/[...unmatched].tsx similarity index 100% rename from apps/funke/src/app/[...unmatched].tsx rename to apps/ausweis/src/app/[...unmatched].tsx diff --git a/apps/funke/src/app/_layout.tsx b/apps/ausweis/src/app/_layout.tsx similarity index 100% rename from apps/funke/src/app/_layout.tsx rename to apps/ausweis/src/app/_layout.tsx diff --git a/apps/funke/src/app/authenticate.tsx b/apps/ausweis/src/app/authenticate.tsx similarity index 97% rename from apps/funke/src/app/authenticate.tsx rename to apps/ausweis/src/app/authenticate.tsx index 2271f62f..da157e30 100644 --- a/apps/funke/src/app/authenticate.tsx +++ b/apps/ausweis/src/app/authenticate.tsx @@ -1,7 +1,7 @@ import { Redirect } from 'expo-router' +import { initializeAppAgent, useSecureUnlock } from '@ausweis/agent' import { WalletInvalidKeyError } from '@credo-ts/core' -import { initializeAppAgent, useSecureUnlock } from '@funke/agent' import { FlexPage, HeroIcons, Paragraph, PinDotsInput, type PinDotsInputRef, Stack, YStack } from '@package/ui' import * as SplashScreen from 'expo-splash-screen' import { useEffect, useRef } from 'react' diff --git a/apps/funke/src/app/onboarding/_layout.tsx b/apps/ausweis/src/app/onboarding/_layout.tsx similarity index 82% rename from apps/funke/src/app/onboarding/_layout.tsx rename to apps/ausweis/src/app/onboarding/_layout.tsx index d7a3e4a1..387c6a41 100644 --- a/apps/funke/src/app/onboarding/_layout.tsx +++ b/apps/ausweis/src/app/onboarding/_layout.tsx @@ -1,4 +1,4 @@ -import { OnboardingContextProvider } from '@funke/features/onboarding' +import { OnboardingContextProvider } from '@ausweis/features/onboarding' import { Slot } from 'expo-router' import * as SplashScreen from 'expo-splash-screen' import { useResetWalletDevMenu } from '../../utils/resetWallet' diff --git a/apps/funke/src/app/onboarding/index.tsx b/apps/ausweis/src/app/onboarding/index.tsx similarity index 95% rename from apps/funke/src/app/onboarding/index.tsx rename to apps/ausweis/src/app/onboarding/index.tsx index 1abab9b4..075f5304 100644 --- a/apps/funke/src/app/onboarding/index.tsx +++ b/apps/ausweis/src/app/onboarding/index.tsx @@ -1,4 +1,4 @@ -import { useOnboardingContext } from '@funke/features/onboarding' +import { useOnboardingContext } from '@ausweis/features/onboarding' import { FlexPage, OnboardingScreensHeader } from '@package/ui' import Animated, { FadeInRight, FadeOutLeft } from 'react-native-reanimated' diff --git a/apps/funke/src/constants.ts b/apps/ausweis/src/constants.ts similarity index 90% rename from apps/funke/src/constants.ts rename to apps/ausweis/src/constants.ts index 7d2b3f7c..cd94c175 100644 --- a/apps/funke/src/constants.ts +++ b/apps/ausweis/src/constants.ts @@ -1,5 +1,5 @@ -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 AUSWEIS_WALLET_SEED_CREDENTIAL_RECORD_ID = 'AUSWEIS_WALLET_SEED_CREDENTIAL_RECORD_ID' +export const AUSWEIS_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID = 'AUSWEIS_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID' // https://demo.pid-issuer.bundesdruckerei.de const bdrPidIssuerCertificate = `-----BEGIN CERTIFICATE----- diff --git a/apps/ausweis/src/crypto/aes.ts b/apps/ausweis/src/crypto/aes.ts new file mode 100644 index 00000000..4f8421d0 --- /dev/null +++ b/apps/ausweis/src/crypto/aes.ts @@ -0,0 +1,4 @@ +import { AUSWEIS_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID } from '@ausweis/constants' +import { aes128Gcm } from '@package/agent' + +export const ausweisAes128Gcm = aes128Gcm(AUSWEIS_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID) diff --git a/apps/funke/src/crypto/bPrime.ts b/apps/ausweis/src/crypto/bPrime.ts similarity index 84% rename from apps/funke/src/crypto/bPrime.ts rename to apps/ausweis/src/crypto/bPrime.ts index 80aeb38b..f378f3cc 100644 --- a/apps/funke/src/crypto/bPrime.ts +++ b/apps/ausweis/src/crypto/bPrime.ts @@ -1,7 +1,7 @@ import { type AgentContext, TypedArrayEncoder } from '@credo-ts/core' import { Key, KeyAlgs, KeyMethod } from '@hyperledger/aries-askar-react-native' import { kdf } from '@package/secure-store/kdf' -import { funkeAes128Gcm } from './aes' +import { ausweisAes128Gcm } from './aes' /** * @@ -13,11 +13,11 @@ import { funkeAes128Gcm } from './aes' * */ export const deriveKeypairFromPin = async (agentContext: AgentContext, pin: Array) => { - if (!(await funkeAes128Gcm.aes128GcmHasKey({ agentContext }))) { + if (!(await ausweisAes128Gcm.aes128GcmHasKey({ agentContext }))) { throw new Error('No AES key found in storage. Flow is called in an incorrect way!') } - const pinSecret = await funkeAes128Gcm.aes128GcmEncrypt({ + const pinSecret = await ausweisAes128Gcm.aes128GcmEncrypt({ agentContext, data: new Uint8Array(pin), }) diff --git a/apps/funke/src/features/onboarding/index.tsx b/apps/ausweis/src/features/onboarding/index.tsx similarity index 100% rename from apps/funke/src/features/onboarding/index.tsx rename to apps/ausweis/src/features/onboarding/index.tsx diff --git a/apps/funke/src/features/onboarding/onboardingContext.tsx b/apps/ausweis/src/features/onboarding/onboardingContext.tsx similarity index 90% rename from apps/funke/src/features/onboarding/onboardingContext.tsx rename to apps/ausweis/src/features/onboarding/onboardingContext.tsx index 267b0c1a..39fc48cb 100644 --- a/apps/funke/src/features/onboarding/onboardingContext.tsx +++ b/apps/ausweis/src/features/onboarding/onboardingContext.tsx @@ -1,12 +1,12 @@ import { sendCommand } from '@animo-id/expo-ausweis-sdk' -import type { SdJwtVcHeader } from '@credo-ts/core' -import { initializeAppAgent, useSecureUnlock } from '@funke/agent' +import { type AppAgent, initializeAppAgent, useSecureUnlock } from '@ausweis/agent' import { ReceivePidUseCase, type ReceivePidUseCaseOptions, type ReceivePidUseCaseState, -} from '@funke/use-cases/ReceivePidUseCase' -import { type FunkeAppAgent, storeCredential } from '@package/agent' +} from '@ausweis/use-cases/ReceivePidUseCase' +import type { SdJwtVcHeader } from '@credo-ts/core' +import { storeCredential } from '@package/agent' import { useToastController } from '@package/ui' import { capitalizeFirstLetter } from '@package/utils' import { useRouter } from 'expo-router' @@ -21,7 +21,14 @@ import { OnboardingIntroductionSteps } from './screens/introduction-steps' import OnboardingPinEnter from './screens/pin' import OnboardingWelcome from './screens/welcome' -type Page = { type: 'fullscreen' } | { type: 'content'; title: string; subtitle?: string; animationKey?: string } +type Page = + | { type: 'fullscreen' } + | { + type: 'content' + title: string + subtitle?: string + animationKey?: string + } // Same animation key means the content won't fade out and then in again. So if the two screens have most content in common // this looks nicer. @@ -149,7 +156,10 @@ export const OnboardingContext = createContext({} as Onboardi export function OnboardingContextProvider({ initialStep, children, -}: PropsWithChildren<{ initialStep?: OnboardingStep['step']; flow?: 'c' | 'bprime' }>) { +}: PropsWithChildren<{ + initialStep?: OnboardingStep['step'] + flow?: 'c' | 'bprime' +}>) { const toast = useToastController() const secureUnlock = useSecureUnlock() const [currentStepName, setCurrentStepName] = useState(initialStep ?? 'welcome') @@ -160,7 +170,7 @@ export function OnboardingContextProvider({ const [walletPin, setWalletPin] = useState() const [idCardPin, setIdCardPin] = useState() const [userName, setUserName] = useState() - const [agent, setAgent] = useState() + const [agent, setAgent] = useState() const currentStep = onboardingStepsCFlow.find((step) => step.step === currentStepName) if (!currentStep) throw new Error(`Invalid step ${currentStepName}`) @@ -209,7 +219,9 @@ export function OnboardingContextProvider({ const onPinReEnter = async (pin: string) => { if (walletPin !== pin) { - toast.show('Pin entries do not match', { customData: { preset: 'danger' } }) + toast.show('Pin entries do not match', { + customData: { preset: 'danger' }, + }) setWalletPin(undefined) goToPreviousStep() throw new Error('Pin entries do not match') @@ -251,7 +263,9 @@ export function OnboardingContextProvider({ }) // If we don't wait for a bit, it will render the keyboard and the nfc modal at the same time... setTimeout(() => { - toast.show('Invalid PIN entered for eID Card. Please try again', { customData: { preset: 'danger' } }) + toast.show('Invalid PIN entered for eID Card. Please try again', { + customData: { preset: 'danger' }, + }) setCurrentStepName('id-card-pin') }, 3000) }) @@ -274,7 +288,10 @@ export function OnboardingContextProvider({ setIdCardPin(pin) if (secureUnlock.state !== 'unlocked') { - reset({ error: 'onIdCardPinEnter: Secure unlock state is not unlocked', resetToStep: 'welcome' }) + reset({ + error: 'onIdCardPinEnter: Secure unlock state is not unlocked', + resetToStep: 'welcome', + }) throw new Error('onIdCardPinEnter: Secure unlock state is not unlocked') } @@ -298,7 +315,13 @@ export function OnboardingContextProvider({ return } - const reset = ({ resetToStep = 'welcome', error }: { error?: unknown; resetToStep: OnboardingStep['step'] }) => { + const reset = ({ + resetToStep = 'welcome', + error, + }: { + error?: unknown + resetToStep: OnboardingStep['step'] + }) => { if (error) console.error(error) const stepsToCompleteAfterReset = onboardingStepsCFlow @@ -339,13 +362,19 @@ export function OnboardingContextProvider({ const onStartScanning = async () => { if (receivePidUseCase?.state !== 'id-card-auth') { - reset({ resetToStep: 'id-card-pin', error: 'onStartScanning: receivePidUseCaseState is not id-card-auth' }) + reset({ + resetToStep: 'id-card-pin', + error: 'onStartScanning: receivePidUseCaseState is not id-card-auth', + }) return } // FIXME: we should probably remove the database here. if (secureUnlock.state !== 'unlocked') { - reset({ resetToStep: 'welcome', error: 'onStartScanning: secureUnlock.state is not unlocked' }) + reset({ + resetToStep: 'welcome', + error: 'onStartScanning: secureUnlock.state is not unlocked', + }) return } @@ -371,7 +400,9 @@ export function OnboardingContextProvider({ { given_name: string; family_name: string } >(credential.compactSdJwtVc) setUserName( - `${capitalizeFirstLetter(parsed.prettyClaims.given_name.toLowerCase())} ${capitalizeFirstLetter(parsed.prettyClaims.family_name.toLowerCase())}` + `${capitalizeFirstLetter(parsed.prettyClaims.given_name.toLowerCase())} ${capitalizeFirstLetter( + parsed.prettyClaims.family_name.toLowerCase() + )}` ) setCurrentStepName('id-card-complete') } catch (error) { diff --git a/apps/funke/src/features/onboarding/screens/biometrics.tsx b/apps/ausweis/src/features/onboarding/screens/biometrics.tsx similarity index 100% rename from apps/funke/src/features/onboarding/screens/biometrics.tsx rename to apps/ausweis/src/features/onboarding/screens/biometrics.tsx diff --git a/apps/funke/src/features/onboarding/screens/id-card-fetch.tsx b/apps/ausweis/src/features/onboarding/screens/id-card-fetch.tsx similarity index 100% rename from apps/funke/src/features/onboarding/screens/id-card-fetch.tsx rename to apps/ausweis/src/features/onboarding/screens/id-card-fetch.tsx diff --git a/apps/funke/src/features/onboarding/screens/id-card-pin.tsx b/apps/ausweis/src/features/onboarding/screens/id-card-pin.tsx similarity index 100% rename from apps/funke/src/features/onboarding/screens/id-card-pin.tsx rename to apps/ausweis/src/features/onboarding/screens/id-card-pin.tsx diff --git a/apps/funke/src/features/onboarding/screens/id-card-scan.tsx b/apps/ausweis/src/features/onboarding/screens/id-card-scan.tsx similarity index 100% rename from apps/funke/src/features/onboarding/screens/id-card-scan.tsx rename to apps/ausweis/src/features/onboarding/screens/id-card-scan.tsx diff --git a/apps/funke/src/features/onboarding/screens/id-card-start-scan.tsx b/apps/ausweis/src/features/onboarding/screens/id-card-start-scan.tsx similarity index 100% rename from apps/funke/src/features/onboarding/screens/id-card-start-scan.tsx rename to apps/ausweis/src/features/onboarding/screens/id-card-start-scan.tsx diff --git a/apps/funke/src/features/onboarding/screens/introduction-steps.tsx b/apps/ausweis/src/features/onboarding/screens/introduction-steps.tsx similarity index 100% rename from apps/funke/src/features/onboarding/screens/introduction-steps.tsx rename to apps/ausweis/src/features/onboarding/screens/introduction-steps.tsx diff --git a/apps/funke/src/features/onboarding/screens/pin.tsx b/apps/ausweis/src/features/onboarding/screens/pin.tsx similarity index 100% rename from apps/funke/src/features/onboarding/screens/pin.tsx rename to apps/ausweis/src/features/onboarding/screens/pin.tsx diff --git a/apps/funke/src/features/onboarding/screens/welcome.tsx b/apps/ausweis/src/features/onboarding/screens/welcome.tsx similarity index 100% rename from apps/funke/src/features/onboarding/screens/welcome.tsx rename to apps/ausweis/src/features/onboarding/screens/welcome.tsx diff --git a/apps/funke/src/polyfills/crypto.ts b/apps/ausweis/src/polyfills/crypto.ts similarity index 100% rename from apps/funke/src/polyfills/crypto.ts rename to apps/ausweis/src/polyfills/crypto.ts diff --git a/apps/funke/src/storage/index.ts b/apps/ausweis/src/storage/index.ts similarity index 100% rename from apps/funke/src/storage/index.ts rename to apps/ausweis/src/storage/index.ts diff --git a/apps/funke/src/storage/seedCredential.ts b/apps/ausweis/src/storage/seedCredential.ts similarity index 50% rename from apps/funke/src/storage/seedCredential.ts rename to apps/ausweis/src/storage/seedCredential.ts index 8bc13ae7..2b5f89df 100644 --- a/apps/funke/src/storage/seedCredential.ts +++ b/apps/ausweis/src/storage/seedCredential.ts @@ -1,18 +1,18 @@ +import { AUSWEIS_WALLET_SEED_CREDENTIAL_RECORD_ID } from '@ausweis/constants' import type { Agent } from '@credo-ts/core' -import { FUNKE_WALLET_SEED_CREDENTIAL_RECORD_ID } from '@funke/constants' import { walletJsonStore } from '@package/agent' export const seedCredentialStorage = { store: async (agent: Agent, seedCredential: string) => - walletJsonStore.store(agent, FUNKE_WALLET_SEED_CREDENTIAL_RECORD_ID, { + walletJsonStore.store(agent, AUSWEIS_WALLET_SEED_CREDENTIAL_RECORD_ID, { seedCredential, }), update: async (agent: Agent, seedCredential: string) => - walletJsonStore.update(agent, FUNKE_WALLET_SEED_CREDENTIAL_RECORD_ID, { + walletJsonStore.update(agent, AUSWEIS_WALLET_SEED_CREDENTIAL_RECORD_ID, { seedCredential, }), getById: async (agent: Agent) => - walletJsonStore.getById<{ seedCredential: string }>(agent, FUNKE_WALLET_SEED_CREDENTIAL_RECORD_ID), + walletJsonStore.getById<{ seedCredential: string }>(agent, AUSWEIS_WALLET_SEED_CREDENTIAL_RECORD_ID), } diff --git a/apps/funke/src/use-cases/ReceivePidUseCase.ts b/apps/ausweis/src/use-cases/ReceivePidUseCase.ts similarity index 98% rename from apps/funke/src/use-cases/ReceivePidUseCase.ts rename to apps/ausweis/src/use-cases/ReceivePidUseCase.ts index c0827222..20202468 100644 --- a/apps/funke/src/use-cases/ReceivePidUseCase.ts +++ b/apps/ausweis/src/use-cases/ReceivePidUseCase.ts @@ -1,6 +1,6 @@ import { AusweisAuthFlow, type AusweisAuthFlowOptions } from '@animo-id/expo-ausweis-sdk' -import type { AppAgent } from '@funke/agent' -import { pidSchemes } from '@funke/constants' +import type { AppAgent } from '@ausweis/agent' +import { pidSchemes } from '@ausweis/constants' import { type OpenId4VciRequestTokenResponse, type OpenId4VciResolvedAuthorizationRequest, diff --git a/apps/funke/src/utils/resetWallet.ts b/apps/ausweis/src/utils/resetWallet.ts similarity index 100% rename from apps/funke/src/utils/resetWallet.ts rename to apps/ausweis/src/utils/resetWallet.ts diff --git a/apps/funke/tamagui.config.ts b/apps/ausweis/tamagui.config.ts similarity index 100% rename from apps/funke/tamagui.config.ts rename to apps/ausweis/tamagui.config.ts diff --git a/apps/funke/tsconfig.json b/apps/ausweis/tsconfig.json similarity index 80% rename from apps/funke/tsconfig.json rename to apps/ausweis/tsconfig.json index 17a8c7b0..ce1f2762 100644 --- a/apps/funke/tsconfig.json +++ b/apps/ausweis/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "rootDir": "./", "paths": { - "@funke/*": ["./apps/funke/src/*"] + "@ausweis/*": ["./apps/ausweis/src/*"] } }, "include": ["./src/**/*.ts", "./src/**/*.tsx", "tamagui.config.ts"] diff --git a/apps/funke/src/agent/initialize.ts b/apps/funke/src/agent/initialize.ts deleted file mode 100644 index 035be89e..00000000 --- a/apps/funke/src/agent/initialize.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { trustedX509Certificates } from '@funke/constants' -import { initializeFunkeAgent } from '@package/agent' - -export function initializeAppAgent({ walletKey }: { walletKey: string }) { - return initializeFunkeAgent({ - keyDerivation: 'raw', - walletId: 'funke-wallet', - walletKey, - walletLabel: 'Funke Wallet', - trustedX509Certificates, - }) -} diff --git a/apps/funke/src/crypto/aes.ts b/apps/funke/src/crypto/aes.ts deleted file mode 100644 index 41c0662e..00000000 --- a/apps/funke/src/crypto/aes.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID } from '@funke/constants' -import { aes128Gcm } from '@package/agent' - -export const funkeAes128Gcm = aes128Gcm(FUNKE_WALLET_INSTANCE_LONG_TERM_AES_KEY_ID) diff --git a/apps/storybook/components/funke/IdCardPinScreen.stories.tsx b/apps/storybook/components/funke/IdCardPinScreen.stories.tsx index c4907d40..6e67b292 100644 --- a/apps/storybook/components/funke/IdCardPinScreen.stories.tsx +++ b/apps/storybook/components/funke/IdCardPinScreen.stories.tsx @@ -9,7 +9,7 @@ import { OnboardingScreensHeader } from '@package/ui/src/components/OnboardingSc import { useArgs } from '@storybook/addons' import { IdCard } from './IdCard' -const germanIssuerImage = require('../../../funke/assets/german-issuer-image.png') +const germanIssuerImage = require('../../../ausweis/assets/german-issuer-image.png') interface IdCardPinScreenProps { pinLength: number diff --git a/packages/agent/src/agent.ts b/packages/agent/src/agent.ts index ecd55d4f..0c68d0a5 100644 --- a/packages/agent/src/agent.ts +++ b/packages/agent/src/agent.ts @@ -53,7 +53,7 @@ const askarModule = new AskarModule({ ariesAskar: ariesAskar, }) -export const initializeFunkeAgent = async ({ +export const initializeAusweisAgent = async ({ walletLabel, walletId, walletKey, @@ -200,8 +200,8 @@ export const initializeFullAgent = async ({ } export type FullAppAgent = Awaited> -export type FunkeAppAgent = Awaited> -export type EitherAgent = FullAppAgent | FunkeAppAgent +export type AusweisAppAgent = Awaited> +export type EitherAgent = FullAppAgent | AusweisAppAgent // biome-ignore lint/suspicious/noExplicitAny: it just needs to extend any, it won't actually be used export const useAgent = = FullAppAgent>(): { diff --git a/packages/agent/src/index.ts b/packages/agent/src/index.ts index 2ce442fd..0fce4ef3 100644 --- a/packages/agent/src/index.ts +++ b/packages/agent/src/index.ts @@ -7,10 +7,10 @@ global.Buffer = Buffer export { initializeFullAgent, - initializeFunkeAgent, + initializeAusweisAgent, useAgent, FullAppAgent, - FunkeAppAgent, + AusweisAppAgent, } from './agent' export * from './providers' export * from './invitation' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b6610ab..12e9d3e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,7 +51,7 @@ importers: specifier: ~5.3.3 version: 5.3.3 - apps/funke: + apps/ausweis: dependencies: '@animo-id/expo-ausweis-sdk': specifier: 0.0.1-alpha.7 diff --git a/tsconfig.json b/tsconfig.json index 1e5dcd33..5468fe01 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "typeRoots": ["./types"], "paths": { "@package/*": ["./packages/*"], - "@funke/*": ["./apps/funke/src/*"], + "@ausweis/*": ["./apps/ausweis/src/*"], "@paradym/*": ["./apps/paradym/*"] } },