Overview
mobileAuth.ts accepts a BiometricType return value from an abstract method without runtime validation. In a mocked or test environment, any string can be passed as the biometric type, bypassing the type guard.
Specifications
Features:
- Add a runtime validation function
isValidBiometricType(value: unknown): value is BiometricType
- Call it before using the biometric type to authenticate
Tasks:
- Define a
VALID_BIOMETRIC_TYPES constant array
- Implement the type guard
- Call the guard before biometric operations
- Write tests for invalid biometric type values
Impacted Files:
src/services/mobileAuth.ts
Acceptance Criteria
- Invalid biometric types are rejected with a clear error
- No runtime spoofing possible even in test environments
- Type guard has 100% test coverage
Overview
mobileAuth.tsaccepts aBiometricTypereturn value from an abstract method without runtime validation. In a mocked or test environment, any string can be passed as the biometric type, bypassing the type guard.Specifications
Features:
isValidBiometricType(value: unknown): value is BiometricTypeTasks:
VALID_BIOMETRIC_TYPESconstant arrayImpacted Files:
src/services/mobileAuth.tsAcceptance Criteria