mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-01 03:07:59 +00:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -128,7 +128,7 @@ RUN mkdir -p "$OWSEC_ROOT" "$OWSEC_CONFIG" && \
|
|||||||
|
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
librdkafka++1 gosu gettext ca-certificates bash jq curl wget \
|
librdkafka++1 gosu gettext ca-certificates bash jq curl wget \
|
||||||
libmariadb-dev-compat libpq5 unixodbc
|
libmariadb-dev-compat libpq5 unixodbc postgresql-client
|
||||||
|
|
||||||
COPY readiness_check /readiness_check
|
COPY readiness_check /readiness_check
|
||||||
COPY test_scripts/curl/cli /cli
|
COPY test_scripts/curl/cli /cli
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ fullnameOverride: ""
|
|||||||
images:
|
images:
|
||||||
owsec:
|
owsec:
|
||||||
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owsec
|
repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owsec
|
||||||
tag: v2.7.0-RC3
|
tag: main
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
# regcred:
|
# regcred:
|
||||||
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io
|
# registry: tip-tip-wlan-cloud-ucentral.jfrog.io
|
||||||
|
|||||||
@@ -179,13 +179,19 @@ getlogo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createuser() {
|
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" \
|
curl ${FLAGS} -X POST "https://${OWSEC}/api/v1/user/0" \
|
||||||
-H "Accept: application/json" \
|
-H "Accept: application/json" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Bearer ${token}" \
|
-H "Authorization: Bearer ${token}" \
|
||||||
-d "$payload" > ${result_file}
|
-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() {
|
createsub() {
|
||||||
@@ -199,13 +205,19 @@ createsub() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createuser_v() {
|
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" \
|
curl ${FLAGS} -X POST "https://${OWSEC}/api/v1/user/0?email_verification=true" \
|
||||||
-H "Accept: application/json" \
|
-H "Accept: application/json" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Bearer ${token}" \
|
-H "Authorization: Bearer ${token}" \
|
||||||
-d "$payload" > ${result_file}
|
-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() {
|
deleteuser() {
|
||||||
@@ -447,7 +459,7 @@ test_service() {
|
|||||||
echo "----------------"
|
echo "----------------"
|
||||||
echo "Create test user"
|
echo "Create test user"
|
||||||
echo "----------------"
|
echo "----------------"
|
||||||
createuser testuser@mail.telecominfraproject.com 'Test123!'
|
createuser testuser@mail.telecominfraproject.com 'Test123!' accounting
|
||||||
check_response $result_file
|
check_response $result_file
|
||||||
USER_ID="$(jq -r '.id' < $result_file)"
|
USER_ID="$(jq -r '.id' < $result_file)"
|
||||||
|
|
||||||
@@ -484,8 +496,8 @@ help() {
|
|||||||
echo "listendpoints Get all the system endpoints."
|
echo "listendpoints Get all the system endpoints."
|
||||||
echo "emailtest Generate a forgot Password e-amil to the logged in user."
|
echo "emailtest Generate a forgot Password e-amil to the logged in user."
|
||||||
echo "me Show information about the logged 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 <email> <password> <userrole> 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_v <email> <password> <userrole> Same as create user but also force an e-mail verification."
|
||||||
echo "deleteuser <user UUID> Delete the user."
|
echo "deleteuser <user UUID> Delete the user."
|
||||||
echo "getuser <user UUID> Get the user information."
|
echo "getuser <user UUID> Get the user information."
|
||||||
echo "listusers List users."
|
echo "listusers List users."
|
||||||
@@ -507,9 +519,9 @@ help() {
|
|||||||
shopt -s nocasematch
|
shopt -s nocasematch
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"createuser") login; createuser "$2" "$3"; logout;;
|
"createuser") login; createuser "$2" "$3" "$4"; logout;;
|
||||||
"createsub") login; createsub "$2" "$3"; 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;;
|
"createsub_v") login; createsub_v "$2" "$3"; logout;;
|
||||||
"deleteuser") login; deleteuser "$2" ; logout;;
|
"deleteuser") login; deleteuser "$2" ; logout;;
|
||||||
"deletesub") login; deletesub "$2" ; logout;;
|
"deletesub") login; deletesub "$2" ; logout;;
|
||||||
|
|||||||
Reference in New Issue
Block a user