mirror of https://github.com/zulip/zulip.git
api: Drop HTTP Digest authentication
(imported from commit 6867528cbd51a9e4a7cdacb181befcd034b90d59)
This commit is contained in:
parent
18f1efc6a2
commit
f7400fc8b4
|
@ -19,11 +19,7 @@ class HumbugAPI():
|
|||
request["api-key"] = self.api_key
|
||||
while True:
|
||||
try:
|
||||
res = requests.post(self.base_url + url,
|
||||
data=request,
|
||||
verify=True,
|
||||
auth=requests.auth.HTTPDigestAuth('tabbott',
|
||||
'xxxxxxxxxxxxxxxxx'))
|
||||
res = requests.post(self.base_url + url, data=request, verify=True)
|
||||
if res.status_code == requests.codes.service_unavailable:
|
||||
# On 503 errors, try again after a short sleep
|
||||
time.sleep(0.5)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#!/bin/sh
|
||||
# Two quick API tests using curl
|
||||
curl --digest -u tabbott:xxxxxxxxxxxxxxxxx https://app.humbughq.com/api/v1/send_message -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "email=tabbott@humbughq.com" -d "type=personal" -d "content=test" -d "recipient=tabbott@humbughq.com"
|
||||
curl --digest -u "tabbott:xxxxxxxxxxxxxxxxx" https://app.humbughq.com/api/v1/get_messages -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "email=tabbott@humbughq.com"
|
||||
curl https://app.humbughq.com/api/v1/send_message -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "email=tabbott@humbughq.com" -d "type=personal" -d "content=test" -d "recipient=tabbott@humbughq.com"
|
||||
curl https://app.humbughq.com/api/v1/get_messages -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "email=tabbott@humbughq.com"
|
||||
|
||||
# Replace '--digest -u tabbott:xxxxxxxxxxxxxxxxx https://app.humbughq.com'
|
||||
# with "http://127.0.0.1:8000" for local testing
|
||||
# Or replace https://app.humbughq.com with your local test instance
|
||||
|
|
Loading…
Reference in New Issue