public ChildSettings(Settings parentSettings) { super(parentSettings.getDefinitions(), parentSettings.getEncryption()); this.parentSettings = parentSettings; }
@Override public void handle(Request request, Response response) throws Exception { userSession.checkIsSystemAdministrator(); String value = request.mandatoryParam(PARAM_VALUE); checkRequest(!value.isEmpty(), "Parameter '%s' must not be empty", PARAM_VALUE); Encryption encryption = settings.getEncryption(); checkRequest(encryption.hasSecretKey(), "No secret key available"); String encryptedValue = encryption.encrypt(value); writeProtobuf(toEncryptWsResponse(encryptedValue), request, response); }
@Override public void handle(Request request, Response response) throws Exception { userSession.checkIsSystemAdministrator(); writeProtobuf(CheckSecretKeyWsResponse.newBuilder().setSecretKeyAvailable(settings.getEncryption().hasSecretKey()).build(), request, response); } }
@Override public void handle(Request request, Response response) throws Exception { userSession.checkIsSystemAdministrator(); writeProtobuf(GenerateSecretKeyWsResponse.newBuilder().setSecretKey(settings.getEncryption().generateRandomSecretKey()).build(), request, response); } }
public ChildSettings(Settings parentSettings) { super(parentSettings.getDefinitions(), parentSettings.getEncryption()); this.parentSettings = parentSettings; }
@Override public void handle(Request request, Response response) throws Exception { userSession.checkIsSystemAdministrator(); String value = request.mandatoryParam(PARAM_VALUE); checkRequest(!value.isEmpty(), "Parameter '%s' must not be empty", PARAM_VALUE); Encryption encryption = settings.getEncryption(); checkRequest(encryption.hasSecretKey(), "No secret key available"); String encryptedValue = encryption.encrypt(value); writeProtobuf(toEncryptWsResponse(encryptedValue), request, response); }
@Override public void handle(Request request, Response response) throws Exception { userSession.checkIsSystemAdministrator(); writeProtobuf(CheckSecretKeyWsResponse.newBuilder().setSecretKeyAvailable(settings.getEncryption().hasSecretKey()).build(), request, response); } }
@Override public void handle(Request request, Response response) throws Exception { userSession.checkIsSystemAdministrator(); writeProtobuf(GenerateSecretKeyWsResponse.newBuilder().setSecretKey(settings.getEncryption().generateRandomSecretKey()).build(), request, response); } }