Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #16 #86

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions dev/cosbench-controller-web/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,23 @@
<welcome-file>/index.html</welcome-file>
</welcome-file-list>

<security-constraint>
<web-resource-collection>
<web-resource-name>management pages</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>controller</role-name>
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Basic Authentication Area</realm-name>
</login-config>

<security-role>
<role-name>controller</role-name>
</security-role>

</web-app>
19 changes: 19 additions & 0 deletions dev/cosbench-driver-web/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,24 @@
<welcome-file-list>
<welcome-file>/index.html</welcome-file>
</welcome-file-list>

<security-constraint>
<web-resource-collection>
<web-resource-name>management pages</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>driver</role-name>
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Basic Authentication</realm-name>
</login-config>

<security-role>
<role-name>driver</role-name>
</security-role>

</web-app>
23 changes: 12 additions & 11 deletions release/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ address=127.0.0.1:19088
usage()
{
echo
echo "Usage: $0 <action: submit|cancel|info> <parameter> <web ip:port>"
echo "Usage: $0 <username:password> <action: submit|cancel|info> <parameter> <web ip:port>"
echo " - action:"
echo " - <submit> <configuration file>: submit configuration and start workload"
echo " - <cancel> <workload id>: cancel workload"
Expand All @@ -40,26 +40,27 @@ if [ $# -lt 1 ]; then
exit 1
fi

action=$1
user=$1
action=$2

case $action in
"submit")
if [ $# -ge 3 ]; then
address=$3
if [ $# -ge 4 ]; then
address=$4
fi
curl -F config=@$2 http://${address}/controller/cli/submit.action
curl -u $user -F config=@$3 http://${address}/controller/cli/submit.action
;;
"info")
if [ $# -ge 2 ]; then
address=$2
if [ $# -ge 3 ]; then
address=$3
fi
curl http://${address}/controller/cli/index.action
curl -u $user http://${address}/controller/cli/index.action
;;
"cancel")
if [ $# -ge 3 ]; then
adddress=$3
if [ $# -ge 4 ]; then
adddress=$4
fi
curl -d id=$2 http://${address}/controller/cli/cancel.action
curl -u $user -d id=$3 http://${address}/controller/cli/cancel.action
;;
*)
echo "!!!Unknown action: $action"
Expand Down
2 changes: 2 additions & 0 deletions release/conf/controller-tomcat-server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<Service name="Catalina">
<Connector port="19088" protocol="HTTP/1.1" />
<Engine name="Standalone" defaultHost="0.0.0.0">
<Realm className="org.apache.catalina.realm.MemoryRealm"
pathname="./conf/cosbench-users.xml"/>
<Host name="0.0.0.0" unpackWARs="false" autoDeploy="false"
liveDeploy="false" deployOnStartup="false" xmlValidation="false"
xmlNamespaceAware="false" />
Expand Down
6 changes: 6 additions & 0 deletions release/conf/cosbench-users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="controller"/>
<role rolename="driver"/>
<user username="anonymous" password="cosbench" roles="controller,driver"/>
</tomcat-users>
2 changes: 2 additions & 0 deletions release/conf/driver-tomcat-server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<Service name="Catalina">
<Connector port="18088" protocol="HTTP/1.1" />
<Engine name="Standalone" defaultHost="0.0.0.0">
<Realm className="org.apache.catalina.realm.MemoryRealm"
pathname="./conf/cosbench-users.xml"/>
<Host name="0.0.0.0" unpackWARs="false" autoDeploy="false"
liveDeploy="false" deployOnStartup="false" xmlValidation="false"
xmlNamespaceAware="false" />
Expand Down