gen3authz 2.2.0__tar.gz → 2.3.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.
- {gen3authz-2.2.0 → gen3authz-2.3.0}/PKG-INFO +2 -2
- {gen3authz-2.2.0 → gen3authz-2.3.0}/pyproject.toml +1 -1
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/client/arborist/base.py +6 -2
- {gen3authz-2.2.0 → gen3authz-2.3.0}/LICENSE +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/NOTICE +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/__init__.py +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/client/__init__.py +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/client/arborist/__init__.py +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/client/arborist/async_client.py +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/client/arborist/client.py +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/client/arborist/errors.py +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/client/base.py +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/client/errors.py +0 -0
- {gen3authz-2.2.0 → gen3authz-2.3.0}/src/gen3authz/utils.py +0 -0
|
@@ -846,14 +846,18 @@ class BaseArboristClient(AuthzClient):
|
|
|
846
846
|
return True
|
|
847
847
|
|
|
848
848
|
@maybe_sync
|
|
849
|
-
async def grant_bulk_user_policy(self, username, policy_ids):
|
|
849
|
+
async def grant_bulk_user_policy(self, username, policy_ids, expires_at=None):
|
|
850
850
|
"""
|
|
851
851
|
MUST be user name, and not serial user ID
|
|
852
852
|
"""
|
|
853
853
|
url = self._user_url + "/{}/bulk/policy".format(quote(username))
|
|
854
854
|
request = []
|
|
855
855
|
for policy_id in policy_ids:
|
|
856
|
-
|
|
856
|
+
policy_request = {"policy": policy_id}
|
|
857
|
+
if expires_at is not None:
|
|
858
|
+
expires = datetime.datetime.utcfromtimestamp(expires_at)
|
|
859
|
+
policy_request["expires_at"] = expires.isoformat() + "Z"
|
|
860
|
+
request.append(policy_request)
|
|
857
861
|
response = await self.post(url, json=request, expect_json=False)
|
|
858
862
|
if response.code != 204:
|
|
859
863
|
self.logger.error(
|
|
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
|