Updated more tests
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.polysubstitution.PolybiusSquare;
|
||||
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/polybius")
|
||||
public class PolybiusSquareController{
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_DESCRIPTION);
|
||||
}
|
||||
|
||||
@GetMapping("/encode")
|
||||
public ObjectNode encodePolybius(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Polybius Square");
|
||||
log.info("Encoding Polybius");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
|
||||
log.info("Encoding {}", CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyPolybiusParams(cipherParams);
|
||||
@@ -43,8 +53,8 @@ public class PolybiusSquareController{
|
||||
|
||||
@GetMapping("/decode")
|
||||
public ObjectNode decodePolybius(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Polybius Square");
|
||||
log.info("Decoding Polybius");
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
|
||||
log.info("Decoding {}", CipherInfoUtil.POLYBIUS_SQUARE_CIPHER_NAME);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyPolybiusParams(cipherParams);
|
||||
|
||||
Reference in New Issue
Block a user