mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-20 19:57:44 +02:00
Let the Import feature accept migrations with missing data
This commit is contained in:
parent
d902e3ecae
commit
d2fc93d78f
@ -87,12 +87,12 @@ class MigratorFactory implements MigratorFactoryInterface
|
|||||||
return count(Validator::validate(
|
return count(Validator::validate(
|
||||||
$json,
|
$json,
|
||||||
[
|
[
|
||||||
'data.*.otp_type' => 'required',
|
'data.*.otp_type' => 'present',
|
||||||
'data.*.service' => 'required',
|
'data.*.service' => 'present',
|
||||||
'data.*.account' => 'required',
|
'data.*.account' => 'present',
|
||||||
'data.*.secret' => 'required',
|
'data.*.secret' => 'present',
|
||||||
'data.*.digits' => 'required',
|
'data.*.digits' => 'present',
|
||||||
'data.*.algorithm' => 'required',
|
'data.*.algorithm' => 'present',
|
||||||
'data.*.period' => 'present',
|
'data.*.period' => 'present',
|
||||||
'data.*.counter' => 'present',
|
'data.*.counter' => 'present',
|
||||||
]
|
]
|
||||||
@ -135,10 +135,10 @@ class MigratorFactory implements MigratorFactoryInterface
|
|||||||
return count(Validator::validate(
|
return count(Validator::validate(
|
||||||
$json,
|
$json,
|
||||||
[
|
[
|
||||||
'db.entries.*.type' => 'required',
|
'db.entries.*.type' => 'present',
|
||||||
'db.entries.*.name' => 'required',
|
'db.entries.*.name' => 'present',
|
||||||
'db.entries.*.issuer' => 'required',
|
'db.entries.*.issuer' => 'present',
|
||||||
'db.entries.*.info' => 'required',
|
'db.entries.*.info' => 'present',
|
||||||
]
|
]
|
||||||
)) > 0;
|
)) > 0;
|
||||||
}
|
}
|
||||||
@ -185,9 +185,9 @@ class MigratorFactory implements MigratorFactoryInterface
|
|||||||
return count(Validator::validate(
|
return count(Validator::validate(
|
||||||
$json,
|
$json,
|
||||||
[
|
[
|
||||||
'services.*.secret' => 'required',
|
'services.*.secret' => 'present',
|
||||||
'services.*.name' => 'required',
|
'services.*.name' => 'present',
|
||||||
'services.*.otp' => 'required',
|
'services.*.otp' => 'present',
|
||||||
]
|
]
|
||||||
)) > 0;
|
)) > 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user