Update cipher descriptions
This commit is contained in:
@@ -2,6 +2,8 @@ package com.mattrixwv.cipherstream.controller.monosubstitution;
|
||||
|
||||
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -20,20 +22,27 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/baconian")
|
||||
@PropertySource("classpath:ciphers.properties")
|
||||
public class BaconianCipherController{
|
||||
@Value("${cipher.mono.baconian.name}")
|
||||
private String baconianName;
|
||||
@Value("${cipher.mono.baconian.description}")
|
||||
private String baconianDescription;
|
||||
|
||||
|
||||
@GetMapping
|
||||
public ObjectNode getCipherInfo(){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, CipherInfoUtil.BACONIAN_CIPHER_NAME);
|
||||
log.info("Getting info for {}", CipherInfoUtil.BACONIAN_CIPHER_NAME);
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName);
|
||||
log.info("Getting info for {}", baconianName);
|
||||
|
||||
|
||||
return CipherInfoUtil.buildInfoNode(CipherInfoUtil.BACONIAN_CIPHER_NAME, CipherInfoUtil.BACONIAN_CIPHER_DESCRIPTION);
|
||||
return CipherInfoUtil.buildInfoNode(baconianName, baconianDescription);
|
||||
}
|
||||
|
||||
@PostMapping("/encode")
|
||||
public ObjectNode encodeBaconian(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Baconian");
|
||||
log.info("Encoding {}", CipherInfoUtil.BACONIAN_CIPHER_NAME);
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName);
|
||||
log.info("Encoding {}", baconianName);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyBaconianParams(cipherParams);
|
||||
@@ -52,8 +61,8 @@ public class BaconianCipherController{
|
||||
|
||||
@PostMapping("/decode")
|
||||
public ObjectNode decodeBaconian(@RequestBody ObjectNode cipherParams){
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, "Baconian");
|
||||
log.info("Decoding {}", CipherInfoUtil.BACONIAN_CIPHER_NAME);
|
||||
MDC.put(CipherStreamLoggingAspect.CIPHER_NAME_LOGGING, baconianName);
|
||||
log.info("Decoding {}", baconianName);
|
||||
|
||||
|
||||
CipherParameterUtil.verifyBaconianParams(cipherParams);
|
||||
|
||||
Reference in New Issue
Block a user