Skip to content

Commit

Permalink
revert CSRF changes
Browse files Browse the repository at this point in the history
  • Loading branch information
starsky77 committed Dec 10, 2024
1 parent 9d04fc5 commit 3376cb9
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
61 changes: 61 additions & 0 deletions tsung_scritps/tsung_auth_login.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="notice">
<clients>
<client host="localhost" maxusers="32768" use_controller_vm="true" />
</clients>

<servers>
<server host="ziqi.eba-wqi6mj7g.us-west-2.elasticbeanstalk.com" port="80" type="tcp" />
</servers>

<load>
<!-- Phase 1 -->
<arrivalphase phase="1" duration="20" unit="second">
<users arrivalrate="1" unit="second"></users>
</arrivalphase>
<!-- Phase 2 -->
<arrivalphase phase="2" duration="20" unit="second">
<users arrivalrate="4" unit="second"></users>
</arrivalphase>
<!-- Phase 3 -->
<arrivalphase phase="3" duration="20" unit="second">
<users arrivalrate="8" unit="second"></users>
</arrivalphase>
<!-- Phase 4 -->
<arrivalphase phase="4" duration="60" unit="second">
<users arrivalrate="16" unit="second"></users>
</arrivalphase>
<!-- Phase 5 -->
<arrivalphase phase="5" duration="60" unit="second">
<users arrivalrate="64" unit="second"></users>
</arrivalphase>
<arrivalphase phase="6" duration="60" unit="second">
<users arrivalrate="128" unit="second"></users>
</arrivalphase>
</load>

<options>
<!-- Set connection timeout to 2 seconds -->
<option name="global_ack_timeout" value="2000"></option>
</options>

<sessions>
<session name="register-login-logout" type="ts_http" weight="1">
<setdynvars sourcetype="random_string" length="20">
<var name="rand_str1" />
</setdynvars>

<request>
<dyn_variable name="user_id" jsonpath="$.user.id"/>
<http url="/api/signup" method="POST" version="1.1" contents="username=user_%%_rand_str1%%;password=w12345678;password_confirmation=w12345678;"></http>
</request>
<thinktime value="2" random="true"></thinktime>

<request><http url="/api/login" method="POST" version="1.1" contents="username=user_%%_rand_str%%;password=w12345678;"></http></request>
<thinktime value="2" random="true"></thinktime>

<request><http url="/api/logout" method="DELETE" version="1.1" contents="user_id=%%_user_id%%"></http></request>
</session>
</sessions>
</tsung>
49 changes: 49 additions & 0 deletions tsung_scritps/tsung_unauth.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="debug">
<clients>
<client host="localhost" maxusers="32768" use_controller_vm="true" />
</clients>

<servers>
<server host="ziqiTest.eba-wqi6mj7g.us-west-2.elasticbeanstalk.com" port="80" type="tcp" />
</servers>

<load>
<!-- Phase 1 -->
<arrivalphase phase="1" duration="20" unit="second">
<users arrivalrate="1" unit="second"></users>
</arrivalphase>
<!-- Phase 2 -->
</load>

<options>
<!-- Set connection timeout to 2 seconds -->
<option name="global_ack_timeout" value="2000"></option>
</options>

<sessions>
<session name="register-login-logout" type="ts_http" weight="1">
<setdynvars sourcetype="random_string" length="13">
<var name="rand_str1" />
</setdynvars>

<request>
<!-- <dyn_variable name="post_id" jsonpath="$.id"/> -->
<http url="/api/posts" method="POST" version="1.1" contents="content=random_content">
<http_header name="Content-Type" value="application/json"/>
<http_header name="Accept" value="application/json"/>
</http>
</request>
<thinktime value="2" random="true"></thinktime>

<request>
<http url="/api/posts/%%_post_id%%/comments" method="POST" version="1.1" contents="postId=%%_post_id%%;content=unauth_%%_rand_str1%%">
<http_header name="Content-Type" value="application/json"/>
<http_header name="Accept" value="application/json"/>
</http>
</request>

</session>
</sessions>
</tsung>

0 comments on commit 3376cb9

Please sign in to comment.