Compare commits

...

6 Commits

Author SHA1 Message Date
TIP Automation User
08df7ff714 Chg: update image tag in helm values to v2.7.0 2022-10-05 11:32:49 +00:00
TIP Automation User
ad4ac98d1a Chg: update image tag in helm values to v2.7.0-RC5 2022-10-05 02:45:49 +00:00
jaspreetsachdev
6633a23635 Merge pull request #87 from Telecominfraproject/main
Fixes for WIFI-10942
2022-10-04 22:41:15 -04:00
stephb9959
e398d3cf4b Merge remote-tracking branch 'origin/main' 2022-10-04 08:10:32 -07:00
stephb9959
f53cc82df1 https://telecominfraproject.atlassian.net/browse/WIFI-10942
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
2022-10-04 08:10:24 -07:00
Johann Hoffmann
3f9edc80e0 Add userRole argument to createuser and createuser_v functions
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-10-04 13:15:30 +02:00
4 changed files with 59 additions and 47 deletions

2
build
View File

@@ -1 +1 @@
22
23

View File

@@ -9,7 +9,7 @@ fullnameOverride: ""
images:
owsec:
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owsec
tag: v2.7.0-RC4
tag: v2.7.0
pullPolicy: Always
# regcred:
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io

View File

@@ -3075,7 +3075,7 @@ namespace OpenWifi {
private:
std::vector<std::unique_ptr<Poco::Net::HTTPServer>> RESTServers_;
Poco::ThreadPool Pool_{"x-rest",32,128};
Poco::ThreadPool Pool_{"x-rest",8,128};
RESTAPI_GenericServer Server_;
RESTAPI_ExtServer() noexcept:
@@ -3209,7 +3209,7 @@ namespace OpenWifi {
const Poco::ThreadPool & Pool() { return Pool_; }
private:
std::vector<std::unique_ptr<Poco::Net::HTTPServer>> RESTServers_;
Poco::ThreadPool Pool_{"i-rest",32,96};
Poco::ThreadPool Pool_{"i-rest",4,64};
RESTAPI_GenericServer Server_;
RESTAPI_IntServer() noexcept:
@@ -3406,7 +3406,7 @@ namespace OpenWifi {
bool NoBuiltInCrypto_=false;
Poco::JWT::Signer Signer_;
Poco::Logger &Logger_;
Poco::ThreadPool TimerPool_{"timer:pool",2,16};
Poco::ThreadPool TimerPool_{"timer:pool",2,32};
std::unique_ptr<BusEventManager> BusEventManager_;
};
@@ -3602,14 +3602,14 @@ namespace OpenWifi {
FileChannel->setProperty("archive", "timestamp");
FileChannel->setProperty("path", LoggingLocation);
Poco::AutoPtr<Poco::AsyncChannel> Async_File(new Poco::AsyncChannel(FileChannel));
Poco::AutoPtr<Poco::AsyncChannel> Async_Muxer(new Poco::AsyncChannel(LogMuxer()));
Poco::AutoPtr<Poco::SplitterChannel> Splitter(new Poco::SplitterChannel);
Splitter->addChannel(Async_File);
Splitter->addChannel(Async_Muxer);
// Poco::AutoPtr<Poco::AsyncChannel> Async_Muxer(new Poco::AsyncChannel(LogMuxer()));
// Poco::AutoPtr<Poco::SplitterChannel> Splitter(new Poco::SplitterChannel);
// Splitter->addChannel(Async_File);
// Splitter->addChannel(Async_Muxer);
Poco::AutoPtr<Poco::PatternFormatter> Formatter(new Poco::PatternFormatter);
Formatter->setProperty("pattern", LoggingFormat);
Poco::AutoPtr<Poco::FormattingChannel> FormattingChannel(
new Poco::FormattingChannel(Formatter, Splitter));
new Poco::FormattingChannel(Formatter, Async_File));
Poco::Logger::root().setChannel(FormattingChannel);
}
auto Level = Poco::Logger::parseLevel(MicroService::instance().ConfigGetString("logging.level", "debug"));

View File

@@ -179,13 +179,19 @@ getlogo() {
}
createuser() {
payload="{ \"id\": \"0\", \"email\" : \"$1\", \"currentPassword\" : \"$2\", \"changePassword\" : true}"
case $3 in
root|admin|subscriber|csr|system|installer|noc|accounting)
payload="{ \"id\": \"0\", \"email\" : \"$1\", \"currentPassword\" : \"$2\", \"changePassword\" : true, \"userRole\" : \"$3\" }"
curl ${FLAGS} -X POST "https://${OWSEC}/api/v1/user/0" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \
-d "$payload" > ${result_file}
jq < ${result_file}
jq < ${result_file} ;;
*)
echo "Error: userRole has to be one of root|admin|subscriber|csr|system|installer|noc|accounting"
exit 1 ;;
esac
}
createsub() {
@@ -199,13 +205,19 @@ createsub() {
}
createuser_v() {
payload="{ \"id\": \"0\", \"email\" : \"$1\", \"currentPassword\" : \"$2\", \"changePassword\" : true}"
case $3 in
root|admin|subscriber|csr|system|installer|noc|accounting)
payload="{ \"id\": \"0\", \"email\" : \"$1\", \"currentPassword\" : \"$2\", \"changePassword\" : true, \"userRole\" : \"$3\" }"
curl ${FLAGS} -X POST "https://${OWSEC}/api/v1/user/0?email_verification=true" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \
-d "$payload" > ${result_file}
jq < ${result_file}
jq < ${result_file} ;;
*)
echo "Error: userRole has to be one of root|admin|subscriber|csr|system|installer|noc|accounting"
exit 1 ;;
esac
}
deleteuser() {
@@ -447,7 +459,7 @@ test_service() {
echo "----------------"
echo "Create test user"
echo "----------------"
createuser testuser@mail.telecominfraproject.com 'Test123!'
createuser testuser@mail.telecominfraproject.com 'Test123!' accounting
check_response $result_file
USER_ID="$(jq -r '.id' < $result_file)"
@@ -484,8 +496,8 @@ help() {
echo "listendpoints Get all the system endpoints."
echo "emailtest Generate a forgot Password e-amil to the logged in user."
echo "me Show information about the logged user."
echo "createuser <email> <password> Create a user with an initial password and force the user to change password."
echo "createuser_v <email> <password> Same as create user but also force an e-mail verification."
echo "createuser <email> <password> <userrole> Create a user with an initial password and force the user to change password."
echo "createuser_v <email> <password> <userrole> Same as create user but also force an e-mail verification."
echo "deleteuser <user UUID> Delete the user."
echo "getuser <user UUID> Get the user information."
echo "listusers List users."
@@ -507,9 +519,9 @@ help() {
shopt -s nocasematch
case "$1" in
"createuser") login; createuser "$2" "$3"; logout;;
"createuser") login; createuser "$2" "$3" "$4"; logout;;
"createsub") login; createsub "$2" "$3"; logout;;
"createuser_v") login; createuser_v "$2" "$3"; logout;;
"createuser_v") login; createuser_v "$2" "$3" "$4"; logout;;
"createsub_v") login; createsub_v "$2" "$3"; logout;;
"deleteuser") login; deleteuser "$2" ; logout;;
"deletesub") login; deletesub "$2" ; logout;;