Sécurisation du wallet

This commit is contained in:
Brice Zele 2022-04-21 12:14:21 +01:00
parent 441726e561
commit f7679e4f14
15 changed files with 1463 additions and 1201 deletions

View File

@ -129,6 +129,7 @@ android {
pickFirst 'lib/armeabi-v7a/libc++_shared.so' pickFirst 'lib/armeabi-v7a/libc++_shared.so'
} }
lintOptions { checkReleaseBuilds false } lintOptions { checkReleaseBuilds false }
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions { compileOptions {

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,7 @@ buildscript {
minSdkVersion = 16 minSdkVersion = 16
compileSdkVersion = 29 compileSdkVersion = 29
targetSdkVersion = 29 targetSdkVersion = 29
ndkVersion = "21.4.7075529"
} }
repositories { repositories {
google() google()
@ -45,4 +46,4 @@ allprojects {
maven { url 'https://maven.google.com' } maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
} }
} }

View File

@ -15,6 +15,10 @@ import {
LINK_CARD_PENDING, LINK_CARD_PENDING,
LINK_CARD_RESET, LINK_CARD_RESET,
LINK_CARD_SUCCESS, LINK_CARD_SUCCESS,
PASSWORD_VALIDATION_ERROR,
PASSWORD_VALIDATION_PENDING,
PASSWORD_VALIDATION_RESET,
PASSWORD_VALIDATION_SUCCESS,
PAY_BILL_ERROR, PAY_BILL_ERROR,
PAY_BILL_PENDING, PAY_BILL_PENDING,
PAY_BILL_RESET, PAY_BILL_RESET,
@ -319,3 +323,21 @@ export const fetchGetQRCodeDetailError = (error) => ({
type: GET_QR_CODE_DETAIL_ERROR, type: GET_QR_CODE_DETAIL_ERROR,
result: error result: error
}); });
/**
* ---------------------------------------------------
*/
export const fetchPasswordValidationPending = () => ({
type: PASSWORD_VALIDATION_PENDING
});
export const fetchPasswordValidationReset = () => ({
type: PASSWORD_VALIDATION_RESET
});
export const fetchPasswordValidationSuccess = (res) => ({
type: PASSWORD_VALIDATION_SUCCESS,
result: res,
});
export const fetchPasswordValidationError = (error) => ({
type: PASSWORD_VALIDATION_ERROR,
result: error
});

View File

@ -0,0 +1,44 @@
/**
* @Project iLinkWorld
* @File PasswordValidationReducer.js
* @Path redux/reducers
* @Author BRICE ZELE
* @Date 21/04/2022
*/
import * as WalletType from "../types/WalletType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case WalletType.PASSWORD_VALIDATION_PENDING:
return {
...state,
loading: true
}
case WalletType.PASSWORD_VALIDATION_SUCCESS:
return {
...state,
loading: false,
result: action.result.data,
error: null
}
case WalletType.PASSWORD_VALIDATION_ERROR:
return {
...state,
loading: false,
result: null,
error: action.result.data.error
}
case WalletType.PASSWORD_VALIDATION_RESET:
return initialState;
default: {
return state;
}
}
};

View File

@ -80,6 +80,7 @@ import {
} from "../insurance/insurance.reducer"; } from "../insurance/insurance.reducer";
import SearchUserReducer from "./SearchUserReducer"; import SearchUserReducer from "./SearchUserReducer";
import GetQRCodeDetailReducer from "./GetQRCodeDetailReducer"; import GetQRCodeDetailReducer from "./GetQRCodeDetailReducer";
import PasswordValidationReducer from "./PasswordValidationReducer";
const persistConfig = { const persistConfig = {
key: 'root', key: 'root',
@ -193,6 +194,7 @@ const rootReducer = persistCombineReducers(persistConfig, {
checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer, checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer,
searchUserReducer: SearchUserReducer, searchUserReducer: SearchUserReducer,
getQRCodeDetailReducer: GetQRCodeDetailReducer, getQRCodeDetailReducer: GetQRCodeDetailReducer,
passwordValidationReducer: PasswordValidationReducer,
getExclusionReducer: getExclusionReducer getExclusionReducer: getExclusionReducer
}); });

View File

@ -68,3 +68,8 @@ export const GET_QR_CODE_DETAIL_PENDING = 'GET_QR_CODE_DETAIL_PENDING';
export const GET_QR_CODE_DETAIL_SUCCESS = 'GET_QR_CODE_DETAIL_SUCCESS'; export const GET_QR_CODE_DETAIL_SUCCESS = 'GET_QR_CODE_DETAIL_SUCCESS';
export const GET_QR_CODE_DETAIL_ERROR = 'GET_QR_CODE_DETAIL_ERROR'; export const GET_QR_CODE_DETAIL_ERROR = 'GET_QR_CODE_DETAIL_ERROR';
export const GET_QR_CODE_DETAIL_RESET = 'GET_QR_CODE_DETAIL_RESET'; export const GET_QR_CODE_DETAIL_RESET = 'GET_QR_CODE_DETAIL_RESET';
export const PASSWORD_VALIDATION_PENDING = 'PASSWORD_VALIDATION_PENDING';
export const PASSWORD_VALIDATION_SUCCESS = 'PASSWORD_VALIDATION_SUCCESS';
export const PASSWORD_VALIDATION_ERROR = 'PASSWORD_VALIDATION_ERROR';
export const PASSWORD_VALIDATION_RESET = 'PASSWORD_VALIDATION_RESET';

File diff suppressed because it is too large Load Diff

View File

@ -521,8 +521,7 @@ const ExecuterPrescriptionScreen = ({
const ExecuterPrescriptionSchema = Yup.object().shape({ const ExecuterPrescriptionSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string() password: Yup.string(),
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_lastname: Yup.string() practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string() practitioner_firstname: Yup.string()
@ -1632,17 +1631,21 @@ const ExecuterPrescriptionScreen = ({
/> />
</Animatable.View> </Animatable.View>
<TextInput
style={{marginTop: 10}} {
placeholder={I18n.t('PASSWORD')} wallet.password_validation === "MAX" &&
value={values.password} <TextInput
onChangeText={handleChange('password')} style={{marginTop: 10}}
onBlur={handleBlur('password')} placeholder={I18n.t('PASSWORD')}
success={touched.password && !errors.password} value={values.password}
touched={touched.password} onChangeText={handleChange('password')}
error={errors.password} onBlur={handleBlur('password')}
secureTextEntry success={touched.password && !errors.password}
/> touched={touched.password}
error={errors.password}
secureTextEntry
/>
}
<View <View
style={{ style={{

View File

@ -531,8 +531,7 @@ const ModifierExecutionPrescriptionScreen = ({
const ExecuterPrescriptionSchema = Yup.object().shape({ const ExecuterPrescriptionSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string() password: Yup.string(),
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_lastname: Yup.string() practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string() practitioner_firstname: Yup.string()
@ -1617,17 +1616,20 @@ const ModifierExecutionPrescriptionScreen = ({
/> />
</Animatable.View> </Animatable.View>
<TextInput {
style={{marginTop: 10}} wallet.password_validation === "MAX" &&
placeholder={I18n.t('PASSWORD')} <TextInput
value={values.password} style={{marginTop: 10}}
onChangeText={handleChange('password')} placeholder={I18n.t('PASSWORD')}
onBlur={handleBlur('password')} value={values.password}
success={touched.password && !errors.password} onChangeText={handleChange('password')}
touched={touched.password} onBlur={handleBlur('password')}
error={errors.password} success={touched.password && !errors.password}
secureTextEntry touched={touched.password}
/> error={errors.password}
secureTextEntry
/>
}
<View <View
style={{ style={{

View File

@ -598,8 +598,7 @@ const ModifierFeuilleSoinScreen = ({
const ModifierFeuilleSoinSchema = Yup.object().shape({ const ModifierFeuilleSoinSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string() password: Yup.string(),
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_lastname: Yup.string() practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string() practitioner_firstname: Yup.string()
@ -3004,17 +3003,20 @@ const ModifierFeuilleSoinScreen = ({
) )
} }
<TextInput {
style={{marginTop: 10}} wallet.password_validation === "MAX" &&
placeholder={I18n.t('PASSWORD')} <TextInput
value={values.password} style={{marginTop: 10}}
onChangeText={handleChange('password')} placeholder={I18n.t('PASSWORD')}
onBlur={handleBlur('password')} value={values.password}
success={touched.password && !errors.password} onChangeText={handleChange('password')}
touched={touched.password} onBlur={handleBlur('password')}
error={errors.password} success={touched.password && !errors.password}
secureTextEntry touched={touched.password}
/> error={errors.password}
secureTextEntry
/>
}
<View <View
style={{ style={{

View File

@ -679,8 +679,7 @@ const SaisirFeuilleSoinScreen = ({
const SaisirFeuilleSoinSchema = Yup.object().shape({ const SaisirFeuilleSoinSchema = Yup.object().shape({
numero_assure: Yup.string() numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string() password: Yup.string(),
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_lastname: Yup.string() practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')), .required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string() practitioner_firstname: Yup.string()
@ -2057,17 +2056,20 @@ const SaisirFeuilleSoinScreen = ({
) )
} }
<TextInput {
style={{marginTop: 10}} wallet.password_validation === "MAX" &&
placeholder={I18n.t('PASSWORD')} <TextInput
value={values.password} style={{marginTop: 10}}
onChangeText={handleChange('password')} placeholder={I18n.t('PASSWORD')}
onBlur={handleBlur('password')} value={values.password}
success={touched.password && !errors.password} onChangeText={handleChange('password')}
touched={touched.password} onBlur={handleBlur('password')}
error={errors.password} success={touched.password && !errors.password}
secureTextEntry touched={touched.password}
/> error={errors.password}
secureTextEntry
/>
}
<View <View
style={{ style={{

View File

@ -58,7 +58,6 @@ import {useFormik} from "formik";
import * as Animatable from "react-native-animatable"; import * as Animatable from "react-native-animatable";
import {responsiveWidth} from "react-native-responsive-dimensions"; import {responsiveWidth} from "react-native-responsive-dimensions";
import {Dropdown} from "react-native-material-dropdown"; import {Dropdown} from "react-native-material-dropdown";
import PasswordInput from "../../../components/PasswordInput";
import FontAwesome from "react-native-vector-icons/FontAwesome"; import FontAwesome from "react-native-vector-icons/FontAwesome";
import Button from "../../../components/Button"; import Button from "../../../components/Button";
import * as Yup from "yup"; import * as Yup from "yup";
@ -137,7 +136,6 @@ const DemandeAutorisationSoinScreen = ({
const RegisterSchema = Yup.object().shape({ const RegisterSchema = Yup.object().shape({
password: Yup.string() password: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED'))
}); });
useEffect(() => { useEffect(() => {
@ -745,18 +743,21 @@ const DemandeAutorisationSoinScreen = ({
/> />
</Animatable.View> </Animatable.View>
<PasswordInput {
style={{marginTop: 10, width: responsiveWidth(90)}} wallet.password_validation === "MAX" &&
onChangeText={handleChange('password')} <TextInput
placeholder={I18n.t('PASSWORD')} style={{marginTop: 10, width: responsiveWidth(90)}}
secureTextEntry onChangeText={handleChange('password')}
icon={<FontAwesome name="lock" size={20}/>} placeholder={I18n.t('PASSWORD')}
value={values.password} secureTextEntry
onBlur={handleBlur('password')} icon={<FontAwesome name="lock" size={20}/>}
success={touched.password && !errors.password} value={values.password}
touched={touched.password} onBlur={handleBlur('password')}
error={errors.password} success={touched.password && !errors.password}
/> touched={touched.password}
error={errors.password}
/>
}
<Button <Button
style={{marginTop: 20}} style={{marginTop: 20}}

View File

@ -102,6 +102,7 @@ export const getNetworkActsUrl = testBaseUrl + '/nanoSanteService/acts';
export const createConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/consultation'; export const createConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/consultation';
export const executionPrescriptionUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/execution'; export const executionPrescriptionUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/execution';
export const consultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets'; export const consultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets';
export const passwordValidationUrl = testBaseUrl + '/nanoSanteService/password-validation';
export const getAmountConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/performances-amount'; export const getAmountConsultationUrl = testBaseUrl + '/nanoSanteService/health-care-sheets/performances-amount';
export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount'; export const getInsurancePrimeAmountUrl = testBaseUrl + '/nanoSanteService/insurances/subscriptions/bonus-amount';
export const autorisationCareRequestUrl = testBaseUrl + '/nanoSanteService/authorizations-care-requests'; export const autorisationCareRequestUrl = testBaseUrl + '/nanoSanteService/authorizations-care-requests';

View File

@ -5,6 +5,7 @@ import {
getQRCodeDetail, getQRCodeDetail,
linkBankAccountUrl, linkBankAccountUrl,
linkCardUrl, linkCardUrl,
passwordValidationUrl,
payBillUrl, payBillUrl,
searchUserHomeUrl, searchUserHomeUrl,
searchUserUrl, searchUserUrl,
@ -29,6 +30,10 @@ import {
fetchLinkCardPending, fetchLinkCardPending,
fetchLinkCardReset, fetchLinkCardReset,
fetchLinkCardSuccess, fetchLinkCardSuccess,
fetchPasswordValidationError,
fetchPasswordValidationPending,
fetchPasswordValidationReset,
fetchPasswordValidationSuccess,
fetchPayBillError, fetchPayBillError,
fetchPayBillPending, fetchPayBillPending,
fetchPayBillReset, fetchPayBillReset,
@ -435,4 +440,41 @@ export const getQRCodeDetailReset = () => {
return dispatch => { return dispatch => {
dispatch(fetchGetQRCodeDetailReset()); dispatch(fetchGetQRCodeDetailReset());
} }
};
export const passwordValidationAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchPasswordValidationPending());
axios({
url: `${passwordValidationUrl}`,
method: 'POST',
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
},
data
})
.then(response => {
console.log(response);
dispatch(fetchPasswordValidationSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchPasswordValidationError(error.response));
else if (error.request)
dispatch(fetchPasswordValidationError(error.request));
else
dispatch(fetchPasswordValidationError(error.message));
});
}
}
export const passwordValidationReset = () => {
return dispatch => {
dispatch(fetchPasswordValidationReset());
}
}; };