lsrestclient 1.3.1__tar.gz → 1.3.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lsrestclient
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: REST Api Client
5
5
  Author: mba
6
6
  Author-email: bartel@electronic-shop.lu
@@ -1,10 +1,14 @@
1
1
  from lsrestclient import LsRestClient, DownStreamError
2
2
 
3
3
 
4
- def auth_am_login_apikey(org_id: str, api_key: str) -> str:
4
+ def auth_am_login(**kwargs) -> str:
5
5
  am = LsRestClient.from_env("AM_BASE_URL", "am", True)
6
- r = am.post("/auth/login", body=dict(ORG_ID=org_id, API_KEY=api_key))
6
+ r = am.post("/auth/login", body=kwargs)
7
7
  if r.status_code == 200:
8
8
  return r.json().get("access_token")
9
9
  else:
10
10
  raise DownStreamError("/auth/login", r.status_code, r.content)
11
+
12
+
13
+ def auth_am_login_apikey(org_id: str, api_key: str) -> str:
14
+ return auth_am_login(ORG_ID=org_id, API_KEY=api_key)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "lsrestclient"
3
- version = "1.3.1"
3
+ version = "1.3.2"
4
4
  description = "REST Api Client"
5
5
  authors = ["mba <bartel@electronic-shop.lu>"]
6
6
  readme = "README.md"
File without changes