Compare commits
4 Commits
update-actions
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cf6465f8c | |||
| 855d6412ef | |||
| aeb763c42c | |||
| 69867b3c10 |
@@ -1,6 +1,6 @@
|
||||
name: Tests
|
||||
|
||||
on: [push]
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
@@ -9,4 +9,4 @@ Scott Nixon
|
||||
Jason Dorweiler
|
||||
Pierre-Alain Dupont
|
||||
Karl Goetz
|
||||
|
||||
Alex Kerney
|
||||
|
||||
+10
@@ -3,6 +3,16 @@
|
||||
Release history
|
||||
===============
|
||||
|
||||
1.0.0 (2019-12-04)
|
||||
------------------
|
||||
|
||||
This is a *potentially* breaking change if you're working with a significantly older Discourse deployment.
|
||||
It's not entirely clear if header based authentication has been available since day 1 or was introduced in
|
||||
a recent version (you should be fine! ... but caveat emptor).
|
||||
|
||||
- Adds new invitation methods
|
||||
- Hard switch from query param based authorization to header-based authorization
|
||||
|
||||
0.9.0
|
||||
-----
|
||||
|
||||
|
||||
+2
-2
@@ -51,9 +51,9 @@ copyright = u'2014, Marc Sibson'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.9'
|
||||
version = '1.0'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.9.0'
|
||||
release = '1.0.0'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
__version__ = "0.9.0"
|
||||
__version__ = "1.0.0"
|
||||
|
||||
from pydiscourse.client import DiscourseClient
|
||||
|
||||
@@ -1350,12 +1350,13 @@ class DiscourseClient(object):
|
||||
dictionary of response body data or None
|
||||
|
||||
"""
|
||||
params["api_key"] = self.api_key
|
||||
if "api_username" not in params:
|
||||
params["api_username"] = self.api_username
|
||||
url = self.host + path
|
||||
|
||||
headers = {"Accept": "application/json; charset=utf-8"}
|
||||
headers = {
|
||||
"Accept": "application/json; charset=utf-8",
|
||||
"Api-Key": self.api_key,
|
||||
"Api-Username": self.api_username,
|
||||
}
|
||||
|
||||
# How many times should we retry if rate limited
|
||||
retry_count = 4
|
||||
|
||||
@@ -34,7 +34,7 @@ setup(
|
||||
]
|
||||
},
|
||||
classifiers=[
|
||||
"Development Status :: 5 - Production/Stable"
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Environment :: Web Environment",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
|
||||
@@ -49,12 +49,12 @@ class ClientBaseTestCase(unittest.TestCase):
|
||||
self.assertEqual(args[0], verb)
|
||||
self.assertEqual(args[1], self.host + url)
|
||||
|
||||
kwargs = kwargs["params"]
|
||||
self.assertEqual(kwargs.pop("api_username"), self.api_username)
|
||||
self.assertEqual(kwargs.pop("api_key"), self.api_key)
|
||||
headers = kwargs["headers"]
|
||||
self.assertEqual(headers.pop("Api-Username"), self.api_username)
|
||||
self.assertEqual(headers.pop("Api-Key"), self.api_key)
|
||||
|
||||
if verb == "GET":
|
||||
self.assertEqual(kwargs, params)
|
||||
self.assertEqual(kwargs["params"], params)
|
||||
|
||||
|
||||
class TestClientRequests(ClientBaseTestCase):
|
||||
|
||||
Reference in New Issue
Block a user