anaplan-sdk 0.4.4a1__py3-none-any.whl → 0.4.4a3__py3-none-any.whl
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.
- anaplan_sdk/_auth.py +10 -7
- anaplan_sdk/_oauth.py +6 -6
- {anaplan_sdk-0.4.4a1.dist-info → anaplan_sdk-0.4.4a3.dist-info}/METADATA +1 -1
- {anaplan_sdk-0.4.4a1.dist-info → anaplan_sdk-0.4.4a3.dist-info}/RECORD +6 -6
- {anaplan_sdk-0.4.4a1.dist-info → anaplan_sdk-0.4.4a3.dist-info}/WHEEL +0 -0
- {anaplan_sdk-0.4.4a1.dist-info → anaplan_sdk-0.4.4a3.dist-info}/licenses/LICENSE +0 -0
anaplan_sdk/_auth.py
CHANGED
@@ -159,7 +159,7 @@ class AnaplanOAuthCodeAuth(_AnaplanAuth):
|
|
159
159
|
self,
|
160
160
|
client_id: str,
|
161
161
|
client_secret: str,
|
162
|
-
|
162
|
+
redirect_uri: str,
|
163
163
|
token: dict[str, str] | None = None,
|
164
164
|
authorization_url: str = "https://us1a.app.anaplan.com/auth/prelogin",
|
165
165
|
token_url: str = "https://us1a.app.anaplan.com/oauth/token",
|
@@ -175,7 +175,7 @@ class AnaplanOAuthCodeAuth(_AnaplanAuth):
|
|
175
175
|
:param client_id: The client ID of your Anaplan Oauth 2.0 application. This Application
|
176
176
|
must be an Authorization Code Grant application.
|
177
177
|
:param client_secret: The client secret of your Anaplan Oauth 2.0 application.
|
178
|
-
:param
|
178
|
+
:param redirect_uri: The URL to which the user will be redirected after authorizing the
|
179
179
|
application.
|
180
180
|
:param authorization_url: The URL to which the user will be redirected to authorize the
|
181
181
|
application. Defaults to the Anaplan Prelogin Page, where the user can select the
|
@@ -193,7 +193,7 @@ class AnaplanOAuthCodeAuth(_AnaplanAuth):
|
|
193
193
|
self._oauth = _OAuthRequestFactory(
|
194
194
|
client_id=client_id,
|
195
195
|
client_secret=client_secret,
|
196
|
-
|
196
|
+
redirect_uri=redirect_uri,
|
197
197
|
scope=scope,
|
198
198
|
authorization_url=authorization_url,
|
199
199
|
token_url=token_url,
|
@@ -237,7 +237,7 @@ class AnaplanRefreshTokenAuth(_AnaplanAuth):
|
|
237
237
|
self,
|
238
238
|
client_id: str,
|
239
239
|
client_secret: str,
|
240
|
-
|
240
|
+
redirect_uri: str,
|
241
241
|
token: dict[str, str],
|
242
242
|
token_url: str = "https://us1a.app.anaplan.com/oauth/token",
|
243
243
|
):
|
@@ -245,11 +245,14 @@ class AnaplanRefreshTokenAuth(_AnaplanAuth):
|
|
245
245
|
This class is a utility class for long-lived `Client` or `AsyncClient` instances that use
|
246
246
|
OAuth. It expects that you have a valid OAuth token with a refresh token, which will be used
|
247
247
|
to refresh the access token when it expires.
|
248
|
+
|
248
249
|
:param client_id: The client ID of your Anaplan Oauth 2.0 application. This Application
|
249
250
|
must be an Authorization Code Grant application.
|
250
251
|
:param client_secret: The client secret of your Anaplan Oauth 2.0 application.
|
251
|
-
:param
|
252
|
+
:param redirect_uri: The URL to which the user will be redirected after authorizing the
|
252
253
|
application.
|
254
|
+
:param token: The OAuth token dictionary containing at least the `access_token` and
|
255
|
+
`refresh_token`.
|
253
256
|
:param token_url: The URL to post the refresh token request to in order to fetch the access
|
254
257
|
token.
|
255
258
|
"""
|
@@ -257,10 +260,10 @@ class AnaplanRefreshTokenAuth(_AnaplanAuth):
|
|
257
260
|
self._oauth = _OAuthRequestFactory(
|
258
261
|
client_id=client_id,
|
259
262
|
client_secret=client_secret,
|
260
|
-
|
263
|
+
redirect_uri=redirect_uri,
|
261
264
|
token_url=token_url,
|
262
265
|
)
|
263
|
-
super().__init__(self.
|
266
|
+
super().__init__(self._oauth_token["access_token"])
|
264
267
|
|
265
268
|
def _build_auth_request(self) -> httpx.Request:
|
266
269
|
return self._oauth.refresh_token_request(self._oauth_token["refresh_token"])
|
anaplan_sdk/_oauth.py
CHANGED
@@ -13,7 +13,7 @@ class _BaseOauth:
|
|
13
13
|
self,
|
14
14
|
client_id: str,
|
15
15
|
client_secret: str,
|
16
|
-
|
16
|
+
redirect_uri: str,
|
17
17
|
authorization_url: str = "https://us1a.app.anaplan.com/auth/prelogin",
|
18
18
|
token_url: str = "https://us1a.app.anaplan.com/oauth/token",
|
19
19
|
validation_url: str = "https://auth.anaplan.com/token/validate",
|
@@ -38,7 +38,7 @@ class _BaseOauth:
|
|
38
38
|
:param client_id: The client ID of your Anaplan Oauth 2.0 application. This Application
|
39
39
|
must be an Authorization Code Grant application.
|
40
40
|
:param client_secret: The client secret of your Anaplan Oauth 2.0 application.
|
41
|
-
:param
|
41
|
+
:param redirect_uri: The URL to which the user will be redirected after authorizing the
|
42
42
|
application.
|
43
43
|
:param authorization_url: The URL to which the user will be redirected to authorize the
|
44
44
|
application. Defaults to the Anaplan Prelogin Page, where the user can select the
|
@@ -53,7 +53,7 @@ class _BaseOauth:
|
|
53
53
|
"""
|
54
54
|
self._client_id = client_id
|
55
55
|
self._client_secret = client_secret
|
56
|
-
self.
|
56
|
+
self._redirect_uri = redirect_uri
|
57
57
|
self._authorization_url = authorization_url
|
58
58
|
self._token_url = token_url
|
59
59
|
self._validation_url = validation_url
|
@@ -86,7 +86,7 @@ class _BaseOauth:
|
|
86
86
|
auth_url = authorization_url or self._authorization_url
|
87
87
|
state = state or self._state_generator()
|
88
88
|
url, _, _ = self._oauth.prepare_authorization_request(
|
89
|
-
auth_url, state, self.
|
89
|
+
auth_url, state, self._redirect_uri, self._scope
|
90
90
|
)
|
91
91
|
return url, state
|
92
92
|
|
@@ -94,7 +94,7 @@ class _BaseOauth:
|
|
94
94
|
url, headers, body = self._oauth.prepare_token_request(
|
95
95
|
authorization_response=authorization_response,
|
96
96
|
token_url=self._token_url,
|
97
|
-
redirect_url=self.
|
97
|
+
redirect_url=self._redirect_uri,
|
98
98
|
client_secret=self._client_secret,
|
99
99
|
)
|
100
100
|
return httpx.Request(method="POST", url=url, headers=headers, content=body)
|
@@ -206,7 +206,7 @@ class Oauth(_BaseOauth):
|
|
206
206
|
url, headers, body = self._oauth.prepare_token_request(
|
207
207
|
authorization_response=authorization_response,
|
208
208
|
token_url=self._token_url,
|
209
|
-
redirect_url=self.
|
209
|
+
redirect_url=self._redirect_uri,
|
210
210
|
client_secret=self._client_secret,
|
211
211
|
)
|
212
212
|
with httpx.Client() as client:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: anaplan-sdk
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.4a3
|
4
4
|
Summary: Streamlined Python Interface for Anaplan
|
5
5
|
Project-URL: Homepage, https://vinzenzklass.github.io/anaplan-sdk/
|
6
6
|
Project-URL: Repository, https://github.com/VinzenzKlass/anaplan-sdk
|
@@ -1,7 +1,7 @@
|
|
1
1
|
anaplan_sdk/__init__.py,sha256=lDFhs0IobOH7a34jqtAgcj9X1bR5hnFRkkkCl_vPHpo,357
|
2
|
-
anaplan_sdk/_auth.py,sha256=
|
2
|
+
anaplan_sdk/_auth.py,sha256=wB6znPwnUQ3pG7dRqpZZMdxb0V-XsZELASY881t4ocE,12834
|
3
3
|
anaplan_sdk/_base.py,sha256=9CdLshORWsLixOyoFa3A0Bka5lhLwlZrQI5sEdBcGFI,12298
|
4
|
-
anaplan_sdk/_oauth.py,sha256=
|
4
|
+
anaplan_sdk/_oauth.py,sha256=AynlJDrGIinQT0jwxI2RSvtU4D7Wasyw3H1uicdlLVI,12672
|
5
5
|
anaplan_sdk/exceptions.py,sha256=ALkA9fBF0NQ7dufFxV6AivjmHyuJk9DOQ9jtJV2n7f0,1809
|
6
6
|
anaplan_sdk/_async_clients/__init__.py,sha256=pZXgMMg4S9Aj_pxQCaSiPuNG-sePVGBtNJ0133VjqW4,364
|
7
7
|
anaplan_sdk/_async_clients/_alm.py,sha256=O1_r-O1tNDq7vXRwE2UEFE5S2bPmPh4IAQPQ8bmZfQE,3297
|
@@ -24,7 +24,7 @@ anaplan_sdk/models/_bulk.py,sha256=dHP3kMvsKONCZS6mHB271-wp2S4P3rM874Ita8TzABU,8
|
|
24
24
|
anaplan_sdk/models/_transactional.py,sha256=_0UbVR9D5QABI29yloYrJTSgL-K0EU7PzPeJu5LdhnY,4854
|
25
25
|
anaplan_sdk/models/cloud_works.py,sha256=nfn_LHPR-KmW7Tpvz-5qNCzmR8SYgvsVV-lx5iDlyqI,19425
|
26
26
|
anaplan_sdk/models/flows.py,sha256=SuLgNj5-2SeE3U1i8iY8cq2IkjuUgd_3M1n2ENructk,3625
|
27
|
-
anaplan_sdk-0.4.
|
28
|
-
anaplan_sdk-0.4.
|
29
|
-
anaplan_sdk-0.4.
|
30
|
-
anaplan_sdk-0.4.
|
27
|
+
anaplan_sdk-0.4.4a3.dist-info/METADATA,sha256=GTtQ-OiFOT9r5UWggC_25nGzrCDZMilYZeSOxUiwNBI,3545
|
28
|
+
anaplan_sdk-0.4.4a3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
29
|
+
anaplan_sdk-0.4.4a3.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
30
|
+
anaplan_sdk-0.4.4a3.dist-info/RECORD,,
|
File without changes
|
File without changes
|