Begin test update
This commit is contained in:
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Affine;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/affine")
|
||||
public class AffineCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AFFINE_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.AFFINE_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.AFFINE_CIPHER_NAME, CipherInfoUtil.AFFINE_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeAffine(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Affine");
|
||||
log.info("Encoding Affine");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AFFINE_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.AFFINE_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyAffineParams(cipherParams);
|
||||
@@ -45,8 +55,8 @@ public class AffineCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeAffine(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Affine");
|
||||
log.info("Decoding Affine");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AFFINE_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.AFFINE_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyAffineParams(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Atbash;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/atbash")
|
||||
public class AtbashCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ATBASH_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.ATBASH_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ATBASH_CIPHER_NAME, CipherInfoUtil.ATBASH_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeAtbash(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Atbash");
|
||||
log.info("Encoding Atbash");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ATBASH_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.ATBASH_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyAtbashParams(cipherParams);
|
||||
@@ -43,8 +53,8 @@ public class AtbashCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeAtbash(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Atbash");
|
||||
log.info("Decoding Atbash");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ATBASH_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.ATBASH_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyAtbashParams(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Autokey;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/autokey")
|
||||
public class AutokeyCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AUTOKEY_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.AUTOKEY_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.AUTOKEY_CIPHER_NAME, CipherInfoUtil.AUTOKEY_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeAutokey(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Autokey");
|
||||
log.info("Encoding Autokey");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AUTOKEY_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.AUTOKEY_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
@@ -44,8 +54,8 @@ public class AutokeyCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeAutokey(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Autokey");
|
||||
log.info("Decoding Autokey");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.AUTOKEY_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.AUTOKEY_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Baconian;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/baconian")
|
||||
public class BaconianCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BACONIAN_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.BACONIAN_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BACONIAN_CIPHER_NAME, CipherInfoUtil.BACONIAN_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeBaconian(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Baconian");
|
||||
log.info("Encoding Baconian");
|
||||
log.info("Encoding {}", CipherInfoUtil.BACONIAN_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyBaconianParams(cipherParams);
|
||||
@@ -42,7 +52,7 @@ public class BaconianCipherController{
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeBaconian(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Baconian");
|
||||
log.info("Decoding Baconian");
|
||||
log.info("Decoding {}", CipherInfoUtil.BACONIAN_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyBaconianParams(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.BaseX;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/basex")
|
||||
public class BaseXCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BASE_X_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.BASE_X_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BASE_X_CIPHER_NAME, CipherInfoUtil.BASE_X_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeBaseX(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "BaseX");
|
||||
log.info("Encoding BaseX");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BASE_X_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.BASE_X_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyBaseXParams(cipherParams);
|
||||
@@ -41,8 +51,8 @@ public class BaseXCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeBaseX(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "BaseX");
|
||||
log.info("Decoding BaseX");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BASE_X_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.BASE_X_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyBaseXParams(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Beaufort;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/beaufort")
|
||||
public class BeaufortCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BEAUFORT_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.BEAUFORT_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BEAUFORT_CIPHER_NAME, CipherInfoUtil.BEAUFORT_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeBeaufort(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Beaufort");
|
||||
log.info("Encoding Beaufort");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BEAUFORT_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.BEAUFORT_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
@@ -44,8 +54,8 @@ public class BeaufortCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeBeaufort(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Beaufort");
|
||||
log.info("Decoding Beaufort");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BEAUFORT_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.BEAUFORT_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Caesar;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/caesar")
|
||||
public class CaesarCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.CAESAR_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.CAESAR_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.CAESAR_CIPHER_NAME, CipherInfoUtil.CAESAR_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeCaesar(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Caesar");
|
||||
log.info("Encoding Caesar");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.CAESAR_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.CAESAR_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyCaesarParams(cipherParams);
|
||||
@@ -44,8 +54,8 @@ public class CaesarCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeCaesar(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Caesar");
|
||||
log.info("Decoding Caesar");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.CAESAR_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.CAESAR_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyCaesarParams(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.OneTimePad;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/oneTimePad")
|
||||
public class OneTimePadCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME, CipherInfoUtil.ONE_TIME_PAD_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeOneTimePad(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "One-Time Pad");
|
||||
log.info("Encoding One Time Pad");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
@@ -44,8 +54,8 @@ public class OneTimePadCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeOneTimePad(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "One-Time Pad");
|
||||
log.info("Decoding One Time Pad");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.ONE_TIME_PAD_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Porta;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/porta")
|
||||
public class PortaCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PORTA_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.PORTA_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.PORTA_CIPHER_NAME, CipherInfoUtil.PORTA_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodePorta(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Porta");
|
||||
log.info("Encoding Porta");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PORTA_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.PORTA_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
@@ -44,8 +54,8 @@ public class PortaCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodePorta(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Porta");
|
||||
log.info("Decoding Porta");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.PORTA_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.PORTA_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Substitution;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/substitution")
|
||||
public class SubstitutionCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.SUBSTITUTION_CIPHER_NAME, CipherInfoUtil.SUBSTITUTION_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeSubstitution(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Substitution");
|
||||
log.info("Encoding Substitution");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
@@ -44,8 +54,8 @@ public class SubstitutionCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeSubstitution(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Substitution");
|
||||
log.info("Decoding Substitution");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.SUBSTITUTION_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.mattrixwv.cipherstream.aspect.CipherStreamLoggingAspect;
|
||||
import com.mattrixwv.cipherstream.monosubstitution.Vigenere;
|
||||
import com.mattrixwv.cipherstream.utils.CipherInfoUtil;
|
||||
import com.mattrixwv.cipherstream.utils.CipherParameterUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,10 +20,19 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RestController
|
||||
@RequestMapping("/cipherStream/vigenere")
|
||||
public class VigenereCipherController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.VIGENERE_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.VIGENERE_CIPHER_NAME, CipherInfoUtil.VIGENERE_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodeVigenere(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Vigenere");
|
||||
log.info("Encoding Vigenere");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.VIGENERE_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
@@ -44,8 +54,8 @@ public class VigenereCipherController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodeVigenere(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Vigenere");
|
||||
log.info("Decoding Vigenere");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.VIGENERE_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.VIGENERE_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyParamsWithKeyword(cipherParams);
|
||||
|
||||
Reference in New Issue
Block a user