Skip to content

Commit

Permalink
MOSIP-32267 updating automation script according to ui changes And ad…
Browse files Browse the repository at this point in the history
…ding testcases (mosip#1364)

* MOSIP-31384

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflict

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflict

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-31384

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* incorprated changes

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* INJIMOB-924 MOSIP-31927

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-31384

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-31874

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-31384

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conlifcts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* resolve conflicts

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* updating to unblock deveops

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

* MOSIP-32267 MOSIP-32204

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>

---------

Signed-off-by: Anup Nehe <anup.nehe@technoforte.co.in>
  • Loading branch information
anup-nehe authored and abhip2565 committed Apr 10, 2024
1 parent a732821 commit f0a95c3
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 19 deletions.
Binary file added debug.keystore
Binary file not shown.
7 changes: 3 additions & 4 deletions ios/Inji.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Inji/Inji.entitlements;
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = V2ABX7953Z;
DEVELOPMENT_TEAM = V2ABX7953Z;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -458,7 +458,6 @@
PRODUCT_BUNDLE_IDENTIFIER = io.mosip.inji.wallet.mobileid;
PRODUCT_NAME = Inji;
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development io.mosip.inji.wallet.mobileid";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ PODS:
- React-jsi (= 0.71.8)
- React-logger (= 0.71.8)
- React-perflogger (= 0.71.8)
- RNAppleAuthentication (2.3.0):
- React-Core
- RNArgon2 (2.0.1):
- CatCrypto
- React-Core
Expand Down Expand Up @@ -607,6 +609,7 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNAppleAuthentication (from `../node_modules/@invertase/react-native-apple-authentication`)"
- RNArgon2 (from `../node_modules/react-native-argon2`)
- RNBluetoothStateManager (from `../node_modules/react-native-bluetooth-state-manager`)
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
Expand Down Expand Up @@ -790,6 +793,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNAppleAuthentication:
:path: "../node_modules/@invertase/react-native-apple-authentication"
RNArgon2:
:path: "../node_modules/react-native-argon2"
RNBluetoothStateManager:
Expand Down Expand Up @@ -913,6 +918,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 43ffd976a25f6057a7cf95ea3648ba4e00287f89
React-runtimeexecutor: 7c51ae9d4b3e9608a2366e39ccaa606aa551b9ed
ReactCommon: 85c98ab0a509e70bf5ee5d9715cf68dbf495b84c
RNAppleAuthentication: e99eaf3c4c01ad8ecb6125dd6f0cfd98871685b5
RNArgon2: 1481820722fd4af1575c09f7fc9ad67c00ee8a42
RNBluetoothStateManager: ae6a26260cbdf1827b58bd3bcc563527d61e6488
RNCClipboard: 3f0451a8100393908bea5c5c5b16f96d45f30bfc
Expand Down
2 changes: 1 addition & 1 deletion machines/backupAndRestore/backupAndRestoreSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const backupAndRestoreSetupMachine = model.createMachine(
'setErrorReasonAsAccountRequired',
'sendBackupAndRestoreSetupErrorEvent',
],
target: '.error',
target: 'signIn', // Abhisheks changes (.error)
},
{
actions: ['unsetIsLoading'],
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@digitalcredentials/vc": "^1.1.2",
"@expo-google-fonts/inter": "^0.2.3",
"@expo/metro-config": "~0.10.0",
"@invertase/react-native-apple-authentication": "^2.3.0",
"@iriscan/biometric-sdk-react-native": "0.2.6",
"@mosip/secure-keystore": "^0.1.7",
"@mosip/tuvali": "^0.4.9",
Expand Down
2 changes: 1 addition & 1 deletion screens/backupAndRestore/AccountSelectionConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '../../components/ui';
import {Theme} from '../../components/ui/styleUtils';
import {SvgImage} from '../../components/ui/svg';
import {DRIVE_NAME_MATCHER, isAndroid} from '../../shared/constants';
import {isAndroid} from '../../shared/constants';
import {getDriveName} from '../../shared/commonUtil';
import {Modal} from '../../components/ui/Modal';

Expand Down
43 changes: 33 additions & 10 deletions screens/backupAndRestore/BackupAndRestoreScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,27 @@ const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
</SectionLayout>
);

const IosAccountSection = (
<SectionLayout
testId="AccountSection"
headerText={''}
headerIcon={SvgImage.ICloudIcon(86, 25)}>
<View style={{marginBottom: 19}}>
<Text
testID="storageInfo"
style={Theme.BackupAndRestoreStyles.backupProgressText}>
{t(
'The backup will be stored in the iCloud associated to your chosen Apple account',
)}
</Text>
</View>
<AccountInformation
email={props.profileInfo?.email}
picture={props.profileInfo?.picture}
/>
</SectionLayout>
);

const RestoreSection = (
<SectionLayout
testId="restoreSection"
Expand Down Expand Up @@ -199,17 +220,18 @@ const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
arrowLeft={true}
headerRight={
<HelpScreen
source={'BackUp'}
source={'Inji'}
triggerComponent={
<Icon
{...testIDProps('help')}
accessible={true}
name="question"
type="font-awesome"
size={21}
style={Theme.Styles.IconContainer}
color={Theme.Colors.Icon}
/>
<View testID="helop" style={Theme.HelpScreenStyle.viewStyle}>
<Row crossAlign="center" style={Theme.HelpScreenStyle.rowStyle}>
<View testID="helpIcon" style={Theme.HelpScreenStyle.iconStyle}>
{SvgImage.infoIcon()}
</View>
<Text testID="help" style={Theme.HelpScreenStyle.labelStyle}>
{t('Help?')}
</Text>
</Row>
</View>
}
/>
}
Expand All @@ -228,6 +250,7 @@ const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
<ScrollView>
{LastBackupSection}
{isAndroid() && AccountSection}
{isIOS() && IosAccountSection}
{RestoreSection}
</ScrollView>
)}
Expand Down
48 changes: 45 additions & 3 deletions shared/CloudBackupAndRestoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import {CloudStorage, CloudStorageScope} from 'react-native-cloud-storage';
import {GOOGLE_ANDROID_CLIENT_ID} from 'react-native-dotenv';
import {readFile, writeFile} from 'react-native-fs';
import {BackupDetails} from '../types/backup-and-restore/backup';
import {
AppleButton,
appleAuth,
} from '@invertase/react-native-apple-authentication';

import {bytesToMB, sleep} from './commonUtil';
import {
IOS_SIGNIN_FAILED,
Expand Down Expand Up @@ -128,7 +133,44 @@ class Cloud {

static async signIn(): Promise<SignInResult | IsIOSResult> {
if (isIOS()) {
return {isIOS: true};
let profile: {email: string | null; picture: undefined};
console.warn('Beginning Apple Authentication');

// start a login request
try {
const appleAuthRequestResponse = await appleAuth.performRequest({
requestedOperation: appleAuth.Operation.LOGIN,
requestedScopes: [appleAuth.Scope.EMAIL, appleAuth.Scope.FULL_NAME],
});

console.log('appleAuthRequestResponse', appleAuthRequestResponse);

const {email, nonce, identityToken, realUserStatus /* etc */} =
appleAuthRequestResponse;

if (identityToken) {
// e.g. sign in with Firebase Auth using `nonce` & `identityToken`
console.log(nonce, identityToken);
} else {
// no token - failed sign-in?
}

if (realUserStatus === appleAuth.UserStatus.LIKELY_REAL) {
console.log("I'm a real person!");
}
profile = {email: email, picture: undefined};
console.warn(`Apple Authentication Completed, ${email}`);
} catch (error) {
if (error.code === appleAuth.Error.CANCELED) {
console.warn('User canceled Apple Sign in.');
} else {
console.error(error);
}
}

// Extract the user's email address from the response

return {status: this.status.SUCCESS, profileInfo: profile};
}
this.configure();
try {
Expand Down Expand Up @@ -413,8 +455,8 @@ class Cloud {
export default Cloud;

export type ProfileInfo = {
email: string;
picture: string;
email: string | undefined | null;
picture: string | undefined;
};

export type SignInResult = {
Expand Down

0 comments on commit f0a95c3

Please sign in to comment.