Nouvelles Regex : CLIENT_SAVE_FILE validée

This commit is contained in:
Maximilien LEDOUX 2022-03-19 13:02:37 +01:00
parent be133a55dc
commit 5a909b65aa
2 changed files with 7 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package lightcontainer.protocol.rules.reader;
import lightcontainer.domains.client.Context;
import lightcontainer.interfaces.ProtocolRepository;
import lightcontainer.protocol.ProtocolReader;
import lightcontainer.protocol.StandardizedDefinitions;
import lightcontainer.protocol.rules.writer.SaveFileErrorRule;
import lightcontainer.protocol.rules.writer.SendfileRule;
import lightcontainer.utils.AES_GCM;
@ -13,13 +14,16 @@ import lightcontainer.utils.ShaHasher;
import java.io.IOException;
import java.io.InputStream;
import static lightcontainer.protocol.StandardizedDefinitions.CLIENT_SAVE_FILE;
/**
* Règle permettant de sauvegarder un fichier sur le SBE.
* Celui-ci va chiffre le contenu du fichier à l'aide de AES.
*/
public class SavefileRule extends ProtocolReader {
// Constants
private static final String PATTERN = "^SAVEFILE ([^ !]{1,20}) ([0-9]{1,10})\r\n$";
//"^SAVEFILE ([^ !]{1,20}) ([0-9]{1,10})\r\n$"
private static final String PATTERN = CLIENT_SAVE_FILE;
private static final String NAME = "SAVEFILE";

View File

@ -13,9 +13,9 @@
"files": [
{
"name": "test.txt",
"fileNameSalt": "LvFNF7uz324NgsISSpUbwg==",
"fileNameSalt": "4DMHDs7+7lS8iw/SZYsdbA==",
"size": 301,
"iv": "lGvyIzgGMiaiHeGwIaCESg==",
"iv": "Yuq6QN1WYFm7DZzO+svKGw==",
"storage": [
"lightcontainerSB01"
]