Skip to content

Commit 80e70c8

Browse files
authored
Merge branch 'main' into separate-clients
2 parents b0cb070 + 0425586 commit 80e70c8

File tree

8 files changed

+158
-173
lines changed

8 files changed

+158
-173
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- macos-latest
3232
- windows-latest
3333
steps:
34-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
3535
with:
3636
fetch-depth: 0
3737
- name: Setup python for test ${{ matrix.py }}
@@ -64,7 +64,7 @@ jobs:
6464
env:
6565
COVERAGE_FILE: "coverage"
6666
steps:
67-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
6868

6969
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
7070
id: download
@@ -92,7 +92,7 @@ jobs:
9292
name: gitleaks
9393
runs-on: ubuntu-latest
9494
steps:
95-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
9696
with:
9797
fetch-depth: 0
9898
- uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9

.github/workflows/python-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1818
- name: Setup
1919
uses: descope/.github/.github/actions/python/poetry/setup@main
2020
with:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
- id: flake8
3535
additional_dependencies: [Flake8-pyproject]
3636
- repo: https://github.com/python-poetry/poetry
37-
rev: 2.1.3
37+
rev: 2.1.4
3838
hooks:
3939
- id: poetry-export
4040
files: pyproject.toml
@@ -43,11 +43,11 @@ repos:
4343
- id: poetry-check
4444
files: pyproject.toml
4545
- repo: https://github.com/pre-commit/pre-commit
46-
rev: v4.2.0
46+
rev: v4.3.0
4747
hooks:
4848
- id: validate_manifest
4949
- repo: https://github.com/tox-dev/tox-ini-fmt
50-
rev: 1.5.0
50+
rev: 1.6.0
5151
hooks:
5252
- id: tox-ini-fmt
5353
args: ["-p", "type"]

descope/management/common.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,3 @@ def sort_to_dict(sort: List[Sort]) -> list:
407407
}
408408
)
409409
return sort_list
410-
411-
412-
def map_to_values_object(input_map: dict):
413-
if not input_map:
414-
return {}
415-
return {k: {"values": v} for k, v in input_map.items()}

descope/management/user.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
MgmtV1,
99
Sort,
1010
associated_tenants_to_dict,
11-
map_to_values_object,
1211
sort_to_dict,
1312
)
1413
from descope.management.user_pwd import UserPassword
@@ -652,7 +651,9 @@ def search_all(
652651
to_modified_time (int): Optional int, only include users whose last modification/update occurred on or before this time (in Unix epoch milliseconds)
653652
user_ids (List[str]): Optional list of user IDs to filter by
654653
tenant_role_ids (dict): Optional mapping of tenant ID to list of role IDs.
654+
Dict value is in the form of {"tenant_id": {"values":["role_id1", "role_id2"], "and": True}} if you want to match all roles (AND) or any role (OR).
655655
tenant_role_names (dict): Optional mapping of tenant ID to list of role names.
656+
Dict value is in the form of {"tenant_id": {"values":["role_name1", "role_name2"], "and": True}} if you want to match all roles (AND) or any role (OR).
656657
657658
Return value (dict):
658659
Return dict in the format
@@ -719,9 +720,9 @@ def search_all(
719720
body["toModifiedTime"] = to_modified_time
720721

721722
if tenant_role_ids is not None:
722-
body["tenantRoleIds"] = map_to_values_object(tenant_role_ids)
723+
body["tenantRoleIds"] = tenant_role_ids
723724
if tenant_role_names is not None:
724-
body["tenantRoleNames"] = map_to_values_object(tenant_role_names)
725+
body["tenantRoleNames"] = tenant_role_names
725726

726727
response = self._http.post(
727728
MgmtV1.users_search_path,
@@ -771,7 +772,9 @@ def search_all_test_users(
771772
from_modified_time (int): Optional int, only include users whose last modification/update occurred on or after this time (in Unix epoch milliseconds)
772773
to_modified_time (int): Optional int, only include users whose last modification/update occurred on or before this time (in Unix epoch milliseconds)
773774
tenant_role_ids (dict): Optional mapping of tenant ID to list of role IDs.
775+
Dict value is in the form of {"tenant_id": {"values":["role_id1", "role_id2"], "and": True}} if you want to match all roles (AND) or any role (OR).
774776
tenant_role_names (dict): Optional mapping of tenant ID to list of role names.
777+
Dict value is in the form of {"tenant_id": {"values":["role_name1", "role_name2"], "and": True}} if you want to match all roles (AND) or any role (OR).
775778
776779
Return value (dict):
777780
Return dict in the format
@@ -835,9 +838,9 @@ def search_all_test_users(
835838
body["toModifiedTime"] = to_modified_time
836839

837840
if tenant_role_ids is not None:
838-
body["tenantRoleIds"] = map_to_values_object(tenant_role_ids)
841+
body["tenantRoleIds"] = tenant_role_ids
839842
if tenant_role_names is not None:
840-
body["tenantRoleNames"] = map_to_values_object(tenant_role_names)
843+
body["tenantRoleNames"] = tenant_role_names
841844

842845
response = self._http.post(
843846
MgmtV1.test_users_search_path,

poetry.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)