Skip to content
This repository was archived by the owner on Jan 7, 2024. It is now read-only.

Commit 75ef554

Browse files
authored
Merge pull request #125 from freedomofpress/add-journalist-name-to-reply
add journalist name to session and reply obj
2 parents aa15037 + 157effc commit 75ef554

File tree

58 files changed

+3491
-1625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3491
-1625
lines changed

data/setUp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"{\"body\": \"{\\\"passphrase\\\": \\\"correct horse battery staple profanity oil chewy\\\", \\\"username\\\": \\\"journalist\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/token\", \"timeout\": 20}+1": "{\"status\": 200, \"body\": \"{\\n \\\"expiration\\\": \\\"2020-03-30T22:54:18.785946Z\\\", \\n \\\"journalist_first_name\\\": null, \\n \\\"journalist_last_name\\\": null, \\n \\\"journalist_uuid\\\": \\\"a46e5678-32ab-4c9d-94d6-ef46214a105e\\\", \\n \\\"token\\\": \\\"eyJhbGciOiJIUzI1NiIsImV4cCI6MTU4NTYwODg1OCwiaWF0IjoxNTg1NTgwMDU4fQ.eyJpZCI6MX0.3ECVQJecByeF0bYcf0nHSPayyztBjSZuLMwAIaT5hnA\\\"\\n}\\n\", \"headers\": {\"Content-Type\": \"application/json\", \"Content-Length\": \"317\", \"Server\": \"Werkzeug/0.16.0 Python/3.5.2\", \"Date\": \"Mon, 30 Mar 2020 14:54:18 GMT\"}, \"version\": \"0.2.0-dev-20200330-060315\\n\"}"}
1+
{"{\"body\": \"{\\\"passphrase\\\": \\\"correct horse battery staple profanity oil chewy\\\", \\\"username\\\": \\\"journalist\\\"}\", \"method\": \"POST\", \"path_query\": \"api/v1/token\", \"timeout\": 20}+1": "{\"status\": 200, \"body\": \"{\\n \\\"expiration\\\": \\\"2020-09-01T03:23:28.417689Z\\\", \\n \\\"journalist_first_name\\\": \\\"\\\", \\n \\\"journalist_last_name\\\": \\\"\\\", \\n \\\"journalist_uuid\\\": \\\"eb6326bb-fb03-434b-a628-d093b1c8027d\\\", \\n \\\"token\\\": \\\"eyJpYXQiOjE1OTg5MDE4MDgsImV4cCI6MTU5ODkzMDYwOCwiYWxnIjoiSFMyNTYifQ.eyJpZCI6MX0.tMkp4aHcxOhQwARYa7Db3OL4JTz2iPSXNZbMO-eHLEE\\\"\\n}\\n\", \"headers\": {\"Content-Type\": \"application/json\", \"Content-Length\": \"313\", \"Server\": \"Werkzeug/0.16.0 Python/3.5.2\", \"Date\": \"Mon, 31 Aug 2020 19:23:28 GMT\"}, \"version\": \"0.3.0\\n\"}"}

data/test-badotp.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
11
interactions:
22
- request:
3-
body: '{"one_time_code": "no", "passphrase": "correct horse battery staple
4-
profanity oil chewy", "username": "journalist"}'
3+
body: '{"username": "journalist", "passphrase": "correct horse battery staple
4+
profanity oil chewy", "one_time_code": "no"}'
55
headers:
6-
Accept: ['*/*']
7-
Accept-Encoding: ['gzip, deflate']
8-
Connection: [keep-alive]
9-
Content-Length: ['119']
10-
User-Agent: [python-requests/2.20.0]
6+
Accept:
7+
- '*/*'
8+
Accept-Encoding:
9+
- gzip, deflate
10+
Connection:
11+
- keep-alive
12+
Content-Length:
13+
- '115'
14+
User-Agent:
15+
- python-requests/2.22.0
1116
method: POST
1217
uri: http://127.0.0.1:8081/api/v1/token
1318
response:
14-
body: {string: "{\n \"error\": \"Forbidden\",\n \"message\": \"Token authentication failed.\"\n}\n"}
19+
body:
20+
string: "{\n \"error\": \"Forbidden\", \n \"message\": \"Token authentication\
21+
\ failed.\"\n}\n"
1522
headers:
16-
Content-Length: ['73']
17-
Content-Type: [application/json]
18-
Date: ['Tue, 19 Mar 2019 18:56:30 GMT']
19-
Server: [Werkzeug/0.14.1 Python/2.7.12]
20-
status: {code: 403, message: FORBIDDEN}
23+
Content-Length:
24+
- '73'
25+
Content-Type:
26+
- application/json
27+
Date:
28+
- Mon, 31 Aug 2020 19:06:57 GMT
29+
Server:
30+
- Werkzeug/0.16.0 Python/3.5.2
31+
status:
32+
code: 403
33+
message: FORBIDDEN
2134
version: 1

data/test-badpassword.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
11
interactions:
22
- request:
3-
body: '{"one_time_code": "278592", "passphrase": "no", "username": "journalist"}'
3+
body: '{"username": "journalist", "passphrase": "no", "one_time_code": "205004"}'
44
headers:
5-
Accept: ['*/*']
6-
Accept-Encoding: ['gzip, deflate']
7-
Connection: [keep-alive]
8-
Content-Length: ['119']
9-
User-Agent: [python-requests/2.20.0]
5+
Accept:
6+
- '*/*'
7+
Accept-Encoding:
8+
- gzip, deflate
9+
Connection:
10+
- keep-alive
11+
Content-Length:
12+
- '73'
13+
User-Agent:
14+
- python-requests/2.22.0
1015
method: POST
1116
uri: http://127.0.0.1:8081/api/v1/token
1217
response:
13-
body: {string: "{\n \"error\": \"Forbidden\",\n \"message\": \"Token authentication failed.\"\n}\n"}
18+
body:
19+
string: "{\n \"error\": \"Forbidden\", \n \"message\": \"Token authentication\
20+
\ failed.\"\n}\n"
1421
headers:
15-
Content-Length: ['73']
16-
Content-Type: [application/json]
17-
Date: ['Tue, 19 Mar 2019 18:56:30 GMT']
18-
Server: [Werkzeug/0.14.1 Python/2.7.12]
19-
status: {code: 403, message: FORBIDDEN}
22+
Content-Length:
23+
- '73'
24+
Content-Type:
25+
- application/json
26+
Date:
27+
- Mon, 31 Aug 2020 19:06:57 GMT
28+
Server:
29+
- Werkzeug/0.16.0 Python/3.5.2
30+
status:
31+
code: 403
32+
message: FORBIDDEN
2033
version: 1

data/test-baduser.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
11
interactions:
22
- request:
3-
body: '{"one_time_code": "278592", "passphrase": "correct horse battery staple
4-
profanity oil chewy", "username": "no"}'
3+
body: '{"username": "no", "passphrase": "correct horse battery staple profanity
4+
oil chewy", "one_time_code": "205004"}'
55
headers:
6-
Accept: ['*/*']
7-
Accept-Encoding: ['gzip, deflate']
8-
Connection: [keep-alive]
9-
Content-Length: ['119']
10-
User-Agent: [python-requests/2.20.0]
6+
Accept:
7+
- '*/*'
8+
Accept-Encoding:
9+
- gzip, deflate
10+
Connection:
11+
- keep-alive
12+
Content-Length:
13+
- '111'
14+
User-Agent:
15+
- python-requests/2.22.0
1116
method: POST
1217
uri: http://127.0.0.1:8081/api/v1/token
1318
response:
14-
body: {string: "{\n \"error\": \"Forbidden\",\n \"message\": \"Token authentication failed.\"\n}\n"}
19+
body:
20+
string: "{\n \"error\": \"Forbidden\", \n \"message\": \"Token authentication\
21+
\ failed.\"\n}\n"
1522
headers:
16-
Content-Length: ['73']
17-
Content-Type: [application/json]
18-
Date: ['Tue, 19 Mar 2019 18:56:30 GMT']
19-
Server: [Werkzeug/0.14.1 Python/2.7.12]
20-
status: {code: 403, message: FORBIDDEN}
23+
Content-Length:
24+
- '73'
25+
Content-Type:
26+
- application/json
27+
Date:
28+
- Mon, 31 Aug 2020 19:06:57 GMT
29+
Server:
30+
- Werkzeug/0.16.0 Python/3.5.2
31+
status:
32+
code: 403
33+
message: FORBIDDEN
2134
version: 1

0 commit comments

Comments
 (0)