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'
}
lintOptions { checkReleaseBuilds false }
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {

File diff suppressed because one or more lines are too long

View File

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

View File

@ -15,6 +15,10 @@ import {
LINK_CARD_PENDING,
LINK_CARD_RESET,
LINK_CARD_SUCCESS,
PASSWORD_VALIDATION_ERROR,
PASSWORD_VALIDATION_PENDING,
PASSWORD_VALIDATION_RESET,
PASSWORD_VALIDATION_SUCCESS,
PAY_BILL_ERROR,
PAY_BILL_PENDING,
PAY_BILL_RESET,
@ -319,3 +323,21 @@ export const fetchGetQRCodeDetailError = (error) => ({
type: GET_QR_CODE_DETAIL_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";
import SearchUserReducer from "./SearchUserReducer";
import GetQRCodeDetailReducer from "./GetQRCodeDetailReducer";
import PasswordValidationReducer from "./PasswordValidationReducer";
const persistConfig = {
key: 'root',
@ -193,6 +194,7 @@ const rootReducer = persistCombineReducers(persistConfig, {
checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer,
searchUserReducer: SearchUserReducer,
getQRCodeDetailReducer: GetQRCodeDetailReducer,
passwordValidationReducer: PasswordValidationReducer,
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_ERROR = 'GET_QR_CODE_DETAIL_ERROR';
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({
numero_assure: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
password: Yup.string(),
practitioner_lastname: Yup.string()
.required(I18n.t('THIS_FIELD_IS_REQUIRED')),
practitioner_firstname: Yup.string()
@ -1632,17 +1631,21 @@ const ExecuterPrescriptionScreen = ({
/>
</Animatable.View>
<TextInput
style={{marginTop: 10}}
placeholder={I18n.t('PASSWORD')}
value={values.password}
onChangeText={handleChange('password')}
onBlur={handleBlur('password')}
success={touched.password && !errors.password}
touched={touched.password}
error={errors.password}
secureTextEntry
/>
{
wallet.password_validation === "MAX" &&
<TextInput
style={{marginTop: 10}}
placeholder={I18n.t('PASSWORD')}
value={values.password}
onChangeText={handleChange('password')}
onBlur={handleBlur('password')}
success={touched.password && !errors.password}
touched={touched.password}
error={errors.password}
secureTextEntry
/>
}
<View
style={{

View File

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

View File

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

View File

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

View File

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

View File

@ -5,6 +5,7 @@ import {
getQRCodeDetail,
linkBankAccountUrl,
linkCardUrl,
passwordValidationUrl,
payBillUrl,
searchUserHomeUrl,
searchUserUrl,
@ -29,6 +30,10 @@ import {
fetchLinkCardPending,
fetchLinkCardReset,
fetchLinkCardSuccess,
fetchPasswordValidationError,
fetchPasswordValidationPending,
fetchPasswordValidationReset,
fetchPasswordValidationSuccess,
fetchPayBillError,
fetchPayBillPending,
fetchPayBillReset,
@ -435,4 +440,41 @@ export const getQRCodeDetailReset = () => {
return dispatch => {
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());
}
};