Merge branch 'master' into test_deployment_v2

This commit is contained in:
Wolfgang Hottgenroth 2021-12-15 16:47:45 +01:00
commit 67c8d55ad4
2 changed files with 5 additions and 0 deletions

View File

@ -138,6 +138,7 @@ namespace com.krohne.genericdatabaseapiservice.Services {
var sep = "";
foreach (var x in p1) {
if (! (x is int || x is long)) {
Logger.LogError("Parameter binding by string replacement is for security reasons only allowed for numbers");
throw new StringReplacementNotAllowedException();
}
Logger.LogInformation("x: {0}", x);
@ -149,6 +150,7 @@ namespace com.krohne.genericdatabaseapiservice.Services {
Logger.LogInformation("Input Value: p3:{0} typ:{1} isList:{2}", p3, typ, isList);
if (bindingByStringReplacement) {
if (commandTextSet) {
Logger.LogError("Parameter bindung by string replacement is only supported for a single parameter");
throw new StringReplacementNotAllowedException("string replacement only allowed for numeric parameters");
}
var processedStatement = selectStatement.Replace(String.Format("@{0}", dma.Name), p3);
@ -160,6 +162,7 @@ namespace com.krohne.genericdatabaseapiservice.Services {
}
} else {
if (bindingByStringReplacement) {
Logger.LogError("Parameter binding by string replacement is only supported for array parameters");
throw new StringReplacementNotAllowedException("string replacement only allowed to handle lists of parameters");
}
Logger.LogInformation("Input Value: {0} {1} {2}", value, typ, isList);
@ -205,6 +208,7 @@ namespace com.krohne.genericdatabaseapiservice.Services {
propertyInfo.SetValue(item, value);
Logger.LogInformation("Output Value:{0}", value);
} else {
Logger.LogError("Unsupported data type {0}", propertyInfo.PropertyType);
throw new UnsupportedDataTypeException(String.Format("{0}", propertyInfo.PropertyType));
}
}

View File

@ -42,6 +42,7 @@ RUN cd /tmp/work && ./generateAll.sh -k2c
FROM wollud1969/dotnetcore5sdk:1.0.0
ENV Database__InfoFile "/opt/service/config/databaseInfo.json"
ENV Logging__LogLevel__Default "Information"
RUN \
useradd -d /opt/service -m service && \