Remove password from login.py as well

This commit is contained in:
Alessio 2023-02-17 13:51:31 -05:00
parent f988d57e1c
commit ae9a9c3a47
2 changed files with 4 additions and 5 deletions

View File

@ -5,9 +5,6 @@ set -x
PS4='+(${BASH_SOURCE}:${LINENO}): ' PS4='+(${BASH_SOURCE}:${LINENO}): '
env
FAKE_VERSION="1.100.3489" FAKE_VERSION="1.100.3489"
./compile.sh $FAKE_VERSION ./compile.sh $FAKE_VERSION

View File

@ -5,7 +5,7 @@ Utility script for testing twitter login workflow
# pylint: disable=invalid-name # pylint: disable=invalid-name
import requests import requests
import os
guest_token_response = requests.post("https://api.twitter.com/1.1/guest/activate.json", headers={"Authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"}) guest_token_response = requests.post("https://api.twitter.com/1.1/guest/activate.json", headers={"Authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"})
assert guest_token_response.status_code == 200, f"HTTP Response code {guest_token_response.status_code}" assert guest_token_response.status_code == 200, f"HTTP Response code {guest_token_response.status_code}"
@ -20,7 +20,9 @@ headers = {
login_curl = "https://twitter.com/i/api/1.1/onboarding/task.json" login_curl = "https://twitter.com/i/api/1.1/onboarding/task.json"
username = "offline_twatter" username = "offline_twatter"
password = "S1pKIW#eRT016iA@OFcK" password = os.env.get("OFFLINE_TWATTER_PASSWD")
if not password:
print("No password provided! Please set OFFLINE_TWATTER_PASSWD environment variable and try again.")
response = requests.post(login_curl, headers=headers, params={"flow_name": "login"}) response = requests.post(login_curl, headers=headers, params={"flow_name": "login"})
assert response.status_code == 200, f"HTTP Response code {response.status_code}{response.json()}" assert response.status_code == 200, f"HTTP Response code {response.status_code}{response.json()}"