auth0-python 4.8.0__tar.gz → 4.9.0__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.
- {auth0_python-4.8.0 → auth0_python-4.9.0}/PKG-INFO +3 -1
- {auth0_python-4.8.0 → auth0_python-4.9.0}/README.md +2 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/__init__.py +1 -1
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/back_channel_login.py +1 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/get_token.py +35 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/pushed_authorization_requests.py +5 -2
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/users.py +43 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/rest.py +7 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_back_channel_login.py +60 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_get_token.py +30 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_pushed_authorization_requests.py +1 -1
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_users.py +33 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/pyproject.toml +1 -1
- {auth0_python-4.8.0 → auth0_python-4.9.0}/LICENSE +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/asyncify.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/__init__.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/async_token_verifier.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/base.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/client_authentication.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/database.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/delegated.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/enterprise.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/passwordless.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/revoke_token.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/social.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/token_verifier.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/users.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/exceptions.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/__init__.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/actions.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/async_auth0.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/attack_protection.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/auth0.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/blacklists.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/branding.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/client_credentials.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/client_grants.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/clients.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/connections.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/custom_domains.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/device_credentials.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/email_templates.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/emails.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/grants.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/guardian.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/hooks.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/jobs.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/log_streams.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/logs.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/organizations.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/prompts.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/resource_servers.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/roles.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/rules.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/rules_configs.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/stats.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/tenants.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/tickets.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/user_blocks.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/management/users_by_email.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/rest_async.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/__init__.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/__init__.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_base.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_database.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_delegated.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_enterprise.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_passwordless.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_revoke_token.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_social.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_token_verifier.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_users.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/__init__.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_actions.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_atack_protection.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_auth0.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_blacklists.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_branding.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_client_credentials.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_client_grants.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_clients.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_connections.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_custom_domains.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_device_credentials.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_email_endpoints.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_emails.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_grants.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_guardian.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_hooks.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_jobs.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_log_streams.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_logs.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_organizations.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_prompts.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_resource_servers.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_rest.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_roles.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_rules.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_rules_configs.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_stats.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_tenants.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_tickets.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_user_blocks.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/management/test_users_by_email.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test_async/__init__.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test_async/test_async_auth0.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test_async/test_async_token_verifier.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test_async/test_asyncify.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/types.py +0 -0
- {auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auth0-python
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.9.0
|
|
4
4
|
Summary:
|
|
5
5
|
Home-page: https://auth0.com
|
|
6
6
|
License: MIT
|
|
@@ -111,7 +111,9 @@ For more code samples on how to integrate the auth0-python SDK in your Python ap
|
|
|
111
111
|
- Delegated ( `authentication.Delegated` )
|
|
112
112
|
- Enterprise ( `authentication.Enterprise` )
|
|
113
113
|
- API Authorization - Get Token ( `authentication.GetToken`)
|
|
114
|
+
- BackChannelLogin ( `authentication.BackChannelLogin`)
|
|
114
115
|
- Passwordless ( `authentication.Passwordless` )
|
|
116
|
+
- PushedAuthorizationRequests ( `authentication.PushedAuthorizationRequests` )
|
|
115
117
|
- RevokeToken ( `authentication.RevokeToken` )
|
|
116
118
|
- Social ( `authentication.Social` )
|
|
117
119
|
- Users ( `authentication.Users` )
|
|
@@ -88,7 +88,9 @@ For more code samples on how to integrate the auth0-python SDK in your Python ap
|
|
|
88
88
|
- Delegated ( `authentication.Delegated` )
|
|
89
89
|
- Enterprise ( `authentication.Enterprise` )
|
|
90
90
|
- API Authorization - Get Token ( `authentication.GetToken`)
|
|
91
|
+
- BackChannelLogin ( `authentication.BackChannelLogin`)
|
|
91
92
|
- Passwordless ( `authentication.Passwordless` )
|
|
93
|
+
- PushedAuthorizationRequests ( `authentication.PushedAuthorizationRequests` )
|
|
92
94
|
- RevokeToken ( `authentication.RevokeToken` )
|
|
93
95
|
- Social ( `authentication.Social` )
|
|
94
96
|
- Users ( `authentication.Users` )
|
|
@@ -277,3 +277,38 @@ class GetToken(AuthenticationBase):
|
|
|
277
277
|
"grant_type": grant_type,
|
|
278
278
|
},
|
|
279
279
|
)
|
|
280
|
+
|
|
281
|
+
def access_token_for_connection(
|
|
282
|
+
self,
|
|
283
|
+
subject_token_type: str,
|
|
284
|
+
subject_token: str,
|
|
285
|
+
requested_token_type: str,
|
|
286
|
+
connection: str | None = None,
|
|
287
|
+
grant_type: str = "urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token"
|
|
288
|
+
) -> Any:
|
|
289
|
+
"""Calls /oauth/token endpoint with federated-connection-access-token grant type
|
|
290
|
+
|
|
291
|
+
Args:
|
|
292
|
+
subject_token_type (str): String containing the type of token.
|
|
293
|
+
|
|
294
|
+
subject_token (str): String containing the value of subject_token_type.
|
|
295
|
+
|
|
296
|
+
requested_token_type (str): String containing the type of rquested token.
|
|
297
|
+
|
|
298
|
+
connection (str, optional): Denotes the name of a social identity provider configured to your application
|
|
299
|
+
|
|
300
|
+
Returns:
|
|
301
|
+
access_token, scope, issued_token_type, token_type
|
|
302
|
+
"""
|
|
303
|
+
|
|
304
|
+
return self.authenticated_post(
|
|
305
|
+
f"{self.protocol}://{self.domain}/oauth/token",
|
|
306
|
+
data={
|
|
307
|
+
"client_id": self.client_id,
|
|
308
|
+
"grant_type": grant_type,
|
|
309
|
+
"subject_token_type": subject_token_type,
|
|
310
|
+
"subject_token": subject_token,
|
|
311
|
+
"requested_token_type": requested_token_type,
|
|
312
|
+
"connection": connection,
|
|
313
|
+
},
|
|
314
|
+
)
|
{auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/authentication/pushed_authorization_requests.py
RENAMED
|
@@ -3,6 +3,7 @@ from typing import Any
|
|
|
3
3
|
from .base import AuthenticationBase
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
class PushedAuthorizationRequests(AuthenticationBase):
|
|
7
8
|
"""Pushed Authorization Request (PAR) endpoint"""
|
|
8
9
|
|
|
@@ -24,9 +25,11 @@ class PushedAuthorizationRequests(AuthenticationBase):
|
|
|
24
25
|
return self.authenticated_post(
|
|
25
26
|
f"{self.protocol}://{self.domain}/oauth/par",
|
|
26
27
|
data={
|
|
27
|
-
"client_id":
|
|
28
|
+
"client_id":self.client_id,
|
|
29
|
+
"client_secret":self.client_secret,
|
|
28
30
|
"response_type": response_type,
|
|
29
31
|
"redirect_uri": redirect_uri,
|
|
30
32
|
**kwargs,
|
|
31
33
|
},
|
|
32
|
-
|
|
34
|
+
headers={"Content-Type": "application/x-www-form-urlencoded"},
|
|
35
|
+
)
|
|
@@ -538,3 +538,46 @@ class Users:
|
|
|
538
538
|
|
|
539
539
|
url = self._url(f"{user_id}/authentication-methods/{authentication_method_id}")
|
|
540
540
|
return self.client.delete(url)
|
|
541
|
+
|
|
542
|
+
def list_tokensets(
|
|
543
|
+
self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True
|
|
544
|
+
):
|
|
545
|
+
"""List all the tokenset(s) associated to the user.
|
|
546
|
+
|
|
547
|
+
Args:
|
|
548
|
+
id (str): The user's id.
|
|
549
|
+
|
|
550
|
+
page (int, optional): The result's page number (zero based). By default,
|
|
551
|
+
retrieves the first page of results.
|
|
552
|
+
|
|
553
|
+
per_page (int, optional): The amount of entries per page. By default,
|
|
554
|
+
retrieves 25 results per page.
|
|
555
|
+
|
|
556
|
+
include_totals (bool, optional): True if the query summary is
|
|
557
|
+
to be included in the result, False otherwise. Defaults to True.
|
|
558
|
+
|
|
559
|
+
See https://auth0.com/docs/api/management/v2#!/Users/get_tokensets
|
|
560
|
+
"""
|
|
561
|
+
|
|
562
|
+
params = {
|
|
563
|
+
"per_page": per_page,
|
|
564
|
+
"page": page,
|
|
565
|
+
"include_totals": str(include_totals).lower(),
|
|
566
|
+
}
|
|
567
|
+
url = self._url(f"{id}/federated-connections-tokensets")
|
|
568
|
+
return self.client.get(url, params=params)
|
|
569
|
+
|
|
570
|
+
def delete_tokenset_by_id(
|
|
571
|
+
self, user_id: str, tokenset_id: str
|
|
572
|
+
) -> Any:
|
|
573
|
+
"""Deletes an tokenset by ID.
|
|
574
|
+
|
|
575
|
+
Args:
|
|
576
|
+
user_id (str): The user_id to delete an authentication method by ID for.
|
|
577
|
+
tokenset_id (str): The tokenset_id to delete an tokenset by ID for.
|
|
578
|
+
|
|
579
|
+
See: https://auth0.com/docs/api/management/v2#!/Users/delete_tokenset_by_id
|
|
580
|
+
"""
|
|
581
|
+
|
|
582
|
+
url = self._url(f"{user_id}/federated-connections-tokensets/{tokenset_id}")
|
|
583
|
+
return self.client.delete(url)
|
|
@@ -7,6 +7,7 @@ from json import dumps, loads
|
|
|
7
7
|
from random import randint
|
|
8
8
|
from time import sleep
|
|
9
9
|
from typing import TYPE_CHECKING, Any, Mapping
|
|
10
|
+
from urllib.parse import urlencode
|
|
10
11
|
|
|
11
12
|
import requests
|
|
12
13
|
|
|
@@ -152,6 +153,12 @@ class RestClient:
|
|
|
152
153
|
# Reset the metrics tracker
|
|
153
154
|
self._metrics = {"retries": 0, "backoff": []}
|
|
154
155
|
|
|
156
|
+
if data is None and json is not None and headers:
|
|
157
|
+
content_type = headers.get("Content-Type", "").lower() # Get Content-Type
|
|
158
|
+
if "application/x-www-form-urlencoded" in content_type:
|
|
159
|
+
data = urlencode(json) # Copy JSON data into data
|
|
160
|
+
json = None # Prevent JSON from being sent
|
|
161
|
+
|
|
155
162
|
kwargs = {
|
|
156
163
|
k: v
|
|
157
164
|
for k, v in {
|
{auth0_python-4.8.0 → auth0_python-4.9.0}/auth0/test/authentication/test_back_channel_login.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import unittest
|
|
3
3
|
from unittest import mock
|
|
4
|
+
import json
|
|
4
5
|
|
|
5
6
|
import requests
|
|
6
7
|
from ...exceptions import Auth0Error, RateLimitError
|
|
@@ -74,5 +75,64 @@ class TestBackChannelLogin(unittest.TestCase):
|
|
|
74
75
|
# Assert the error message is correct
|
|
75
76
|
self.assertIn("missing 1 required positional argument: \'scope\'", str(context.exception))
|
|
76
77
|
|
|
78
|
+
@mock.patch("auth0.rest.RestClient.post")
|
|
79
|
+
def test_with_authorization_details(self, mock_post):
|
|
80
|
+
g = BackChannelLogin("my.domain.com", "cid", client_secret="clsec")
|
|
81
|
+
g.back_channel_login(
|
|
82
|
+
binding_message="This is a binding message.",
|
|
83
|
+
login_hint={"format": "iss_sub", "iss": "https://my.domain.auth0.com/", "sub": "auth0|USER_ID"},
|
|
84
|
+
scope="openid",
|
|
85
|
+
authorization_details=[
|
|
86
|
+
{
|
|
87
|
+
"type":"payment_initiation","locations":["https://example.com/payments"],
|
|
88
|
+
"instructedAmount":
|
|
89
|
+
{
|
|
90
|
+
"currency":"EUR","amount":"123.50"
|
|
91
|
+
},
|
|
92
|
+
"creditorName":"Merchant A",
|
|
93
|
+
"creditorAccount":
|
|
94
|
+
{
|
|
95
|
+
"bic":"ABCIDEFFXXX",
|
|
96
|
+
"iban":"DE021001001093071118603"
|
|
97
|
+
},
|
|
98
|
+
"remittanceInformationUnstructured":"Ref Number Merchant"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
args, kwargs = mock_post.call_args
|
|
104
|
+
|
|
105
|
+
expected_data = {
|
|
106
|
+
"client_id": "cid",
|
|
107
|
+
"client_secret": "clsec",
|
|
108
|
+
"binding_message": "This is a binding message.",
|
|
109
|
+
"login_hint": {"format": "iss_sub", "iss": "https://my.domain.auth0.com/", "sub": "auth0|USER_ID" },
|
|
110
|
+
"scope": "openid",
|
|
111
|
+
"authorization_details": [
|
|
112
|
+
{
|
|
113
|
+
"type":"payment_initiation","locations":["https://example.com/payments"],
|
|
114
|
+
"instructedAmount":
|
|
115
|
+
{
|
|
116
|
+
"currency":"EUR","amount":"123.50"
|
|
117
|
+
},
|
|
118
|
+
"creditorName":"Merchant A",
|
|
119
|
+
"creditorAccount":
|
|
120
|
+
{
|
|
121
|
+
"bic":"ABCIDEFFXXX",
|
|
122
|
+
"iban":"DE021001001093071118603"
|
|
123
|
+
},
|
|
124
|
+
"remittanceInformationUnstructured":"Ref Number Merchant"
|
|
125
|
+
}],
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
actual_data = kwargs["data"]
|
|
129
|
+
|
|
130
|
+
self.assertEqual(args[0], "https://my.domain.com/bc-authorize")
|
|
131
|
+
|
|
132
|
+
self.assertEqual(
|
|
133
|
+
json.dumps(actual_data, sort_keys=True),
|
|
134
|
+
json.dumps(expected_data, sort_keys=True)
|
|
135
|
+
)
|
|
136
|
+
|
|
77
137
|
|
|
78
138
|
|
|
@@ -334,4 +334,34 @@ class TestGetToken(unittest.TestCase):
|
|
|
334
334
|
"auth_req_id": "reqid",
|
|
335
335
|
"grant_type": "urn:openid:params:grant-type:ciba",
|
|
336
336
|
},
|
|
337
|
+
)
|
|
338
|
+
|
|
339
|
+
@mock.patch("auth0.rest.RestClient.post")
|
|
340
|
+
def test_connection_login(self, mock_post):
|
|
341
|
+
g = GetToken("my.domain.com", "cid", client_secret="csec")
|
|
342
|
+
|
|
343
|
+
g.access_token_for_connection(
|
|
344
|
+
grant_type="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",
|
|
345
|
+
subject_token_type="urn:ietf:params:oauth:token-type:refresh_token",
|
|
346
|
+
subject_token="refid",
|
|
347
|
+
requested_token_type="http://auth0.com/oauth/token-type/federated-connection-access-token",
|
|
348
|
+
connection="google-oauth2"
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
args, kwargs = mock_post.call_args
|
|
352
|
+
|
|
353
|
+
print(kwargs["data"])
|
|
354
|
+
|
|
355
|
+
self.assertEqual(args[0], "https://my.domain.com/oauth/token")
|
|
356
|
+
self.assertEqual(
|
|
357
|
+
kwargs["data"],
|
|
358
|
+
{
|
|
359
|
+
"grant_type": "urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",
|
|
360
|
+
"client_id": "cid",
|
|
361
|
+
"client_secret": "csec",
|
|
362
|
+
"subject_token_type": "urn:ietf:params:oauth:token-type:refresh_token",
|
|
363
|
+
"subject_token": "refid",
|
|
364
|
+
"requested_token_type": "http://auth0.com/oauth/token-type/federated-connection-access-token",
|
|
365
|
+
"connection": "google-oauth2"
|
|
366
|
+
},
|
|
337
367
|
)
|
|
@@ -48,7 +48,7 @@ class TestRevokeToken(unittest.TestCase):
|
|
|
48
48
|
)
|
|
49
49
|
|
|
50
50
|
@mock.patch("auth0.rest.RestClient.post")
|
|
51
|
-
def
|
|
51
|
+
def test_with_authorization_details(self, mock_post):
|
|
52
52
|
a = PushedAuthorizationRequests("my.domain.com", "cid", client_secret="sh!")
|
|
53
53
|
a.pushed_authorization_request(
|
|
54
54
|
response_type="code",
|
|
@@ -403,3 +403,36 @@ class TestUsers(unittest.TestCase):
|
|
|
403
403
|
mock_instance.delete.assert_called_with(
|
|
404
404
|
"https://domain/api/v2/users/user_id/authentication-methods/authentication_method_id"
|
|
405
405
|
)
|
|
406
|
+
|
|
407
|
+
@mock.patch("auth0.management.users.RestClient")
|
|
408
|
+
def test_list_tokensets(self, mock_rc):
|
|
409
|
+
mock_instance = mock_rc.return_value
|
|
410
|
+
|
|
411
|
+
u = Users(domain="domain", token="jwttoken")
|
|
412
|
+
u.list_tokensets("an-id")
|
|
413
|
+
|
|
414
|
+
args, kwargs = mock_instance.get.call_args
|
|
415
|
+
self.assertEqual("https://domain/api/v2/users/an-id/federated-connections-tokensets", args[0])
|
|
416
|
+
self.assertEqual(
|
|
417
|
+
kwargs["params"], {"per_page": 25, "page": 0, "include_totals": "true"}
|
|
418
|
+
)
|
|
419
|
+
|
|
420
|
+
u.list_tokensets(id="an-id", page=1, per_page=50, include_totals=False)
|
|
421
|
+
|
|
422
|
+
args, kwargs = mock_instance.get.call_args
|
|
423
|
+
|
|
424
|
+
self.assertEqual("https://domain/api/v2/users/an-id/federated-connections-tokensets", args[0])
|
|
425
|
+
self.assertEqual(
|
|
426
|
+
kwargs["params"], {"per_page": 50, "page": 1, "include_totals": "false"}
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
@mock.patch("auth0.management.users.RestClient")
|
|
430
|
+
def test_delete_tokenset_by_id(self, mock_rc):
|
|
431
|
+
mock_instance = mock_rc.return_value
|
|
432
|
+
|
|
433
|
+
u = Users(domain="domain", token="jwttoken")
|
|
434
|
+
u.delete_tokenset_by_id("user_id", "tokenset_id")
|
|
435
|
+
|
|
436
|
+
mock_instance.delete.assert_called_with(
|
|
437
|
+
"https://domain/api/v2/users/user_id/federated-connections-tokensets/tokenset_id"
|
|
438
|
+
)
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry_dynamic_versioning.backend"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "auth0-python"
|
|
7
|
-
version = "4.
|
|
7
|
+
version = "4.9.0" # This is replaced by dynamic versioning
|
|
8
8
|
description = ""
|
|
9
9
|
authors = ["Auth0 <support@auth0.com>"]
|
|
10
10
|
license = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|