Skip to content

Commit 70010ab

Browse files
committed
chore: dependency update
1 parent 71d0283 commit 70010ab

File tree

5 files changed

+431
-462
lines changed

5 files changed

+431
-462
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ classifiers = [
3131
requires-python = ">= 3.10"
3232
dependencies = [
3333
"scim2-filter-parser>=0.7.0",
34-
"scim2-models>=0.4.1",
34+
"scim2-models>=0.6.1",
3535
"werkzeug>=3.0.3",
3636
]
3737

scim2_server/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def query_resources(
278278

279279
if search_request.sort_by is not None:
280280
descending = search_request.sort_order == SearchRequest.SortOrder.descending
281-
sort_operator = ResolveSortOperator(search_request.sort_by)
281+
sort_operator = ResolveSortOperator(str(search_request.sort_by))
282282

283283
# To ensure that unset attributes are sorted last (when ascending, as defined in the RFC),
284284
# we have to divide the result set into a set and unset subset.

scim2_server/operators.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@
2626

2727
def patch_resource(resource: Resource, operation: PatchOperation):
2828
"""Run a patch operation against a resource."""
29+
path = str(operation.path) if operation.path else None
2930
match operation.op:
3031
case PatchOperation.Op.add:
31-
operator = AddOperator(operation.path, operation.value)
32+
operator = AddOperator(path, operation.value)
3233
operator(resource)
3334
case PatchOperation.Op.remove:
34-
operator = RemoveOperator(operation.path, None)
35+
operator = RemoveOperator(path, None)
3536
operator(resource)
3637
case _: # PatchOperation.Op.replace
37-
operator = ReplaceOperator(operation.path, operation.value)
38+
operator = ReplaceOperator(path, operation.value)
3839
operator(resource)
3940

4041

scim2_server/utils.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,6 @@ def get_by_alias(
9797
raise SCIMException(Error.make_no_target_error()) from e
9898

9999

100-
def get_schemas(resource: Resource) -> list[str]:
101-
"""Return a list of all schemas possible for a given resource.
102-
103-
Note that this may include schemas the resource does not currently
104-
have (such as missing optional schema extensions).
105-
"""
106-
return resource.__class__.model_fields["schemas"].default
107-
108-
109100
def get_or_create(
110101
model: BaseModel, attribute_name: str, check_mutability: bool = False
111102
):
@@ -138,7 +129,7 @@ def get_or_create(
138129

139130

140131
def handle_extension(resource: Resource, scim_name: str) -> tuple[BaseModel, str]:
141-
default_schema = get_schemas(resource)[0].lower()
132+
default_schema = str(resource.__class__.__schema__).lower()
142133
if scim_name.lower().startswith(default_schema):
143134
scim_name = scim_name[len(default_schema) :].lstrip(":")
144135
return resource, scim_name

0 commit comments

Comments
 (0)