aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2020-04-12 10:22:29 +0200
committerneodarz <neodarz@neodarz.net>2020-04-12 10:22:29 +0200
commita566d53fc7f724309607d0f8ec6f68f698a544da (patch)
tree5d14ffa331df4211f3c2f30c9c24aa144a5c18cd
parent86de4c99f707992f9b1c6008cdbefc5540523ac2 (diff)
downloadpyfunkwhale-a566d53fc7f724309607d0f8ec6f68f698a544da.tar.xz
pyfunkwhale-a566d53fc7f724309607d0f8ec6f68f698a544da.zip
Add an endpoint for get a JWT token
Diffstat (limited to '')
-rw-r--r--README.md2
-rw-r--r--pyfunkwhale/client.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/README.md b/README.md
index 70cc2ba..fdf580e 100644
--- a/README.md
+++ b/README.md
@@ -78,7 +78,7 @@ List of features implemented or planned:
- [/] Auth
- [x] Login with OAuth2 Authorization Code flow
- [ ] Register an OAuth2 application
- - [ ] Get an JWT token
+ - [x] Get an JWT token
- [ ] Create an account
- [ ] Request a password request
- [ ] Retrieve user information
diff --git a/pyfunkwhale/client.py b/pyfunkwhale/client.py
index 1fce019..cf19673 100644
--- a/pyfunkwhale/client.py
+++ b/pyfunkwhale/client.py
@@ -76,6 +76,13 @@ class Client(object):
self._get_token()
write_file(self.token_filename, self.token)
+ def _get_JWT_token(self):
+ """
+ Get a JWT token.
+ """
+ data = {"username": self.username, "password": self.password}
+ return self.call('/token', 'post', data=data).json()
+
def call(self, endpoint: str, method: str, params: dict = None,
data: dict = None) -> Response:
"""