neris-api-client 1.3.1__tar.gz → 1.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {neris_api_client-1.3.1/src/neris_api_client.egg-info → neris_api_client-1.3.3}/PKG-INFO +1 -1
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/pyproject.toml +1 -1
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client/client.py +7 -7
- {neris_api_client-1.3.1 → neris_api_client-1.3.3/src/neris_api_client.egg-info}/PKG-INFO +1 -1
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/LICENSE +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/README.md +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/setup.cfg +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client/__init__.py +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client/config.py +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client/models.py +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client.egg-info/SOURCES.txt +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client.egg-info/dependency_links.txt +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client.egg-info/requires.txt +0 -0
- {neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: neris_api_client
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.3
|
|
4
4
|
Summary: NERIS API Client
|
|
5
5
|
Author-email: Ben Coleman <ben.coleman@ul.org>, Tommy Messbauer <thomas.messbauer@ul.org>, Joseph Pagani <joseph.pagani@ul.org>
|
|
6
6
|
Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
|
|
@@ -47,6 +47,7 @@ class _NerisApiClient:
|
|
|
47
47
|
case GrantType.CLIENT_CREDENTIALS:
|
|
48
48
|
assert config.client_id is not None
|
|
49
49
|
assert config.client_secret is not None
|
|
50
|
+
self.client_creds = base64.b64encode(f"{config.client_id}:{config.client_secret}".encode("utf-8")).decode("utf-8")
|
|
50
51
|
case GrantType.PASSWORD:
|
|
51
52
|
assert config.username is not None
|
|
52
53
|
assert config.password is not None
|
|
@@ -73,11 +74,9 @@ class _NerisApiClient:
|
|
|
73
74
|
)
|
|
74
75
|
|
|
75
76
|
case GrantType.CLIENT_CREDENTIALS:
|
|
76
|
-
client_creds = base64.b64encode(f"{self.config.client_id}:{self.config.client_secret}".encode("utf-8")).decode("utf-8")
|
|
77
|
-
|
|
78
77
|
res = self._session.post(
|
|
79
78
|
token_url,
|
|
80
|
-
headers={"Authorization": f"Basic {client_creds}",
|
|
79
|
+
headers={"Authorization": f"Basic {self.client_creds}", "Content-Type": "application/x-www-form-urlencoded"},
|
|
81
80
|
data={"grant_type": GrantType.CLIENT_CREDENTIALS},
|
|
82
81
|
)
|
|
83
82
|
|
|
@@ -87,7 +86,7 @@ class _NerisApiClient:
|
|
|
87
86
|
res = self._session.post(
|
|
88
87
|
token_url,
|
|
89
88
|
# No basic auth needed for Cognito refresh tokens
|
|
90
|
-
headers={
|
|
89
|
+
headers={"Content-Type": "application/x-www-form-urlencoded"},
|
|
91
90
|
data={
|
|
92
91
|
"grant_type": "refresh_token",
|
|
93
92
|
"refresh_token": self.tokens.refresh_token,
|
|
@@ -97,7 +96,8 @@ class _NerisApiClient:
|
|
|
97
96
|
case GrantType.CLIENT_CREDENTIALS:
|
|
98
97
|
res = self._session.post(
|
|
99
98
|
token_url,
|
|
100
|
-
|
|
99
|
+
# Basic auth required for NERIS refresh tokens
|
|
100
|
+
headers={"Authorization": f"Basic {self.client_creds}", "Content-Type": "application/x-www-form-urlencoded"},
|
|
101
101
|
data={
|
|
102
102
|
"grant_type": "refresh_token",
|
|
103
103
|
"refresh_token": self.tokens.refresh_token,
|
|
@@ -316,8 +316,8 @@ class NerisApiClient(_NerisApiClient):
|
|
|
316
316
|
def create_api_integration(self, neris_id: str, title: str) -> Dict[str, Any]:
|
|
317
317
|
return self._call("post", f"/account/integration/{neris_id}", data={ "title": title })
|
|
318
318
|
|
|
319
|
-
def generate_api_secret(self, client_id: str) -> Dict[str, Any]:
|
|
320
|
-
return self._call("post", f"/account/credential/{client_id}")
|
|
319
|
+
def generate_api_secret(self, client_id: str, title: str) -> Dict[str, Any]:
|
|
320
|
+
return self._call("post", f"/account/credential/{client_id}", data={ "title": title })
|
|
321
321
|
|
|
322
322
|
def list_integrations(self, neris_id: str) -> Dict[str, Any]:
|
|
323
323
|
return self._call("get", f"/account/integration/{neris_id}/list")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: neris_api_client
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.3
|
|
4
4
|
Summary: NERIS API Client
|
|
5
5
|
Author-email: Ben Coleman <ben.coleman@ul.org>, Tommy Messbauer <thomas.messbauer@ul.org>, Joseph Pagani <joseph.pagani@ul.org>
|
|
6
6
|
Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client.egg-info/requires.txt
RENAMED
|
File without changes
|
{neris_api_client-1.3.1 → neris_api_client-1.3.3}/src/neris_api_client.egg-info/top_level.txt
RENAMED
|
File without changes
|