Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from MaybeNetwork/otp-2021
Add two factor callback
- Loading branch information
Showing
7 changed files
with
261 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
tests/cassettes/ScriptAuthorizer_refresh_with__invalid_otp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"http_interactions": [ | ||
{ | ||
"recorded_at": "2021-05-21T00:48:30", | ||
"request": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "grant_type=password&otp=fake&password=<PASSWORD>&username=<USERNAME>" | ||
}, | ||
"headers": { | ||
"Accept": [ | ||
"*/*" | ||
], | ||
"Accept-Encoding": [ | ||
"gzip, deflate" | ||
], | ||
"Authorization": [ | ||
"Basic <BASIC_AUTH>" | ||
], | ||
"Connection": [ | ||
"close" | ||
], | ||
"Content-Length": [ | ||
"152" | ||
], | ||
"Content-Type": [ | ||
"application/x-www-form-urlencoded" | ||
], | ||
"Cookie": [ | ||
"edgebucket=7C1qdPEdiInzFy9WaL; loid=bSusfEGk5JXrZYhhyW" | ||
], | ||
"User-Agent": [ | ||
"prawcore:test (by /u/bboe) prawcore/2.0.0" | ||
] | ||
}, | ||
"method": "POST", | ||
"uri": "https://www.reddit.com/api/v1/access_token" | ||
}, | ||
"response": { | ||
"body": { | ||
"encoding": "UTF-8", | ||
"string": "{\"error\": \"invalid_grant\"}" | ||
}, | ||
"headers": { | ||
"Accept-Ranges": [ | ||
"bytes" | ||
], | ||
"Connection": [ | ||
"close" | ||
], | ||
"Content-Length": [ | ||
"26" | ||
], | ||
"Content-Type": [ | ||
"application/json; charset=UTF-8" | ||
], | ||
"Date": [ | ||
"Fri, 21 May 2021 00:48:33 GMT" | ||
], | ||
"Server": [ | ||
"snooserv" | ||
], | ||
"Strict-Transport-Security": [ | ||
"max-age=15552000; includeSubDomains; preload" | ||
], | ||
"Via": [ | ||
"1.1 varnish" | ||
], | ||
"X-Moose": [ | ||
"majestic" | ||
], | ||
"cache-control": [ | ||
"max-age=0, must-revalidate" | ||
], | ||
"x-content-type-options": [ | ||
"nosniff" | ||
], | ||
"x-frame-options": [ | ||
"SAMEORIGIN" | ||
], | ||
"x-ratelimit-remaining": [ | ||
"297" | ||
], | ||
"x-ratelimit-reset": [ | ||
"87" | ||
], | ||
"x-ratelimit-used": [ | ||
"3" | ||
], | ||
"x-xss-protection": [ | ||
"1; mode=block" | ||
] | ||
}, | ||
"status": { | ||
"code": 200, | ||
"message": "OK" | ||
}, | ||
"url": "https://www.reddit.com/api/v1/access_token" | ||
} | ||
} | ||
], | ||
"recorded_with": "betamax/0.8.1" | ||
} |
103 changes: 103 additions & 0 deletions
103
tests/cassettes/ScriptAuthorizer_refresh_with__valid_otp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"http_interactions": [ | ||
{ | ||
"recorded_at": "2021-05-21T00:43:11", | ||
"request": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "grant_type=password&otp=000000&password=<PASSWORD>&username=<USERNAME>" | ||
}, | ||
"headers": { | ||
"Accept": [ | ||
"*/*" | ||
], | ||
"Accept-Encoding": [ | ||
"gzip, deflate" | ||
], | ||
"Authorization": [ | ||
"Basic <BASIC_AUTH>" | ||
], | ||
"Connection": [ | ||
"close" | ||
], | ||
"Content-Length": [ | ||
"152" | ||
], | ||
"Content-Type": [ | ||
"application/x-www-form-urlencoded" | ||
], | ||
"Cookie": [ | ||
"edgebucket=W5X0f17fr5uGzS0Jxd; loid=yU0JIU6fMP2ZtL3FsU" | ||
], | ||
"User-Agent": [ | ||
"prawcore:test (by /u/bboe) prawcore/2.0.0" | ||
] | ||
}, | ||
"method": "POST", | ||
"uri": "https://www.reddit.com/api/v1/access_token" | ||
}, | ||
"response": { | ||
"body": { | ||
"encoding": "UTF-8", | ||
"string": "{\"access_token\": \"00000000-000000000000000000000000000000\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"scope\": \"*\"}" | ||
}, | ||
"headers": { | ||
"Accept-Ranges": [ | ||
"bytes" | ||
], | ||
"Connection": [ | ||
"close" | ||
], | ||
"Content-Length": [ | ||
"117" | ||
], | ||
"Content-Type": [ | ||
"application/json; charset=UTF-8" | ||
], | ||
"Date": [ | ||
"Fri, 21 May 2021 00:43:14 GMT" | ||
], | ||
"Server": [ | ||
"snooserv" | ||
], | ||
"Strict-Transport-Security": [ | ||
"max-age=15552000; includeSubDomains; preload" | ||
], | ||
"Via": [ | ||
"1.1 varnish" | ||
], | ||
"X-Moose": [ | ||
"majestic" | ||
], | ||
"cache-control": [ | ||
"max-age=0, must-revalidate" | ||
], | ||
"x-content-type-options": [ | ||
"nosniff" | ||
], | ||
"x-frame-options": [ | ||
"SAMEORIGIN" | ||
], | ||
"x-ratelimit-remaining": [ | ||
"299" | ||
], | ||
"x-ratelimit-reset": [ | ||
"406" | ||
], | ||
"x-ratelimit-used": [ | ||
"1" | ||
], | ||
"x-xss-protection": [ | ||
"1; mode=block" | ||
] | ||
}, | ||
"status": { | ||
"code": 200, | ||
"message": "OK" | ||
}, | ||
"url": "https://www.reddit.com/api/v1/access_token" | ||
} | ||
} | ||
], | ||
"recorded_with": "betamax/0.8.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters